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
253fcff9
Kaydet (Commit)
253fcff9
authored
May 17, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updated man page for Django 2.1 alpha.
üst
77f6340d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
110 deletions
+108
-110
django-admin.1
docs/man/django-admin.1
+108
-110
No files found.
docs/man/django-admin.1
Dosyayı görüntüle @
253fcff9
.\
" Man page generated from reStructuredText.
.
.TH "
DJANGO
-
ADMIN
" "
1
" "
September
22
,
2017
" "
2.0
" "
Django
"
.TH "
DJANGO
-
ADMIN
" "
1
" "
May
17
,
2018
" "
2.1
" "
Django
"
.SH NAME
django-admin \- Utility script for the Django Web framework
.
...
...
@@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in
\\
n[rst2man-indent
\\
n[rst2man-indent-level]]u
..
.sp
\f
Bdjango\-admin
\f
P is Django
’
s command\-line utility for administrative tasks.
\f
Bdjango\-admin
\f
P is Django
\(aq
s command\-line utility for administrative tasks.
This document outlines all it can do.
.sp
In addition,
\f
Bmanage.py
\f
P is automatically created in each Django project.
...
...
@@ -39,14 +39,14 @@ In addition, \fBmanage.py\fP is automatically created in each Django project.
things for you:
.INDENT 0.0
.IP \(bu 2
It puts your project
’
s package on
\f
Bsys.path
\f
P\&.
It puts your project
\(aq
s package on
\f
Bsys.path
\f
P\&.
.IP \(bu 2
It sets the
\f
BDJANGO_SETTINGS_MODULE
\f
P environment variable so that
it points to your project
’
s
\f
Bsettings.py
\f
P file.
it points to your project
\(aq
s
\f
Bsettings.py
\f
P file.
.UNINDENT
.sp
The
\f
Bdjango\-admin
\f
P script should be on your system path if you installed
Django via its
\f
Bsetup.py
\f
P utility. If it
’
s not on your path, you can find it
Django via its
\f
Bsetup.py
\f
P utility. If it
\(aq
s not on your path, you can find it
in
\f
Bsite\-packages/django/bin
\f
P within your Python installation. Consider
symlinking it from some place on your path, such as
\f
B/usr/local/bin
\f
P\&.
.sp
...
...
@@ -55,7 +55,7 @@ copy \fBdjango\-admin.exe\fP to a location on your existing path or edit the
\f
BPATH
\f
P settings (under
\f
BSettings \- Control Panel \- System \- Advanced \-
Environment...
\f
P) to point to its installed location.
.sp
Generally, when working on a single Django project, it
’
s easier to use
Generally, when working on a single Django project, it
\(aq
s easier to use
\f
Bmanage.py
\f
P than
\f
Bdjango\-admin
\f
P\&. If you need to switch between multiple
Django settings files, use
\f
Bdjango\-admin
\f
P with
\f
BDJANGO_SETTINGS_MODULE
\f
P or the
\f
I\%\-\-settings
\f
P command line
...
...
@@ -97,7 +97,7 @@ Run \fBdjango\-admin help <command>\fP to display a description of the given
command and a list of its available options.
.SS App names
.sp
Many commands take a list of
“app names.” An “app name”
is the basename of
Many commands take a list of
"
app
names
.
" An "
app
name
"
is the basename of
the package containing your models. For example, if your
\f
BINSTALLED_APPS
\f
P
contains the string
\f
B\(aqmysite.blog\(aq
\f
P, the app name is
\f
Bblog
\f
P\&.
.SS Determining the version
...
...
@@ -298,7 +298,7 @@ For Oracle, this runs the \fBsqlplus\fP command\-line client.
.sp
This command assumes the programs are on your
\f
BPATH
\f
P so that a simple call to
the program name (
\f
Bpsql
\f
P,
\f
Bmysql
\f
P,
\f
Bsqlite3
\f
P,
\f
Bsqlplus
\f
P) will find the
program in the right place. There
’
s no way to specify the location of the
program in the right place. There
\(aq
s no way to specify the location of the
program manually.
.INDENT 0.0
.TP
...
...
@@ -312,11 +312,11 @@ Specifies the database onto which to open a shell. Defaults to \fBdefault\fP\&.
.B django\-admin diffsettings
.UNINDENT
.sp
Displays differences between the current settings file and Django
’
s default
Displays differences between the current settings file and Django
\(aq
s default
settings (or another settings file specified by
\f
I\%\-\-default
\f
P).
.sp
Settings that don
’
t appear in the defaults are followed by
\f
B"
###
"
\f
P\&. For
example, the default settings don
’
t define
\f
BROOT_URLCONF
\f
P, so
Settings that don
\(aq
t appear in the defaults are followed by
\f
B"
###
"
\f
P\&. For
example, the default settings don
\(aq
t define
\f
BROOT_URLCONF
\f
P, so
\f
BROOT_URLCONF
\f
P is followed by
\f
B"
###
"
\f
P in the output of
\f
Bdiffsettings
\f
P\&.
.INDENT 0.0
...
...
@@ -324,17 +324,15 @@ example, the default settings don’t define \fBROOT_URLCONF\fP, so
.B \-\-all
.UNINDENT
.sp
Displays all settings, even if they have Django
’
s default value. Such settings
Displays all settings, even if they have Django
\(aq
s default value. Such settings
are prefixed by
\f
B"
###
"
\f
P\&.
.INDENT 0.0
.TP
.B \-\-default MODULE
.UNINDENT
.sp
.sp
The settings module to compare the current settings against. Leave empty to
compare against Django
’
s default settings.
compare against Django
\(aq
s default settings.
.INDENT 0.0
.TP
.B \-\-output {hash,unified}
...
...
@@ -343,7 +341,7 @@ compare against Django’s default settings.
.sp
Specifies the output format. Available values are
\f
Bhash
\f
P and
\f
Bunified
\f
P\&.
\f
Bhash
\f
P is the default mode that displays the output that
’
s described above.
\f
Bhash
\f
P is the default mode that displays the output that
\(aq
s described above.
\f
Bunified
\f
P displays the output similar to
\f
Bdiff \-u
\f
P\&. Default settings are
prefixed with a minus sign, followed by the changed setting prefixed with a
plus sign.
...
...
@@ -361,7 +359,7 @@ If no application name is provided, all installed applications will be dumped.
The output of
\f
Bdumpdata
\f
P can be used as input for
\f
I\%loaddata
\f
P\&.
.sp
Note that
\f
Bdumpdata
\f
P uses the default manager on the model for selecting the
records to dump. If you
’
re using a custom manager as
records to dump. If you
\(aq
re using a custom manager as
the default manager and it filters some of the available records, not all of the
objects will be dumped.
.INDENT 0.0
...
...
@@ -369,7 +367,7 @@ objects will be dumped.
.B \-\-all, \-a
.UNINDENT
.sp
Uses Django
’
s base manager, dumping records which might otherwise be filtered
Uses Django
\(aq
s base manager, dumping records which might otherwise be filtered
or modified by a custom manager.
.INDENT 0.0
.TP
...
...
@@ -420,7 +418,7 @@ Specifies the database from which data will be dumped. Defaults to \fBdefault\fP
.sp
Uses the
\f
Bnatural_key()
\f
P model method to serialize any foreign key and
many\-to\-many relationship to objects of the type that defines the method. If
you
’
re dumping
\f
Bcontrib.auth
\f
P
\f
BPermission
\f
P objects or
you
\(aq
re dumping
\f
Bcontrib.auth
\f
P
\f
BPermission
\f
P objects or
\f
Bcontrib.contenttypes
\f
P
\f
BContentType
\f
P objects, you should probably use this
flag. See the natural keys
documentation for more details on this and the next option.
...
...
@@ -480,10 +478,13 @@ Specifies the database to flush. Defaults to \fBdefault\fP\&.
.sp
Introspects the database tables in the database pointed\-to by the
\f
BNAME
\f
P setting and outputs a Django model module (a
\f
Bmodels.py
\f
P
file) to standard output. You may choose what tables to inspect by passing
their names as arguments.
file) to standard output.
.sp
You may choose what tables or views to inspect by passing their names as
arguments. If no arguments are provided, models are created for views only if
the
\f
I\%\-\-include\-views
\f
P option is used.
.sp
Use this if you have a legacy database with which you
’
d like to use Django.
Use this if you have a legacy database with which you
\(aq
d like to use Django.
The script will inspect the database and create a model for each table within
it.
.sp
...
...
@@ -492,7 +493,7 @@ in the table. Note that \fBinspectdb\fP has a few special cases in its field\-na
output:
.INDENT 0.0
.IP \(bu 2
If
\f
Binspectdb
\f
P cannot map a column
’s type to a model field type, it’
ll
If
\f
Binspectdb
\f
P cannot map a column
\(aqs type to a model field type, it\(aq
ll
use
\f
BTextField
\f
P and will insert the Python comment
\f
B\(aqThis field type is a guess.\(aq
\f
P next to the field in the generated
model. The recognized fields may depend on apps listed in
...
...
@@ -510,8 +511,8 @@ field.
.UNINDENT
.sp
This feature is meant as a shortcut, not as definitive model generation. After
you run it, you
’
ll want to look over the generated models yourself to make
customizations. In particular, you
’ll need to rearrange models’
order, so that
you run it, you
\(aq
ll want to look over the generated models yourself to make
customizations. In particular, you
\(aqll need to rearrange models\(aq
order, so that
models that refer to other models are ordered properly.
.sp
Primary keys are automatically introspected for PostgreSQL, MySQL and
...
...
@@ -521,15 +522,15 @@ needed.
\f
Binspectdb
\f
P works with PostgreSQL, MySQL and SQLite. Foreign\-key detection
only works in PostgreSQL and with certain types of MySQL tables.
.sp
Django doesn
’
t create database defaults when a
Django doesn
\(aq
t create database defaults when a
\f
Bdefault
\f
P is specified on a model field.
Similarly, database defaults aren
’
t translated to model field defaults or
Similarly, database defaults aren
\(aq
t translated to model field defaults or
detected in any fashion by
\f
Binspectdb
\f
P\&.
.sp
By default,
\f
Binspectdb
\f
P creates unmanaged models. That is,
\f
Bmanaged = False
\f
P
in the model
’s
\f
BMeta
\f
P class tells Django not to manage each table’
s creation,
in the model
\(aqs
\f
BMeta
\f
P class tells Django not to manage each table\(aq
s creation,
modification, and deletion. If you do want to allow Django to manage the
table
’s lifecycle, you’
ll need to change the
table
\(aqs lifecycle, you\(aq
ll need to change the
\f
Bmanaged
\f
P option to
\f
BTrue
\f
P (or simply remove
it because
\f
BTrue
\f
P is its default value).
.INDENT 0.0
...
...
@@ -538,6 +539,14 @@ it because \fBTrue\fP is its default value).
.UNINDENT
.sp
Specifies the database to introspect. Defaults to
\f
Bdefault
\f
P\&.
.INDENT 0.0
.TP
.B \-\-include\-views
.UNINDENT
.sp
.sp
If this option is provided, models are also created for database views.
.SS
\f
Bloaddata
\f
P
.INDENT 0.0
.TP
...
...
@@ -578,13 +587,11 @@ Specifies the serialization format (e.g.,
.TP
.B \-\-exclude EXCLUDE, \-e EXCLUDE
.UNINDENT
.sp
.sp
Excludes loading the fixtures from the given applications and/or models (in the
form of
\f
Bapp_label
\f
P or
\f
Bapp_label.ModelName
\f
P). Use the option multiple
times to exclude more than one app or model.
.SS What
’s a “fixture”
?
.SS What
\(aqs a "
fixture
"
?
.sp
A
\f
Ifixture
\f
P is a collection of files that contain the serialized contents of
the database. Each fixture has a unique name, and the files that comprise the
...
...
@@ -660,7 +667,7 @@ any \fBpre_save\fP or
\f
Bpost_save
\f
P signals will be called with
\f
Braw=True
\f
P since the instance only contains attributes that are local to the
model. You may, for example, want to disable handlers that access
related fields that aren
’
t present during fixture loading and would otherwise
related fields that aren
\(aq
t present during fixture loading and would otherwise
raise an exception:
.INDENT 0.0
.INDENT 3.5
...
...
@@ -746,18 +753,18 @@ installation will be aborted, and any data installed in the call to
.INDENT 3.5
.IP "
MySQL
with
MyISAM
and
fixtures
"
.sp
The MyISAM storage engine of MySQL doesn
’
t support transactions or
constraints, so if you use MyISAM, you won
’
t get validation of fixture
The MyISAM storage engine of MySQL doesn
\(aq
t support transactions or
constraints, so if you use MyISAM, you won
\(aq
t get validation of fixture
data, or a rollback if multiple transaction files are found.
.UNINDENT
.UNINDENT
.SS Database\-specific fixtures
.sp
If you
’
re in a multi\-database setup, you might have fixture data that
If you
\(aq
re in a multi\-database setup, you might have fixture data that
you want to load onto one database, but not onto another. In this
situation, you can add a database identifier into the names of your fixtures.
.sp
For example, if your
\f
BDATABASES
\f
P setting has a
‘master’
database
For example, if your
\f
BDATABASES
\f
P setting has a
\(aqmaster\(aq
database
defined, name the fixture
\f
Bmydata.master.json
\f
P or
\f
Bmydata.master.json.gz
\f
P and the fixture will only be loaded when you
specify you want to load data into the
\f
Bmaster
\f
P database.
...
...
@@ -807,8 +814,8 @@ directory. After making changes to the messages files you need to compile them
with
\f
I\%compilemessages
\f
P for use with the builtin gettext support. See
the i18n documentation for details.
.sp
This command doesn
’t require configured settings. However, when settings aren’
t
configured, the command can
’
t ignore the
\f
BMEDIA_ROOT
\f
P and
This command doesn
\(aqt require configured settings. However, when settings aren\(aq
t
configured, the command can
\(aq
t ignore the
\f
BMEDIA_ROOT
\f
P and
\f
BSTATIC_ROOT
\f
P directories or include
\f
BLOCALE_PATHS
\f
P\&. It will
also write files in UTF\-8 rather than in
\f
BFILE_CHARSET
\f
P\&.
.INDENT 0.0
...
...
@@ -949,9 +956,9 @@ Disables breaking long message lines into several lines in language files.
.B \-\-no\-location
.UNINDENT
.sp
Suppresses writing
‘
\f
B#: filename:line
\f
P’ comment lines in language files.
Suppresses writing
\(aq
\f
B#: filename:line
\f
P’ comment lines in language files.
Using this option makes it harder for technically skilled translators to
understand each message
’
s context.
understand each message
\(aq
s context.
.INDENT 0.0
.TP
.B \-\-add\-location [{full,file,never}]
...
...
@@ -1002,8 +1009,8 @@ Providing one or more app names as arguments will limit the migrations created
to the app(s) specified and any dependencies needed (the table at the other end
of a
\f
BForeignKey
\f
P, for example).
.sp
To add migrations to an app that doesn
’
t have a
\f
Bmigrations
\f
P directory, run
\f
Bmakemigrations
\f
P with the app
’
s
\f
Bapp_label
\f
P\&.
To add migrations to an app that doesn
\(aq
t have a
\f
Bmigrations
\f
P directory, run
\f
Bmakemigrations
\f
P with the app
\(aq
s
\f
Bapp_label
\f
P\&.
.INDENT 0.0
.TP
.B \-\-noinput, \-\-no\-input
...
...
@@ -1040,9 +1047,6 @@ Enables fixing of migration conflicts.
.UNINDENT
.sp
Allows naming the generated migration(s) instead of using a generated name.
.sp
Makes
\f
Bmakemigrations
\f
P exit with error code 1 when no migrations are created
(or would have been created, if combined with
\f
B\-\-dry\-run
\f
P).
.INDENT 0.0
.TP
.B \-\-check
...
...
@@ -1066,7 +1070,7 @@ The behavior of this command changes depending on the arguments provided:
No arguments: All apps have all of their migrations run.
.IP \(bu 2
\f
B<app_label>
\f
P: The specified app has its migrations run, up to the most
recent migration. This may involve running other apps
’
migrations too, due
recent migration. This may involve running other apps
\(aq
migrations too, due
to dependencies.
.IP \(bu 2
\f
B<app_label> <migrationname>
\f
P: Brings the database schema to a state where
...
...
@@ -1086,11 +1090,11 @@ Specifies the database to migrate. Defaults to \fBdefault\fP\&.
.B \-\-fake
.UNINDENT
.sp
Tells Django to mark the migrations as having been applied or unapplied, but
without actually running the SQL to change your database schema.
Marks the migrations up to the target one (following the rules above) as
applied, but
without actually running the SQL to change your database schema.
.sp
This is intended for advanced users to manipulate the
current migration state directly if they
’
re manually applying changes;
current migration state directly if they
\(aq
re manually applying changes;
be warned that using
\f
B\-\-fake
\f
P runs the risk of putting the migration state
table into a state where manual recovery will be needed to make migrations
run correctly.
...
...
@@ -1099,7 +1103,7 @@ run correctly.
.B \-\-fake\-initial
.UNINDENT
.sp
Allows Django to skip an app
’
s initial migration if all database tables with
Allows Django to skip an app
\(aq
s initial migration if all database tables with
the names of all models created by all
\f
BCreateModel
\f
P operations in that
migration already exist. This option is intended for use when first running
...
...
@@ -1112,7 +1116,7 @@ schema matches what is recorded in your initial migration.
.B \-\-run\-syncdb
.UNINDENT
.sp
Allows creating tables for apps without migrations. While this isn
’
t
Allows creating tables for apps without migrations. While this isn
\(aq
t
recommended, the migrations framework is sometimes too slow on large projects
with hundreds of models.
.INDENT 0.0
...
...
@@ -1140,14 +1144,14 @@ This server uses the WSGI application object specified by the
\f
BWSGI_APPLICATION
\f
P setting.
.sp
DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through
security audits or performance tests. (And that
’s how it’s gonna stay. We’
re in
security audits or performance tests. (And that
\(aqs how it\(aqs gonna stay. We\(aq
re in
the business of making Web frameworks, not Web servers, so improving this
server to be able to handle a production environment is outside the scope of
Django.)
.sp
The development server automatically reloads Python code for each request, as
needed. You don
’
t need to restart the server for code changes to take effect.
However, some actions like adding files don
’t trigger a restart, so you’
ll
needed. You don
\(aq
t need to restart the server for code changes to take effect.
However, some actions like adding files don
\(aqt trigger a restart, so you\(aq
ll
have to restart the server in these cases.
.sp
If you are using Linux and install
\f
I\%pyinotify
\f
P, kernel signals will be used to
...
...
@@ -1161,7 +1165,7 @@ server is running, the system check framework will check your entire Django
project for some common errors (see the
\f
I\%check
\f
P command). If any
errors are found, they will be printed to standard output.
.sp
You can run as many concurrent servers as you want, as long as they
’
re on
You can run as many concurrent servers as you want, as long as they
\(aq
re on
separate ports. Just execute
\f
Bdjango\-admin runserver
\f
P more than once.
.sp
Note that the default IP address,
\f
B127.0.0.1
\f
P, is not accessible from other
...
...
@@ -1313,7 +1317,7 @@ django\-admin runserver \-6 localhost:8000
.UNINDENT
.SS Serving static files with the development server
.sp
By default, the development server doesn
’
t serve any static files for your site
By default, the development server doesn
\(aq
t serve any static files for your site
(such as CSS files, images, things under
\f
BMEDIA_URL
\f
P and so forth). If
you want to configure Django to serve static media, read
/howto/static\-files/index\&.
...
...
@@ -1391,7 +1395,7 @@ django\-admin shell \-i bpython
.UNINDENT
.UNINDENT
.sp
If you have a
“rich” shell installed but want to force use of the “plain”
If you have a
"
rich
" shell installed but want to force use of the "
plain
"
Python interpreter, use
\f
Bpython
\f
P as the interface name, like so:
.INDENT 0.0
.INDENT 3.5
...
...
@@ -1408,7 +1412,7 @@ django\-admin shell \-i python
.B \-\-nostartup
.UNINDENT
.sp
Disables reading the startup script for the
“plain”
Python interpreter. By
Disables reading the startup script for the
"
plain
"
Python interpreter. By
default, the script pointed to by the
\f
I\%PYTHONSTARTUP
\f
P environment
variable or the
\f
B~/.pythonrc.py
\f
P script is read.
.INDENT 0.0
...
...
@@ -1445,9 +1449,6 @@ $ django\-admin shell <<EOF
.sp
On Windows, the REPL is output due to implementation limits of
\f
I\%select.select()
\f
P on that platform.
.sp
In older versions, the REPL is also output on UNIX systems.
.SS
\f
Bshowmigrations
\f
P
.INDENT 0.0
.TP
...
...
@@ -1479,9 +1480,6 @@ of 2 and above, all dependencies of a migration will also be shown.
.sp
\f
Bapp_label
\f
Ps arguments limit the output, however, dependencies of provided
apps may also be included.
.sp
In older versions,
\f
Bshowmigrations \-\-plan
\f
P ignores app labels.
.INDENT 0.0
.TP
.B \-\-database DATABASE
...
...
@@ -1512,7 +1510,7 @@ Prints the SQL for the named migration. This requires an active database
connection, which it will use to resolve constraint names; this means you must
generate the SQL against a copy of the database you wish to later apply it on.
.sp
Note that
\f
Bsqlmigrate
\f
P doesn
’
t colorize its output.
Note that
\f
Bsqlmigrate
\f
P doesn
\(aq
t colorize its output.
.INDENT 0.0
.TP
.B \-\-backwards
...
...
@@ -1600,7 +1598,7 @@ name is given, the app directory will be created in the current working
directory.
.sp
If the optional destination is provided, Django will use that existing
directory rather than creating a new one. You can use
‘.’
to denote the current
directory rather than creating a new one. You can use
\(aq.\(aq
to denote the current
working directory.
.sp
For example:
...
...
@@ -1640,7 +1638,7 @@ Django will also accept URLs (\fBhttp\fP, \fBhttps\fP, \fBftp\fP) to compressed
archives with the app template files, downloading and extracting them on the
fly.
.sp
For example, taking advantage of GitHub
’
s feature to expose repositories as
For example, taking advantage of GitHub
\(aq
s feature to expose repositories as
zip files, you can use a URL like:
.INDENT 0.0
.INDENT 3.5
...
...
@@ -1672,16 +1670,18 @@ The \fBtemplate context\fP used for all matching
files is:
.INDENT 0.0
.IP \(bu 2
Any option passed to the
\f
Bstartapp
\f
P command (among the command
’
s supported
Any option passed to the
\f
Bstartapp
\f
P command (among the command
\(aq
s supported
options)
.IP \(bu 2
\f
Bapp_name
\f
P – the app name as passed to the command
\f
Bapp_name
\f
P \-\- the app name as passed to the command
.IP \(bu 2
\f
Bapp_directory
\f
P \-\- the full path of the newly created app
.IP \(bu 2
\f
B
app_directory
\f
P – the full path of the newly created app
\f
B
camel_case_app_name
\f
P \-\- the app name in camel case format
.IP \(bu 2
\f
B
camel_case_app_name
\f
P – the app name in camel case format
\f
B
docs_version
\f
P \-\- the version of the documentation:
\f
B\(aqdev\(aq
\f
P or
\f
B\(aq1.x\(aq
\f
P
.IP \(bu 2
\f
Bd
ocs_version
\f
P – the version of the documentation:
\f
B\(aqdev\(aq
\f
P or
\f
B\(aq1.x\(aq
\f
P
\f
Bd
jango_version
\f
P \-\- the version of Django, e.g.\(ga\(ga\(aq2.0.3\(aq\(ga\(ga
.UNINDENT
.sp
\f
BWARNING:
\f
P
...
...
@@ -1694,7 +1694,7 @@ contains a docstring explaining a particular feature related
to template rendering, it might result in an incorrect example.
.sp
To work around this problem, you can use the
\f
Btemplatetag
\f
P
template
tag to “escape”
the various parts of the template syntax.
template
tag to "
escape
"
the various parts of the template syntax.
.sp
In addition, to allow Python template files that contain Django template
language syntax while also preventing packaging systems from trying to
...
...
@@ -1721,7 +1721,7 @@ will be created in the current working directory.
.sp
If the optional destination is provided, Django will use that existing
directory as the project directory, and create
\f
Bmanage.py
\f
P and the project
package within it. Use
‘.’
to denote the current working directory.
package within it. Use
\(aq.\(aq
to denote the current working directory.
.sp
For example:
.INDENT 0.0
...
...
@@ -1760,16 +1760,18 @@ empty list.
The
\f
Btemplate context
\f
P used is:
.INDENT 0.0
.IP \(bu 2
Any option passed to the
\f
Bstartproject
\f
P command (among the command
’
s
Any option passed to the
\f
Bstartproject
\f
P command (among the command
\(aq
s
supported options)
.IP \(bu 2
\f
Bproject_name
\f
P
–
the project name as passed to the command
\f
Bproject_name
\f
P
\-\-
the project name as passed to the command
.IP \(bu 2
\f
Bproject_directory
\f
P
–
the full path of the newly created project
\f
Bproject_directory
\f
P
\-\-
the full path of the newly created project
.IP \(bu 2
\f
Bsecret_key
\f
P
–
a random key for the
\f
BSECRET_KEY
\f
P setting
\f
Bsecret_key
\f
P
\-\-
a random key for the
\f
BSECRET_KEY
\f
P setting
.IP \(bu 2
\f
Bdocs_version
\f
P – the version of the documentation:
\f
B\(aqdev\(aq
\f
P or
\f
B\(aq1.x\(aq
\f
P
\f
Bdocs_version
\f
P \-\- the version of the documentation:
\f
B\(aqdev\(aq
\f
P or
\f
B\(aq1.x\(aq
\f
P
.IP \(bu 2
\f
Bdjango_version
\f
P \-\- the version of Django, e.g.\(ga\(ga\(aq2.0.3\(aq\(ga\(ga
.UNINDENT
.sp
Please also see the
\f
I\%rendering warning
\f
P as mentioned
...
...
@@ -1824,14 +1826,12 @@ database before running the test suite.
.UNINDENT
.sp
Sorts test cases in the opposite execution order. This may help in debugging
the side effects of tests that aren
’
t properly isolated. Grouping by test
the side effects of tests that aren
\(aq
t properly isolated. Grouping by test
class is preserved when using this option.
.INDENT 0.0
.TP
.B \-\-debug\-mode
.UNINDENT
.sp
.sp
Sets the
\f
BDEBUG
\f
P setting to
\f
BTrue
\f
P prior to running tests. This may
help troubleshoot test failures.
...
...
@@ -1852,7 +1852,7 @@ multiple cores, this allows running tests significantly faster.
.sp
By default
\f
B\-\-parallel
\f
P runs one process per core according to
\f
I\%multiprocessing.cpu_count()
\f
P\&. You can adjust the number of processes
either by providing it as the option
’
s value, e.g.
\f
B\-\-parallel=4
\f
P, or by
either by providing it as the option
\(aq
s value, e.g.
\f
B\-\-parallel=4
\f
P, or by
setting the
\f
BDJANGO_TEST_PROCESSES
\f
P environment variable.
.sp
Django distributes test cases —
\f
I\%unittest.TestCase
\f
P subclasses — to
...
...
@@ -1860,7 +1860,7 @@ subprocesses. If there are fewer test cases than configured processes, Django
will reduce the number of processes accordingly.
.sp
Each process gets its own database. You must ensure that different test cases
don
’
t access the same resources. For instance, test cases that touch the
don
\(aq
t access the same resources. For instance, test cases that touch the
filesystem should create a temporary directory for their own use.
.sp
This option requires the third\-party
\f
Btblib
\f
P package to display tracebacks
...
...
@@ -1876,12 +1876,12 @@ $ pip install tblib
.UNINDENT
.UNINDENT
.sp
This feature isn
’t available on Windows. It doesn’
t work with the Oracle
This feature isn
\(aqt available on Windows. It doesn\(aq
t work with the Oracle
database backend either.
.sp
If you want to use
\f
I\%pdb
\f
P while debugging tests, you must disable parallel
execution (
\f
B\-\-parallel=1
\f
P). You
’
ll see something like
\f
Bbdb.BdbQuit
\f
P if you
don
’
t.
execution (
\f
B\-\-parallel=1
\f
P). You
\(aq
ll see something like
\f
Bbdb.BdbQuit
\f
P if you
don
\(aq
t.
.sp
\f
BWARNING:
\f
P
.INDENT 0.0
...
...
@@ -1931,7 +1931,7 @@ django\-admin testserver mydata.json
.UNINDENT
.UNINDENT
.sp
…
would perform the following steps:
\&...
would perform the following steps:
.INDENT 0.0
.IP 1. 3
Create a test database, as described in the\-test\-database\&.
...
...
@@ -1946,16 +1946,16 @@ this newly created test database instead of your production database.
This is useful in a number of ways:
.INDENT 0.0
.IP \(bu 2
When you
’
re writing unit tests of how your views
When you
\(aq
re writing unit tests of how your views
act with certain fixture data, you can use
\f
Btestserver
\f
P to interact with
the views in a Web browser, manually.
.IP \(bu 2
Let
’s say you’re developing your Django application and have a “pristine”
copy of a database that you
’
d like to interact with. You can dump your
Let
\(aqs say you\(aqre developing your Django application and have a "
pristine
"
copy of a database that you
\(aq
d like to interact with. You can dump your
database to a fixture (using the
\f
I\%dumpdata
\f
P command, explained
above), then use
\f
Btestserver
\f
P to run your Web application with that data.
With this arrangement, you have the flexibility of messing up your data
in any way, knowing that whatever data changes you
’
re making are only
in any way, knowing that whatever data changes you
\(aq
re making are only
being made to a test database.
.UNINDENT
.sp
...
...
@@ -1987,7 +1987,7 @@ django\-admin testserver fixture1 fixture2 \-\-addrport 7000
.UNINDENT
.sp
(The above statements are equivalent. We include both of them to demonstrate
that it doesn
’
t matter whether the options come before or after the fixture
that it doesn
\(aq
t matter whether the options come before or after the fixture
arguments.)
.sp
To run on 1.2.3.4:7000 with a
\f
Btest
\f
P fixture:
...
...
@@ -2021,9 +2021,9 @@ their application.
.B django\-admin changepassword [<username>]
.UNINDENT
.sp
This command is only available if Django
’
s authentication system (
\f
Bdjango.contrib.auth
\f
P) is installed.
This command is only available if Django
\(aq
s authentication system (
\f
Bdjango.contrib.auth
\f
P) is installed.
.sp
Allows changing a user
’
s password. It prompts you to enter a new password twice
Allows changing a user
\(aq
s password. It prompts you to enter a new password twice
for the given user. If the entries are identical, this immediately becomes the
new password. If you do not supply a user, the command will attempt to change
the password whose username matches the current user.
...
...
@@ -2051,7 +2051,7 @@ django\-admin changepassword ringo
.B django\-admin createsuperuser
.UNINDENT
.sp
This command is only available if Django
’
s authentication system (
\f
Bdjango.contrib.auth
\f
P) is installed.
This command is only available if Django
\(aq
s authentication system (
\f
Bdjango.contrib.auth
\f
P) is installed.
.sp
Creates a superuser account (a user who has all permissions). This is
useful if you need to create an initial superuser account or if you need to
...
...
@@ -2083,7 +2083,7 @@ Specifies the database into which the superuser object will be saved.
.sp
You can subclass the management command and override
\f
Bget_input_data()
\f
P if you
want to customize data input and validation. Consult the source code for
details on the existing implementation and the method
’
s parameters. For example,
details on the existing implementation and the method
\(aq
s parameters. For example,
it could be useful if you have a
\f
BForeignKey
\f
P in
\f
BREQUIRED_FIELDS
\f
P and want to
allow creating an instance instead of entering the primary key of an existing
...
...
@@ -2095,13 +2095,11 @@ instance.
.B django\-admin remove_stale_contenttypes
.UNINDENT
.sp
.sp
This command is only available if Django’s contenttypes app (
\f
Bdjango.contrib.contenttypes
\f
P) is installed.
This command is only available if Django\(aqs contenttypes app (
\f
Bdjango.contrib.contenttypes
\f
P) is installed.
.sp
Deletes stale content types (from deleted models) in your database. Any objects
that depend on the deleted content types will also be deleted. A list of
deleted objects will be displayed before you confirm it
’
s okay to proceed with
deleted objects will be displayed before you confirm it
\(aq
s okay to proceed with
the deletion.
.INDENT 0.0
.TP
...
...
@@ -2154,7 +2152,7 @@ allows for the following options:
.UNINDENT
.sp
Adds the given filesystem path to the Python
\f
I\%import search path
\f
P\&. If this
isn
’
t provided,
\f
Bdjango\-admin
\f
P will use the
\f
BPYTHONPATH
\f
P environment
isn
\(aq
t provided,
\f
Bdjango\-admin
\f
P will use the
\f
BPYTHONPATH
\f
P environment
variable.
.sp
This option is unnecessary in
\f
Bmanage.py
\f
P, because it takes care of setting
...
...
@@ -2177,7 +2175,7 @@ django\-admin migrate \-\-pythonpath=\(aq/home/djangoprojects/myproject\(aq
.UNINDENT
.sp
Specifies the settings module to use. The settings module should be in Python
package syntax, e.g.
\f
Bmysite.settings
\f
P\&. If this isn
’
t provided,
package syntax, e.g.
\f
Bmysite.settings
\f
P\&. If this isn
\(aq
t provided,
\f
Bdjango\-admin
\f
P will use the
\f
BDJANGO_SETTINGS_MODULE
\f
P environment variable.
.sp
This option is unnecessary in
\f
Bmanage.py
\f
P, because it uses
...
...
@@ -2268,10 +2266,10 @@ django\-admin runserver \-\-no\-color
.sp
The
\f
Bdjango\-admin
\f
P /
\f
Bmanage.py
\f
P commands will use pretty
color\-coded output if your terminal supports ANSI\-colored output. It
won
’t use the color codes if you’re piping the command’
s output to
won
\(aqt use the color codes if you\(aqre piping the command\(aq
s output to
another program.
.sp
Under Windows, the native console doesn
’
t support ANSI escape sequences so by
Under Windows, the native console doesn
\(aq
t support ANSI escape sequences so by
default there is no color output. But you can install the
\f
I\%ANSICON
\f
P
third\-party tool, the Django commands will detect its presence and will make
use of its services to color output just like on Unix\-based platforms.
...
...
@@ -2430,9 +2428,9 @@ overridden as specified.
.SS Bash completion
.sp
If you use the Bash shell, consider installing the Django bash completion
script, which lives in
\f
Bextras/django_bash_completion
\f
P in the Django
script, which lives in
\f
Bextras/django_bash_completion
\f
P in the Django
source
distribution. It enables tab\-completion of
\f
Bdjango\-admin
\f
P and
\f
Bmanage.py
\f
P commands, so you can, for instance
…
\f
Bmanage.py
\f
P commands, so you can, for instance
...
.INDENT 0.0
.IP \(bu 2
Type
\f
Bdjango\-admin
\f
P\&.
...
...
@@ -2463,7 +2461,7 @@ line. For example, \fBcall_command(\(aqflush\(aq, \(aq\-\-verbosity=0\(aq)\fP\&.
.TP
.B
\f
B**options
\f
P
named options accepted on the command\-line. Options are passed to the command
without triggering the argument parser, which means you
’
ll need to pass the
without triggering the argument parser, which means you
\(aq
ll need to pass the
correct type. For example,
\f
Bcall_command(\(aqflush\(aq, verbosity=0)
\f
P (zero must
be an integer rather than a string).
.UNINDENT
...
...
@@ -2512,7 +2510,7 @@ Some command options have different names when using \fBcall_command()\fP instea
of
\f
Bdjango\-admin
\f
P or
\f
Bmanage.py
\f
P\&. For example,
\f
Bdjango\-admin
createsuperuser \-\-no\-input
\f
P translates to
\f
Bcall_command(\(aqcreatesuperuser\(aq,
interactive=False)
\f
P\&. To find what keyword argument name to use for
\f
Bcall_command()
\f
P, check the command
’
s source code for the
\f
Bdest
\f
P argument
\f
Bcall_command()
\f
P, check the command
\(aq
s source code for the
\f
Bdest
\f
P argument
passed to
\f
Bparser.add_argument()
\f
P\&.
.sp
Command options which take multiple options are passed a list:
...
...
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