Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d4740983
Kaydet (Commit)
d4740983
authored
Tem 26, 2014
tarafından
Christoph Heer
Kaydeden (comit)
Tim Graham
Tem 30, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23067 -- Updated docs to use django-admin
üst
66630f58
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
91 additions
and
107 deletions
+91
-107
__init__.py
django/core/management/__init__.py
+4
-4
base.py
django/core/management/base.py
+3
-3
flush.py
django/core/management/commands/flush.py
+1
-1
inspectdb.py
django/core/management/commands/inspectdb.py
+1
-1
djangodocs.py
docs/_ext/djangodocs.py
+1
-1
troubleshooting.txt
docs/faq/troubleshooting.txt
+12
-28
apache-auth.txt
docs/howto/deployment/wsgi/apache-auth.txt
+1
-1
uwsgi.txt
docs/howto/deployment/wsgi/uwsgi.txt
+1
-1
windows.txt
docs/howto/windows.txt
+2
-6
index.txt
docs/index.txt
+1
-1
tutorial01.txt
docs/intro/tutorial01.txt
+4
-4
django-admin.1
docs/man/django-admin.1
+3
-4
contenttypes.txt
docs/ref/contrib/contenttypes.txt
+1
-1
commands.txt
docs/ref/contrib/gis/commands.txt
+1
-1
tutorial.txt
docs/ref/contrib/gis/tutorial.txt
+2
-2
messages.txt
docs/ref/contrib/messages.txt
+1
-1
staticfiles.txt
docs/ref/contrib/staticfiles.txt
+2
-2
django-admin.txt
docs/ref/django-admin.txt
+0
-0
fields.txt
docs/ref/models/fields.txt
+1
-1
settings.txt
docs/ref/settings.txt
+4
-4
1.7.txt
docs/releases/1.7.txt
+1
-1
index.txt
docs/topics/auth/index.txt
+1
-1
multi-db.txt
docs/topics/db/multi-db.txt
+1
-1
middleware.txt
docs/topics/http/middleware.txt
+1
-1
sessions.txt
docs/topics/http/sessions.txt
+1
-1
formatting.txt
docs/topics/i18n/formatting.txt
+1
-1
timezones.txt
docs/topics/i18n/timezones.txt
+1
-1
translation.txt
docs/topics/i18n/translation.txt
+20
-19
install.txt
docs/topics/install.txt
+6
-2
settings.txt
docs/topics/settings.txt
+6
-6
tests.py
tests/bash_completion/tests.py
+6
-6
No files found.
django/core/management/__init__.py
Dosyayı görüntüle @
d4740983
...
@@ -114,7 +114,7 @@ def call_command(name, *args, **options):
...
@@ -114,7 +114,7 @@ def call_command(name, *args, **options):
class
ManagementUtility
(
object
):
class
ManagementUtility
(
object
):
"""
"""
Encapsulates the logic of the django-admin
.py
and manage.py utilities.
Encapsulates the logic of the django-admin and manage.py utilities.
A ManagementUtility has a number of commands, which can be manipulated
A ManagementUtility has a number of commands, which can be manipulated
by editing the self.commands dictionary.
by editing the self.commands dictionary.
...
@@ -163,7 +163,7 @@ class ManagementUtility(object):
...
@@ -163,7 +163,7 @@ class ManagementUtility(object):
"""
"""
Tries to fetch the given subcommand, printing a message with the
Tries to fetch the given subcommand, printing a message with the
appropriate command called from the command line (usually
appropriate command called from the command line (usually
"django-admin
.py
" or "manage.py") if it can't be found.
"django-admin" or "manage.py") if it can't be found.
"""
"""
# Get commands outside of try block to prevent swallowing exceptions
# Get commands outside of try block to prevent swallowing exceptions
commands
=
get_commands
()
commands
=
get_commands
()
...
@@ -312,8 +312,8 @@ class ManagementUtility(object):
...
@@ -312,8 +312,8 @@ class ManagementUtility(object):
sys
.
stdout
.
write
(
self
.
main_help_text
()
+
'
\n
'
)
sys
.
stdout
.
write
(
self
.
main_help_text
()
+
'
\n
'
)
else
:
else
:
self
.
fetch_command
(
options
.
args
[
0
])
.
print_help
(
self
.
prog_name
,
options
.
args
[
0
])
self
.
fetch_command
(
options
.
args
[
0
])
.
print_help
(
self
.
prog_name
,
options
.
args
[
0
])
# Special-cases: We want 'django-admin
.py
--version' and
# Special-cases: We want 'django-admin --version' and
# 'django-admin
.py
--help' to work, for backwards compatibility.
# 'django-admin --help' to work, for backwards compatibility.
elif
subcommand
==
'version'
or
self
.
argv
[
1
:]
==
[
'--version'
]:
elif
subcommand
==
'version'
or
self
.
argv
[
1
:]
==
[
'--version'
]:
sys
.
stdout
.
write
(
django
.
get_version
()
+
'
\n
'
)
sys
.
stdout
.
write
(
django
.
get_version
()
+
'
\n
'
)
elif
self
.
argv
[
1
:]
in
([
'--help'
],
[
'-h'
]):
elif
self
.
argv
[
1
:]
in
([
'--help'
],
[
'-h'
]):
...
...
django/core/management/base.py
Dosyayı görüntüle @
d4740983
...
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
...
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
"""
"""
Base classes for writing management commands (named commands which can
Base classes for writing management commands (named commands which can
be executed through ``django-admin
.py
`` or ``manage.py``).
be executed through ``django-admin`` or ``manage.py``).
"""
"""
import
os
import
os
...
@@ -112,7 +112,7 @@ class BaseCommand(object):
...
@@ -112,7 +112,7 @@ class BaseCommand(object):
the command-parsing and -execution behavior, the normal flow works
the command-parsing and -execution behavior, the normal flow works
as follows:
as follows:
1. ``django-admin
.py
`` or ``manage.py`` loads the command class
1. ``django-admin`` or ``manage.py`` loads the command class
and calls its ``run_from_argv()`` method.
and calls its ``run_from_argv()`` method.
2. The ``run_from_argv()`` method calls ``create_parser()`` to get
2. The ``run_from_argv()`` method calls ``create_parser()`` to get
...
@@ -398,7 +398,7 @@ class BaseCommand(object):
...
@@ -398,7 +398,7 @@ class BaseCommand(object):
"(
%
s) and 'can_import_settings' (
%
s) command "
"(
%
s) and 'can_import_settings' (
%
s) command "
"options."
%
(
self
.
leave_locale_alone
,
"options."
%
(
self
.
leave_locale_alone
,
self
.
can_import_settings
))
self
.
can_import_settings
))
# Switch to US English, because django-admin
.py
creates database
# Switch to US English, because django-admin creates database
# content like permissions, and those shouldn't contain any
# content like permissions, and those shouldn't contain any
# translations.
# translations.
from
django.utils
import
translation
from
django.utils
import
translation
...
...
django/core/management/commands/flush.py
Dosyayı görüntüle @
d4740983
...
@@ -73,7 +73,7 @@ Are you sure you want to do this?
...
@@ -73,7 +73,7 @@ Are you sure you want to do this?
" * The database isn't running or isn't configured correctly.
\n
"
" * The database isn't running or isn't configured correctly.
\n
"
" * At least one of the expected database tables doesn't exist.
\n
"
" * At least one of the expected database tables doesn't exist.
\n
"
" * The SQL was invalid.
\n
"
" * The SQL was invalid.
\n
"
"Hint: Look at the output of 'django-admin
.py
sqlflush'. That's the SQL this command wasn't able to run.
\n
"
"Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.
\n
"
"The full error:
%
s"
)
%
(
connection
.
settings_dict
[
'NAME'
],
e
)
"The full error:
%
s"
)
%
(
connection
.
settings_dict
[
'NAME'
],
e
)
six
.
reraise
(
CommandError
,
CommandError
(
new_msg
),
sys
.
exc_info
()[
2
])
six
.
reraise
(
CommandError
,
CommandError
(
new_msg
),
sys
.
exc_info
()[
2
])
...
...
django/core/management/commands/inspectdb.py
Dosyayı görüntüle @
d4740983
...
@@ -43,7 +43,7 @@ class Command(BaseCommand):
...
@@ -43,7 +43,7 @@ class Command(BaseCommand):
yield
"# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table"
yield
"# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table"
yield
"# Feel free to rename the models, but don't rename db_table values or field names."
yield
"# Feel free to rename the models, but don't rename db_table values or field names."
yield
"#"
yield
"#"
yield
"# Also note: You'll have to insert the output of 'django-admin
.py
sqlcustom [app_label]'"
yield
"# Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]'"
yield
"# into your database."
yield
"# into your database."
yield
"from __future__ import unicode_literals"
yield
"from __future__ import unicode_literals"
yield
''
yield
''
...
...
docs/_ext/djangodocs.py
Dosyayı görüntüle @
d4740983
...
@@ -300,7 +300,7 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
...
@@ -300,7 +300,7 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
def
parse_django_admin_node
(
env
,
sig
,
signode
):
def
parse_django_admin_node
(
env
,
sig
,
signode
):
command
=
sig
.
split
(
' '
)[
0
]
command
=
sig
.
split
(
' '
)[
0
]
env
.
_django_curr_admin_command
=
command
env
.
_django_curr_admin_command
=
command
title
=
"django-admin
.py
%
s"
%
sig
title
=
"django-admin
%
s"
%
sig
signode
+=
addnodes
.
desc_name
(
title
,
title
)
signode
+=
addnodes
.
desc_name
(
title
,
title
)
return
sig
return
sig
...
...
docs/faq/troubleshooting.txt
Dosyayı görüntüle @
d4740983
...
@@ -5,50 +5,34 @@ Troubleshooting
...
@@ -5,50 +5,34 @@ Troubleshooting
This page contains some advice about errors and problems commonly encountered
This page contains some advice about errors and problems commonly encountered
during the development of Django applications.
during the development of Django applications.
.. _troubleshooting-django-admin
-py
:
.. _troubleshooting-django-admin:
Problems running django-admin
.py
Problems running django-admin
=============================
===
=============================
"command not found: django-admin
.py
"
"command not found: django-admin"
------------------------------------
------------------------------------
:doc:`django-admin
.py
</ref/django-admin>` should be on your system path if you
:doc:`django-admin </ref/django-admin>` should be on your system path if you
installed Django via ``python setup.py``. If it's not on your path, you can
installed Django via ``python setup.py``. If it's not on your path, you can
find it in ``site-packages/django/bin``, where ``site-packages`` is a directory
find it in ``site-packages/django/bin``, where ``site-packages`` is a directory
within your Python installation. Consider symlinking to :doc:`django-admin
.py
within your Python installation. Consider symlinking to :doc:`django-admin
</ref/django-admin>` from some place on your path, such as
</ref/django-admin>` from some place on your path, such as
:file:`/usr/local/bin`.
:file:`/usr/local/bin`.
Script name may differ in distribution packages
If ``django-admin`` doesn't work but ``django-admin.py`` does, you're probably
-----------------------------------------------
using a version of Django that doesn't match the version of this documentation.
``django-admin`` is new in Django 1.7.
If you installed Django using a Linux distribution's package manager
(e.g. ``apt-get`` or ``yum``) ``django-admin.py`` may have been renamed to
``django-admin``; use that instead.
Mac OS X permissions
Mac OS X permissions
--------------------
--------------------
If you're using Mac OS X, you may see the message "permission denied" when
If you're using Mac OS X, you may see the message "permission denied" when
you try to run ``django-admin
.py
``. This is because, on Unix-based systems like
you try to run ``django-admin``. This is because, on Unix-based systems like
OS X, a file must be marked as "executable" before it can be run as a program.
OS X, a file must be marked as "executable" before it can be run as a program.
To do this, open Terminal.app and navigate (using the ``cd`` command) to the
To do this, open Terminal.app and navigate (using the ``cd`` command) to the
directory where :doc:`django-admin.py </ref/django-admin>` is installed, then
directory where :doc:`django-admin </ref/django-admin>` is installed, then
run the command ``sudo chmod +x django-admin.py``.
run the command ``sudo chmod +x django-admin``.
Running virtualenv on Windows
-----------------------------
If you used virtualenv_ to :ref:`install Django <installing-official-release>`
on Windows, you may get an ``ImportError`` when you try to run
``django-admin.py``. This is because Windows does not run the
Python interpreter from your virtual environment unless you invoke it
directly. Instead, prefix all commands that use .py files with ``python`` and
use the full path to the file, like so:
``python C:\pythonXY\Scripts\django-admin.py``.
.. _virtualenv: http://www.virtualenv.org/
Miscellaneous
Miscellaneous
=============
=============
...
...
docs/howto/deployment/wsgi/apache-auth.txt
Dosyayı görüntüle @
d4740983
...
@@ -55,7 +55,7 @@ The ``WSGIAuthUserScript`` directive tells mod_wsgi to execute the
...
@@ -55,7 +55,7 @@ The ``WSGIAuthUserScript`` directive tells mod_wsgi to execute the
``check_password`` function in specified wsgi script, passing the user name and
``check_password`` function in specified wsgi script, passing the user name and
password that it receives from the prompt. In this example, the
password that it receives from the prompt. In this example, the
``WSGIAuthUserScript`` is the same as the ``WSGIScriptAlias`` that defines your
``WSGIAuthUserScript`` is the same as the ``WSGIScriptAlias`` that defines your
application :doc:`that is created by django-admin
.py
startproject
application :doc:`that is created by django-admin startproject
</howto/deployment/wsgi/index>`.
</howto/deployment/wsgi/index>`.
.. admonition:: Using Apache 2.2 with authentication
.. admonition:: Using Apache 2.2 with authentication
...
...
docs/howto/deployment/wsgi/uwsgi.txt
Dosyayı görüntüle @
d4740983
...
@@ -78,7 +78,7 @@ Here's an example command to start a uWSGI server::
...
@@ -78,7 +78,7 @@ Here's an example command to start a uWSGI server::
This assumes you have a top-level project package named ``mysite``, and
This assumes you have a top-level project package named ``mysite``, and
within it a module :file:`mysite/wsgi.py` that contains a WSGI ``application``
within it a module :file:`mysite/wsgi.py` that contains a WSGI ``application``
object. This is the layout you'll have if you ran ``django-admin
.py
object. This is the layout you'll have if you ran ``django-admin
startproject mysite`` (using your own project name in place of ``mysite``) with
startproject mysite`` (using your own project name in place of ``mysite``) with
a recent version of Django. If this file doesn't exist, you'll need to create
a recent version of Django. If this file doesn't exist, you'll need to create
it. See the :doc:`/howto/deployment/wsgi/index` documentation for the default
it. See the :doc:`/howto/deployment/wsgi/index` documentation for the default
...
...
docs/howto/windows.txt
Dosyayı görüntüle @
d4740983
...
@@ -60,7 +60,7 @@ In the command prompt, execute the following command: ``pip install django``.
...
@@ -60,7 +60,7 @@ In the command prompt, execute the following command: ``pip install django``.
This will download and install Django.
This will download and install Django.
After the installation has completed, you can verify your Django installation
After the installation has completed, you can verify your Django installation
by executing ``django-admin
.py
--version`` in the command prompt.
by executing ``django-admin --version`` in the command prompt.
.. versionchanged:: 1.7
.. versionchanged:: 1.7
...
@@ -73,7 +73,7 @@ with Django.
...
@@ -73,7 +73,7 @@ with Django.
Common pitfalls
Common pitfalls
===============
===============
* If ``django-admin
.py
`` only displays the help text no matter what arguments
* If ``django-admin`` only displays the help text no matter what arguments
it is given, there is probably a problem with the file association in
it is given, there is probably a problem with the file association in
Windows. Check if there is more than one environment variable set for
Windows. Check if there is more than one environment variable set for
running Python scripts in ``PATH``. This usually occurs when there is more
running Python scripts in ``PATH``. This usually occurs when there is more
...
@@ -86,7 +86,3 @@ Common pitfalls
...
@@ -86,7 +86,3 @@ Common pitfalls
set http_proxy=http://username:password@proxyserver:proxyport
set http_proxy=http://username:password@proxyserver:proxyport
set https_proxy=https://username:password@proxyserver:proxyport
set https_proxy=https://username:password@proxyserver:proxyport
* Executing ``django-admin.py`` opens up a text file. This is due to the text
editor being the default program for ``.py`` files. This must be changed
to the ``python.exe`` located in the folder where Python is installed.
docs/index.txt
Dosyayı görüntüle @
d4740983
...
@@ -191,7 +191,7 @@ testing of Django applications:
...
@@ -191,7 +191,7 @@ testing of Django applications:
* **Exceptions:**
* **Exceptions:**
:doc:`Overview <ref/exceptions>`
:doc:`Overview <ref/exceptions>`
* **django-admin
.py
and manage.py:**
* **django-admin and manage.py:**
:doc:`Overview <ref/django-admin>` |
:doc:`Overview <ref/django-admin>` |
:doc:`Adding custom commands <howto/custom-management-commands>`
:doc:`Adding custom commands <howto/custom-management-commands>`
...
...
docs/intro/tutorial01.txt
Dosyayı görüntüle @
d4740983
...
@@ -53,10 +53,10 @@ code, then run the following command:
...
@@ -53,10 +53,10 @@ code, then run the following command:
.. code-block:: bash
.. code-block:: bash
$ django-admin
.py
startproject mysite
$ django-admin startproject mysite
This will create a ``mysite`` directory in your current directory. If it didn't
This will create a ``mysite`` directory in your current directory. If it didn't
work, see :ref:`troubleshooting-django-admin
-py
`.
work, see :ref:`troubleshooting-django-admin`.
.. note::
.. note::
...
@@ -577,7 +577,7 @@ you'll commit migrations to your version control system and ship them with
...
@@ -577,7 +577,7 @@ you'll commit migrations to your version control system and ship them with
your app; they not only make your development easier, they're also useable by
your app; they not only make your development easier, they're also useable by
other developers and in production.
other developers and in production.
Read the :doc:`django-admin
.py
documentation </ref/django-admin>` for full
Read the :doc:`django-admin documentation </ref/django-admin>` for full
information on what the ``manage.py`` utility can do.
information on what the ``manage.py`` utility can do.
Playing with the API
Playing with the API
...
@@ -611,7 +611,7 @@ the Python import path to your :file:`mysite/settings.py` file.
...
@@ -611,7 +611,7 @@ the Python import path to your :file:`mysite/settings.py` file.
or ensure that directory is on the Python path, so that ``import mysite``
or ensure that directory is on the Python path, so that ``import mysite``
works.
works.
For more information on all of this, see the :doc:`django-admin
.py
For more information on all of this, see the :doc:`django-admin
documentation </ref/django-admin>`.
documentation </ref/django-admin>`.
Once you're in the shell, explore the :doc:`database API </topics/db/queries>`::
Once you're in the shell, explore the :doc:`database API </topics/db/queries>`::
...
...
docs/man/django-admin.1
Dosyayı görüntüle @
d4740983
.
TH
"django-admin
.py
"
"1"
"March 2008"
"Django Project"
""
.
TH
"django-admin"
"1"
"March 2008"
"Django Project"
""
.
SH
"NAME"
.
SH
"NAME"
django
\-
admin
.
py
\-
Utility
script
for
the
Django
Web
framework
django
\-
admin
.
py
\-
Utility
script
for
the
Django
Web
framework
.
SH
"SYNOPSIS"
.
SH
"SYNOPSIS"
...
@@ -166,8 +166,8 @@ Enables IPv6 addresses.
...
@@ -166,8 +166,8 @@ Enables IPv6 addresses.
Verbosity level: 0=minimal output, 1=normal output, 2=all output.
Verbosity level: 0=minimal output, 1=normal output, 2=all output.
.TP
.TP
.I \-\-traceback
.I \-\-traceback
By default, django-admin
.py
will show a simple error message whenever an
By default, django-admin will show a simple error message whenever an
error occurs. If you specify this option, django-admin
.py
will
error occurs. If you specify this option, django-admin will
output a full stack trace whenever an exception is raised.
output a full stack trace whenever an exception is raised.
.TP
.TP
.I \-l, \-\-locale=LOCALE
.I \-l, \-\-locale=LOCALE
...
@@ -235,4 +235,3 @@ AUTHORS file in the Django distribution for contributors.
...
@@ -235,4 +235,3 @@ AUTHORS file in the Django distribution for contributors.
.
SH
"LICENSE"
.
SH
"LICENSE"
New
BSD
license
.
For
the
full
license
text
refer
to
the
LICENSE
file
in
the
New
BSD
license
.
For
the
full
license
text
refer
to
the
LICENSE
file
in
the
Django
distribution
.
Django
distribution
.
docs/ref/contrib/contenttypes.txt
Dosyayı görüntüle @
d4740983
...
@@ -37,7 +37,7 @@ Installing the contenttypes framework
...
@@ -37,7 +37,7 @@ Installing the contenttypes framework
=====================================
=====================================
The contenttypes framework is included in the default
The contenttypes framework is included in the default
:setting:`INSTALLED_APPS` list created by ``django-admin
.py
startproject``,
:setting:`INSTALLED_APPS` list created by ``django-admin startproject``,
but if you've removed it or if you manually set up your
but if you've removed it or if you manually set up your
:setting:`INSTALLED_APPS` list, you can enable it by adding
:setting:`INSTALLED_APPS` list, you can enable it by adding
``'django.contrib.contenttypes'`` to your :setting:`INSTALLED_APPS` setting.
``'django.contrib.contenttypes'`` to your :setting:`INSTALLED_APPS` setting.
...
...
docs/ref/contrib/gis/commands.txt
Dosyayı görüntüle @
d4740983
...
@@ -7,7 +7,7 @@ GeoDjango Management Commands
...
@@ -7,7 +7,7 @@ GeoDjango Management Commands
inspectdb
inspectdb
=========
=========
.. describe:: django-admin
.py
inspectdb
.. describe:: django-admin inspectdb
When :mod:`django.contrib.gis` is in your :setting:`INSTALLED_APPS`, the
When :mod:`django.contrib.gis` is in your :setting:`INSTALLED_APPS`, the
:djadmin:`inspectdb` management command is overridden with one from GeoDjango.
:djadmin:`inspectdb` management command is overridden with one from GeoDjango.
...
...
docs/ref/contrib/gis/tutorial.txt
Dosyayı görüntüle @
d4740983
...
@@ -81,12 +81,12 @@ to create a :ref:`SpatiaLite database <create_spatialite_db>`.
...
@@ -81,12 +81,12 @@ to create a :ref:`SpatiaLite database <create_spatialite_db>`.
Create a New Project
Create a New Project
------------------------
------------------------
Use the standard ``django-admin
.py
`` script to create a project called
Use the standard ``django-admin`` script to create a project called
``geodjango``:
``geodjango``:
.. code-block:: bash
.. code-block:: bash
$ django-admin
.py
startproject geodjango
$ django-admin startproject geodjango
This will initialize a new project. Now, create a ``world`` Django application
This will initialize a new project. Now, create a ``world`` Django application
within the ``geodjango`` project:
within the ``geodjango`` project:
...
...
docs/ref/contrib/messages.txt
Dosyayı görüntüle @
d4740983
...
@@ -22,7 +22,7 @@ Enabling messages
...
@@ -22,7 +22,7 @@ Enabling messages
Messages are implemented through a :doc:`middleware </ref/middleware>`
Messages are implemented through a :doc:`middleware </ref/middleware>`
class and corresponding :doc:`context processor </ref/templates/api>`.
class and corresponding :doc:`context processor </ref/templates/api>`.
The default ``settings.py`` created by ``django-admin
.py
startproject``
The default ``settings.py`` created by ``django-admin startproject``
already contains all the settings required to enable message functionality:
already contains all the settings required to enable message functionality:
* ``'django.contrib.messages'`` is in :setting:`INSTALLED_APPS`.
* ``'django.contrib.messages'`` is in :setting:`INSTALLED_APPS`.
...
...
docs/ref/contrib/staticfiles.txt
Dosyayı görüntüle @
d4740983
...
@@ -198,7 +198,7 @@ in your project's :setting:`INSTALLED_APPS` setting.
...
@@ -198,7 +198,7 @@ in your project's :setting:`INSTALLED_APPS` setting.
Example usage::
Example usage::
django-admin
.py
runserver --nostatic
django-admin runserver --nostatic
.. django-admin-option:: --insecure
.. django-admin-option:: --insecure
...
@@ -214,7 +214,7 @@ in your project's :setting:`INSTALLED_APPS` setting. :djadmin:`runserver`
...
@@ -214,7 +214,7 @@ in your project's :setting:`INSTALLED_APPS` setting. :djadmin:`runserver`
Example usage::
Example usage::
django-admin
.py
runserver --insecure
django-admin runserver --insecure
.. _staticfiles-storages:
.. _staticfiles-storages:
...
...
docs/ref/django-admin.txt
Dosyayı görüntüle @
d4740983
This diff is collapsed.
Click to expand it.
docs/ref/models/fields.txt
Dosyayı görüntüle @
d4740983
...
@@ -183,7 +183,7 @@ scenes.
...
@@ -183,7 +183,7 @@ scenes.
.. attribute:: Field.db_index
.. attribute:: Field.db_index
If ``True``, :djadmin:`django-admin
.py
sqlindexes <sqlindexes>` will output a
If ``True``, :djadmin:`django-admin sqlindexes <sqlindexes>` will output a
``CREATE INDEX`` statement for this field.
``CREATE INDEX`` statement for this field.
``db_tablespace``
``db_tablespace``
...
...
docs/ref/settings.txt
Dosyayı görüntüle @
d4740983
...
@@ -1845,7 +1845,7 @@ A secret key for a particular Django installation. This is used to provide
...
@@ -1845,7 +1845,7 @@ A secret key for a particular Django installation. This is used to provide
:doc:`cryptographic signing </topics/signing>`, and should be set to a unique,
:doc:`cryptographic signing </topics/signing>`, and should be set to a unique,
unpredictable value.
unpredictable value.
:djadmin:`django-admin
.py
startproject <startproject>` automatically adds a
:djadmin:`django-admin startproject <startproject>` automatically adds a
randomly-generated ``SECRET_KEY`` to each new project.
randomly-generated ``SECRET_KEY`` to each new project.
Django will refuse to start if :setting:`SECRET_KEY` is not set.
Django will refuse to start if :setting:`SECRET_KEY` is not set.
...
@@ -2257,7 +2257,7 @@ See also :setting:`LANGUAGE_CODE`, :setting:`USE_I18N` and :setting:`USE_TZ`.
...
@@ -2257,7 +2257,7 @@ See also :setting:`LANGUAGE_CODE`, :setting:`USE_I18N` and :setting:`USE_TZ`.
.. note::
.. note::
The default :file:`settings.py` file created by :djadmin:`django-admin
.py
The default :file:`settings.py` file created by :djadmin:`django-admin
startproject <startproject>` includes ``USE_L10N = True`` for convenience.
startproject <startproject>` includes ``USE_L10N = True`` for convenience.
.. setting:: USE_THOUSAND_SEPARATOR
.. setting:: USE_THOUSAND_SEPARATOR
...
@@ -2291,7 +2291,7 @@ See also :setting:`TIME_ZONE`, :setting:`USE_I18N` and :setting:`USE_L10N`.
...
@@ -2291,7 +2291,7 @@ See also :setting:`TIME_ZONE`, :setting:`USE_I18N` and :setting:`USE_L10N`.
.. note::
.. note::
The default :file:`settings.py` file created by
The default :file:`settings.py` file created by
:djadmin:`django-admin
.py
startproject <startproject>` includes
:djadmin:`django-admin startproject <startproject>` includes
``USE_TZ = True`` for convenience.
``USE_TZ = True`` for convenience.
.. setting:: USE_X_FORWARDED_HOST
.. setting:: USE_X_FORWARDED_HOST
...
@@ -2313,7 +2313,7 @@ WSGI_APPLICATION
...
@@ -2313,7 +2313,7 @@ WSGI_APPLICATION
Default: ``None``
Default: ``None``
The full Python path of the WSGI application object that Django's built-in
The full Python path of the WSGI application object that Django's built-in
servers (e.g. :djadmin:`runserver`) will use. The :djadmin:`django-admin
.py
servers (e.g. :djadmin:`runserver`) will use. The :djadmin:`django-admin
startproject <startproject>` management command will create a simple
startproject <startproject>` management command will create a simple
``wsgi.py`` file with an ``application`` callable in it, and point this setting
``wsgi.py`` file with an ``application`` callable in it, and point this setting
to that ``application``.
to that ``application``.
...
...
docs/releases/1.7.txt
Dosyayı görüntüle @
d4740983
...
@@ -686,7 +686,7 @@ Internationalization
...
@@ -686,7 +686,7 @@ Internationalization
Management Commands
Management Commands
^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^
* The :djadminopt:`--no-color` option for ``django-admin
.py
`` allows you to
* The :djadminopt:`--no-color` option for ``django-admin`` allows you to
disable the colorization of management command output.
disable the colorization of management command output.
* The new :djadminopt:`--natural-foreign` and :djadminopt:`--natural-primary`
* The new :djadminopt:`--natural-foreign` and :djadminopt:`--natural-primary`
...
...
docs/topics/auth/index.txt
Dosyayı görüntüle @
d4740983
...
@@ -50,7 +50,7 @@ Installation
...
@@ -50,7 +50,7 @@ Installation
Authentication support is bundled as a Django contrib module in
Authentication support is bundled as a Django contrib module in
``django.contrib.auth``. By default, the required configuration is already
``django.contrib.auth``. By default, the required configuration is already
included in the :file:`settings.py` generated by :djadmin:`django-admin
.py
included in the :file:`settings.py` generated by :djadmin:`django-admin
startproject <startproject>`, these consist of two items listed in your
startproject <startproject>`, these consist of two items listed in your
:setting:`INSTALLED_APPS` setting:
:setting:`INSTALLED_APPS` setting:
...
...
docs/topics/db/multi-db.txt
Dosyayı görüntüle @
d4740983
...
@@ -96,7 +96,7 @@ particular application directly into your database prompt, like this::
...
@@ -96,7 +96,7 @@ particular application directly into your database prompt, like this::
Using other management commands
Using other management commands
-------------------------------
-------------------------------
The other ``django-admin
.py
`` commands that interact with the database
The other ``django-admin`` commands that interact with the database
operate in the same way as :djadmin:`migrate` -- they only ever operate
operate in the same way as :djadmin:`migrate` -- they only ever operate
on one database at a time, using :djadminopt:`--database` to control
on one database at a time, using :djadminopt:`--database` to control
the database used.
the database used.
...
...
docs/topics/http/middleware.txt
Dosyayı görüntüle @
d4740983
...
@@ -24,7 +24,7 @@ To activate a middleware component, add it to the
...
@@ -24,7 +24,7 @@ To activate a middleware component, add it to the
In :setting:`MIDDLEWARE_CLASSES`, each middleware component is represented by
In :setting:`MIDDLEWARE_CLASSES`, each middleware component is represented by
a string: the full Python path to the middleware's class name. For example,
a string: the full Python path to the middleware's class name. For example,
here's the default value created by :djadmin:`django-admin
.py
startproject
here's the default value created by :djadmin:`django-admin startproject
<startproject>`::
<startproject>`::
MIDDLEWARE_CLASSES = (
MIDDLEWARE_CLASSES = (
...
...
docs/topics/http/sessions.txt
Dosyayı görüntüle @
d4740983
...
@@ -20,7 +20,7 @@ To enable session functionality, do the following:
...
@@ -20,7 +20,7 @@ To enable session functionality, do the following:
* Edit the :setting:`MIDDLEWARE_CLASSES` setting and make sure
* Edit the :setting:`MIDDLEWARE_CLASSES` setting and make sure
it contains ``'django.contrib.sessions.middleware.SessionMiddleware'``.
it contains ``'django.contrib.sessions.middleware.SessionMiddleware'``.
The default ``settings.py`` created by ``django-admin
.py
startproject``
The default ``settings.py`` created by ``django-admin startproject``
has ``SessionMiddleware`` activated.
has ``SessionMiddleware`` activated.
If you don't want to use sessions, you might as well remove the
If you don't want to use sessions, you might as well remove the
...
...
docs/topics/i18n/formatting.txt
Dosyayı görüntüle @
d4740983
...
@@ -20,7 +20,7 @@ necessary to set :setting:`USE_L10N = True <USE_L10N>` in your settings file.
...
@@ -20,7 +20,7 @@ necessary to set :setting:`USE_L10N = True <USE_L10N>` in your settings file.
.. note::
.. note::
The default :file:`settings.py` file created by :djadmin:`django-admin
.py
The default :file:`settings.py` file created by :djadmin:`django-admin
startproject <startproject>` includes :setting:`USE_L10N = True <USE_L10N>`
startproject <startproject>` includes :setting:`USE_L10N = True <USE_L10N>`
for convenience. Note, however, that to enable number formatting with
for convenience. Note, however, that to enable number formatting with
thousand separators it is necessary to set :setting:`USE_THOUSAND_SEPARATOR
thousand separators it is necessary to set :setting:`USE_THOUSAND_SEPARATOR
...
...
docs/topics/i18n/timezones.txt
Dosyayı görüntüle @
d4740983
...
@@ -40,7 +40,7 @@ or times, please try installing it before filing a bug. It's as simple as:
...
@@ -40,7 +40,7 @@ or times, please try installing it before filing a bug. It's as simple as:
.. note::
.. note::
The default :file:`settings.py` file created by :djadmin:`django-admin
.py
The default :file:`settings.py` file created by :djadmin:`django-admin
startproject <startproject>` includes :setting:`USE_TZ = True <USE_TZ>`
startproject <startproject>` includes :setting:`USE_TZ = True <USE_TZ>`
for convenience.
for convenience.
...
...
docs/topics/i18n/translation.txt
Dosyayı görüntüle @
d4740983
...
@@ -111,7 +111,7 @@ Translation works on variables. Again, here's an identical example::
...
@@ -111,7 +111,7 @@ Translation works on variables. Again, here's an identical example::
(The caveat with using variables or computed values, as in the previous two
(The caveat with using variables or computed values, as in the previous two
examples, is that Django's translation-string-detecting utility,
examples, is that Django's translation-string-detecting utility,
:djadmin:`django-admin
.py
makemessages <makemessages>`, won't be able to find
:djadmin:`django-admin makemessages <makemessages>`, won't be able to find
these strings. More on :djadmin:`makemessages` later.)
these strings. More on :djadmin:`makemessages` later.)
The strings you pass to ``_()`` or ``ugettext()`` can take placeholders,
The strings you pass to ``_()`` or ``ugettext()`` can take placeholders,
...
@@ -260,7 +260,7 @@ In a case like this, consider something like the following::
...
@@ -260,7 +260,7 @@ In a case like this, consider something like the following::
'plural_name': Report._meta.verbose_name_plural
'plural_name': Report._meta.verbose_name_plural
}
}
You would get an error when running :djadmin:`django-admin
.py
You would get an error when running :djadmin:`django-admin
compilemessages <compilemessages>`::
compilemessages <compilemessages>`::
a format specification for argument 'name', as in 'msgstr[0]', doesn't exist in 'msgid'
a format specification for argument 'name', as in 'msgstr[0]', doesn't exist in 'msgid'
...
@@ -1235,7 +1235,7 @@ file is a plain-text file, representing a single language, that contains all
...
@@ -1235,7 +1235,7 @@ file is a plain-text file, representing a single language, that contains all
available translation strings and how they should be represented in the given
available translation strings and how they should be represented in the given
language. Message files have a ``.po`` file extension.
language. Message files have a ``.po`` file extension.
Django comes with a tool, :djadmin:`django-admin
.py
makemessages
Django comes with a tool, :djadmin:`django-admin makemessages
<makemessages>`, that automates the creation and upkeep of these files.
<makemessages>`, that automates the creation and upkeep of these files.
.. admonition:: Gettext utilities
.. admonition:: Gettext utilities
...
@@ -1248,7 +1248,7 @@ Django comes with a tool, :djadmin:`django-admin.py makemessages
...
@@ -1248,7 +1248,7 @@ Django comes with a tool, :djadmin:`django-admin.py makemessages
To create or update a message file, run this command::
To create or update a message file, run this command::
django-admin
.py
makemessages -l de
django-admin makemessages -l de
...where ``de`` is the language code for the message file you want to create.
...where ``de`` is the language code for the message file you want to create.
The language code, in this case, is in :term:`locale format<locale name>`. For
The language code, in this case, is in :term:`locale format<locale name>`. For
...
@@ -1279,17 +1279,17 @@ directory ``locale/LANG/LC_MESSAGES``. In the ``de`` example, the file will be
...
@@ -1279,17 +1279,17 @@ directory ``locale/LANG/LC_MESSAGES``. In the ``de`` example, the file will be
:setting:`LOCALE_PATHS` or will generate an error if :setting:`LOCALE_PATHS`
:setting:`LOCALE_PATHS` or will generate an error if :setting:`LOCALE_PATHS`
is empty.
is empty.
By default :djadmin:`django-admin
.py
makemessages <makemessages>` examines every
By default :djadmin:`django-admin makemessages <makemessages>` examines every
file that has the ``.html`` or ``.txt`` file extension. In case you want to
file that has the ``.html`` or ``.txt`` file extension. In case you want to
override that default, use the ``--extension`` or ``-e`` option to specify the
override that default, use the ``--extension`` or ``-e`` option to specify the
file extensions to examine::
file extensions to examine::
django-admin
.py
makemessages -l de -e txt
django-admin makemessages -l de -e txt
Separate multiple extensions with commas and/or use ``-e`` or ``--extension``
Separate multiple extensions with commas and/or use ``-e`` or ``--extension``
multiple times::
multiple times::
django-admin
.py
makemessages -l de -e html,txt -e xml
django-admin makemessages -l de -e html,txt -e xml
.. warning::
.. warning::
...
@@ -1322,7 +1322,7 @@ For example, if your Django app contained a translation string for the text
...
@@ -1322,7 +1322,7 @@ For example, if your Django app contained a translation string for the text
_("Welcome to my site.")
_("Welcome to my site.")
...then :djadmin:`django-admin
.py
makemessages <makemessages>` will have created
...then :djadmin:`django-admin makemessages <makemessages>` will have created
a ``.po`` file containing the following snippet -- a message::
a ``.po`` file containing the following snippet -- a message::
#: path/to/python/module.py:23
#: path/to/python/module.py:23
...
@@ -1359,28 +1359,29 @@ otherwise, they'll be tacked together without whitespace!
...
@@ -1359,28 +1359,29 @@ otherwise, they'll be tacked together without whitespace!
To reexamine all source code and templates for new translation strings and
To reexamine all source code and templates for new translation strings and
update all message files for **all** languages, run this::
update all message files for **all** languages, run this::
django-admin
.py
makemessages -a
django-admin makemessages -a
Compiling message files
Compiling message files
-----------------------
-----------------------
After you create your message file -- and each time you make changes to it --
After you create your message file -- and each time you make changes to it --
you'll need to compile it into a more efficient form, for use by ``gettext``. Do
you'll need to compile it into a more efficient form, for use by ``gettext``. Do
this with the :djadmin:`django-admin
.py
compilemessages <compilemessages>`
this with the :djadmin:`django-admin compilemessages <compilemessages>`
utility.
utility.
This tool runs over all available ``.po`` files and creates ``.mo`` files, which
This tool runs over all available ``.po`` files and creates ``.mo`` files, which
are binary files optimized for use by ``gettext``. In the same directory from
are binary files optimized for use by ``gettext``. In the same directory from
which you ran :djadmin:`django-admin.py makemessages <makemessages>`, run :djadmin:`django-admin.py compilemessages <compilemessages>` like this::
which you ran :djadmin:`django-admin makemessages <makemessages>`, run
:djadmin:`django-admin compilemessages <compilemessages>` like this::
django-admin
.py
compilemessages
django-admin compilemessages
That's it. Your translations are ready for use.
That's it. Your translations are ready for use.
.. admonition:: Working on Windows?
.. admonition:: Working on Windows?
If you're using Windows and need to install the GNU gettext utilities so
If you're using Windows and need to install the GNU gettext utilities so
:djadmin:`django-admin
.py
compilemessages <compilemessages>` works see
:djadmin:`django-admin compilemessages <compilemessages>` works see
:ref:`gettext_on_windows` for more information.
:ref:`gettext_on_windows` for more information.
.. admonition:: .po files: Encoding and BOM usage.
.. admonition:: .po files: Encoding and BOM usage.
...
@@ -1395,15 +1396,15 @@ Creating message files from JavaScript source code
...
@@ -1395,15 +1396,15 @@ Creating message files from JavaScript source code
--------------------------------------------------
--------------------------------------------------
You create and update the message files the same way as the other Django message
You create and update the message files the same way as the other Django message
files -- with the :djadmin:`django-admin
.py
makemessages <makemessages>` tool.
files -- with the :djadmin:`django-admin makemessages <makemessages>` tool.
The only difference is you need to explicitly specify what in gettext parlance
The only difference is you need to explicitly specify what in gettext parlance
is known as a domain in this case the ``djangojs`` domain, by providing a ``-d
is known as a domain in this case the ``djangojs`` domain, by providing a ``-d
djangojs`` parameter, like this::
djangojs`` parameter, like this::
django-admin
.py
makemessages -d djangojs -l de
django-admin makemessages -d djangojs -l de
This would create or update the message file for JavaScript for German. After
This would create or update the message file for JavaScript for German. After
updating message files, just run :djadmin:`django-admin
.py
compilemessages
updating message files, just run :djadmin:`django-admin compilemessages
<compilemessages>` the same way as you do with normal Django message files.
<compilemessages>` the same way as you do with normal Django message files.
.. _gettext_on_windows:
.. _gettext_on_windows:
...
@@ -1798,10 +1799,10 @@ All message file repositories are structured the same way. They are:
...
@@ -1798,10 +1799,10 @@ All message file repositories are structured the same way. They are:
* ``$APPPATH/locale/<language>/LC_MESSAGES/django.(po|mo)``
* ``$APPPATH/locale/<language>/LC_MESSAGES/django.(po|mo)``
* ``$PYTHONPATH/django/conf/locale/<language>/LC_MESSAGES/django.(po|mo)``
* ``$PYTHONPATH/django/conf/locale/<language>/LC_MESSAGES/django.(po|mo)``
To create message files, you use the :djadmin:`django-admin
.py
makemessages <makemessages>`
To create message files, you use the :djadmin:`django-admin makemessages <makemessages>`
tool. And you use :djadmin:`django-admin
.py
compilemessages <compilemessages>`
tool. And you use :djadmin:`django-admin compilemessages <compilemessages>`
to produce the binary ``.mo`` files that are used by ``gettext``.
to produce the binary ``.mo`` files that are used by ``gettext``.
You can also run :djadmin:`django-admin
.py
compilemessages
You can also run :djadmin:`django-admin compilemessages
--settings=path.to.settings <compilemessages>` to make the compiler process all
--settings=path.to.settings <compilemessages>` to make the compiler process all
the directories in your :setting:`LOCALE_PATHS` setting.
the directories in your :setting:`LOCALE_PATHS` setting.
docs/topics/install.txt
Dosyayı görüntüle @
d4740983
...
@@ -284,7 +284,7 @@ latest bug fixes and improvements, follow these instructions:
...
@@ -284,7 +284,7 @@ latest bug fixes and improvements, follow these instructions:
(If using a virtualenv_ you can omit ``sudo``.)
(If using a virtualenv_ you can omit ``sudo``.)
This will make Django's code importable, and will also make the
This will make Django's code importable, and will also make the
``django-admin
.py
`` utility command available. In other words, you're all
``django-admin`` utility command available. In other words, you're all
set!
set!
If you don't have pip_ available, see the alternative instructions for
If you don't have pip_ available, see the alternative instructions for
...
@@ -343,7 +343,7 @@ Next you need to make the ``django-admin.py`` utility available in your
...
@@ -343,7 +343,7 @@ Next you need to make the ``django-admin.py`` utility available in your
shell PATH.
shell PATH.
On Unix-like systems, create a symbolic link to the file
On Unix-like systems, create a symbolic link to the file
``django-trunk/django/bin/django-admin
.py
`` in a directory on your system
``django-trunk/django/bin/django-admin`` in a directory on your system
path, such as ``/usr/local/bin``. For example:
path, such as ``/usr/local/bin``. For example:
.. code-block:: bash
.. code-block:: bash
...
@@ -359,3 +359,7 @@ rather than having to qualify the command with the full path to the file.
...
@@ -359,3 +359,7 @@ rather than having to qualify the command with the full path to the file.
On Windows systems, the same result can be achieved by copying the file
On Windows systems, the same result can be achieved by copying the file
``django-trunk/django/bin/django-admin.py`` to somewhere on your system
``django-trunk/django/bin/django-admin.py`` to somewhere on your system
path, for example ``C:\Python27\Scripts``.
path, for example ``C:\Python27\Scripts``.
Note that the rest of the documentation assumes this utility is installed
as ``django-admin``. You'll have to substitute ``django-admin.py`` if you use
this method.
docs/topics/settings.txt
Dosyayı görüntüle @
d4740983
...
@@ -48,28 +48,28 @@ Python `import search path`_.
...
@@ -48,28 +48,28 @@ Python `import search path`_.
.. _import search path: http://www.diveintopython.net/getting_to_know_python/everything_is_an_object.html
.. _import search path: http://www.diveintopython.net/getting_to_know_python/everything_is_an_object.html
The django-admin
.py
utility
The django-admin utility
---------------------------
---------------------------
When using :doc:`django-admin
.py
</ref/django-admin>`, you can either set the
When using :doc:`django-admin </ref/django-admin>`, you can either set the
environment variable once, or explicitly pass in the settings module each time
environment variable once, or explicitly pass in the settings module each time
you run the utility.
you run the utility.
Example (Unix Bash shell)::
Example (Unix Bash shell)::
export DJANGO_SETTINGS_MODULE=mysite.settings
export DJANGO_SETTINGS_MODULE=mysite.settings
django-admin
.py
runserver
django-admin runserver
Example (Windows shell)::
Example (Windows shell)::
set DJANGO_SETTINGS_MODULE=mysite.settings
set DJANGO_SETTINGS_MODULE=mysite.settings
django-admin
.py
runserver
django-admin runserver
Use the ``--settings`` command-line argument to specify the settings manually::
Use the ``--settings`` command-line argument to specify the settings manually::
django-admin
.py
runserver --settings=mysite.settings
django-admin runserver --settings=mysite.settings
.. _django-admin
.py
: ../django-admin/
.. _django-admin: ../django-admin/
On the server (mod_wsgi)
On the server (mod_wsgi)
--------------------------
--------------------------
...
...
tests/bash_completion/tests.py
Dosyayı görüntüle @
d4740983
...
@@ -46,7 +46,7 @@ class BashCompletionTests(unittest.TestCase):
...
@@ -46,7 +46,7 @@ class BashCompletionTests(unittest.TestCase):
def
test_django_admin_py
(
self
):
def
test_django_admin_py
(
self
):
"django_admin.py will autocomplete option flags"
"django_admin.py will autocomplete option flags"
self
.
_user_input
(
'django-admin
.py
sqlall --verb'
)
self
.
_user_input
(
'django-admin sqlall --verb'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
self
.
assertEqual
(
output
,
[
'--verbosity='
])
self
.
assertEqual
(
output
,
[
'--verbosity='
])
...
@@ -58,31 +58,31 @@ class BashCompletionTests(unittest.TestCase):
...
@@ -58,31 +58,31 @@ class BashCompletionTests(unittest.TestCase):
def
test_custom_command
(
self
):
def
test_custom_command
(
self
):
"A custom command can autocomplete option flags"
"A custom command can autocomplete option flags"
self
.
_user_input
(
'django-admin
.py
test_command --l'
)
self
.
_user_input
(
'django-admin test_command --l'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
self
.
assertEqual
(
output
,
[
'--list'
])
self
.
assertEqual
(
output
,
[
'--list'
])
def
test_subcommands
(
self
):
def
test_subcommands
(
self
):
"Subcommands can be autocompleted"
"Subcommands can be autocompleted"
self
.
_user_input
(
'django-admin
.py
sql'
)
self
.
_user_input
(
'django-admin sql'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
self
.
assertEqual
(
output
,
[
'sql sqlall sqlclear sqlcustom sqldropindexes sqlflush sqlindexes sqlmigrate sqlsequencereset'
])
self
.
assertEqual
(
output
,
[
'sql sqlall sqlclear sqlcustom sqldropindexes sqlflush sqlindexes sqlmigrate sqlsequencereset'
])
def
test_help
(
self
):
def
test_help
(
self
):
"No errors, just an empty list if there are no autocomplete options"
"No errors, just an empty list if there are no autocomplete options"
self
.
_user_input
(
'django-admin
.py
help --'
)
self
.
_user_input
(
'django-admin help --'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
self
.
assertEqual
(
output
,
[
''
])
self
.
assertEqual
(
output
,
[
''
])
def
test_runfcgi
(
self
):
def
test_runfcgi
(
self
):
"Command arguments will be autocompleted"
"Command arguments will be autocompleted"
self
.
_user_input
(
'django-admin
.py
runfcgi h'
)
self
.
_user_input
(
'django-admin runfcgi h'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
self
.
assertEqual
(
output
,
[
'host='
])
self
.
assertEqual
(
output
,
[
'host='
])
def
test_app_completion
(
self
):
def
test_app_completion
(
self
):
"Application names will be autocompleted for an AppCommand"
"Application names will be autocompleted for an AppCommand"
self
.
_user_input
(
'django-admin
.py
sqlall a'
)
self
.
_user_input
(
'django-admin sqlall a'
)
output
=
self
.
_run_autocomplete
()
output
=
self
.
_run_autocomplete
()
a_labels
=
sorted
(
app_config
.
label
a_labels
=
sorted
(
app_config
.
label
for
app_config
in
apps
.
get_app_configs
()
for
app_config
in
apps
.
get_app_configs
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment