Edited doc changes from [17246]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2011-12-30 18:14:31 +00:00
parent d3ef13044e
commit de697769b7
3 changed files with 36 additions and 33 deletions

View File

@ -918,42 +918,44 @@ directory or the given destination.
.. versionchanged:: 1.4
By default the directory created contains a ``models.py`` file and other app
template files, see the `source`_ for more details. If only the app
template files. (See the `source`_ for more details.) If only the app
name is given, the app directory will be created in the current working
directory.
If the optional destination is provided, it will be used to create the
the new app directory in. The use of '.' to denote the current working
directory is valid for the destination. For example::
If the optional destination is provided, Django will create the new project
directory in that directory. You can use '.' to denote the current working
directory.
For example::
django-admin.py startapp myapp /Users/jezdez/Code
.. versionadded:: 1.4
.. django-admin-option:: --template
With the ``--template`` option you can use a custom app template by providing
either the path to a directory with the app template file, a path to a
With the ``--template`` option, you can use a custom app template by providing
either the path to a directory with the app template file, or a path to a
compressed file (``.tar.gz``, ``.tar.bz2``, ``.tgz``, ``.tbz``, ``.zip``)
containing the app template files.
Additionally Django will also accept URLs (``http``, ``https``, ``ftp``) to
compressed archives with the app template files, downloading and extracting
them on the fly.
Django will also accept URLs (``http``, ``https``, ``ftp``) to compressed
archives with the app template files, downloading and extracting them on the
fly.
For example, this would look for an app template in the given directory when creating the ``myapp`` app::
For example, this would look for an app template in the given directory when
creating the ``myapp`` app::
django-admin.py startapp --template=/Users/jezdez/Code/my_app_template myapp
.. versionadded:: 1.4
When Django copies the app template files it will also render the files
When Django copies the app template files, it also renders the files
whose extension matches those passed with the ``--extension`` option (``py``
by default) using the template engine. The :class:`template context
<django.template.Context>` used is:
- Any option passed to the startapp command
- ``app_name`` -- the appp name as passed to the command
- ``app_name`` -- the app name as passed to the command
- ``app_directory`` -- the full path of the newly created app
.. _render_warning:
@ -961,12 +963,12 @@ by default) using the template engine. The :class:`template context
.. warning::
When the app template files are rendered with the Django template
engine (by default all ``*.py`` files) it will also replace all
stray template variables contained. If one of the Python files for
example contains a docstring explaining a particular feature related
engine (by default all ``*.py`` files), Django will also replace all
stray template variables contained. For example, if one of the Python files
contains a docstring explaining a particular feature related
to template rendering, it might result in an incorrect example.
To work around this problem you can use the :ttag:`templatetag`
To work around this problem, you can use the :ttag:`templatetag`
templatetag to "escape" the various parts of the template syntax.
.. _source: https://code.djangoproject.com/browser/django/trunk/django/conf/app_template/
@ -981,33 +983,35 @@ the current directory or the given destination.
.. versionchanged:: 1.4
By default the directory created contains a ``manage.py`` file and a project
package (containing ``settings.py`` file and other project template files),
see the `template source`_ for more details.
By default, the new directory contains ``manage.py`` and a project package
(containing ``settings.py`` file and other project template files).
See the `template source`_ for details.
If only the project name is given, both the project directory and project
package will be named ``<projectname>`` and the project directory
will be created in the current working directory.
If the optional destination is provided, it will be used to create the
the new project directory in. The use of '.' to denote the current working
directory is valid for the destination. For example::
If the optional destination is provided, Django will create the new project
directory in that directory. You can use '.' to denote the current working
directory.
For example::
django-admin.py startproject myproject /Users/jezdez/Code
.. versionadded:: 1.4
Similar to the :djadmin:`startapp` command the ``--template`` option is also
available for specifying a directory or file path of a custom project
template. See the :djadmin:`startapp` documentation for details of supported
project template formats.
As with the :djadmin:`startapp` command, the ``--template`` option lets you
specify a directory or file path of a custom project template. See the
:djadmin:`startapp` documentation for details of supported project template
formats.
For example, this would look for a project template in the given directory
when creating the ``myproject`` project::
django-admin.py startproject --template=/Users/jezdez/Code/my_project_template myproject
When Django copies the project template files it will also render the files
When Django copies the project template files, it will also render the files
whose extension matches those passed with the ``--extension`` option (``py``
by default) using the template engine. The :class:`template context
<django.template.Context>` used is:
@ -1022,7 +1026,6 @@ for :djadmin:`startapp`.
.. _`template source`: https://code.djangoproject.com/browser/django/trunk/django/conf/project_template/
syncdb
------

View File

@ -458,13 +458,13 @@ when running the following command::
django-admin.py startproject --template=/path/to/my_project_template myproject
Additionally you can now provide a destination directory as the second
You can also now provide a destination directory as the second
argument to both :djadmin:`startapp` and :djadmin:`startproject`::
django-admin.py startapp myapp /path/to/new/app
django-admin.py startproject myproject /path/to/new/project
For more information see the :djadmin:`startapp` and :djadmin:`startproject`
For more information, see the :djadmin:`startapp` and :djadmin:`startproject`
documentation.
Support for time zones

View File

@ -448,13 +448,13 @@ when running the following command::
django-admin.py startproject --template=/path/to/my_project_template myproject
Additionally you can now provide a destination directory as the second
You can also now provide a destination directory as the second
argument to both :djadmin:`startapp` and :djadmin:`startproject`::
django-admin.py startapp myapp /path/to/new/app
django-admin.py startproject myproject /path/to/new/project
For more information see the :djadmin:`startapp` and :djadmin:`startproject`
For more information, see the :djadmin:`startapp` and :djadmin:`startproject`
documentation.
Support for time zones