[1.5.x] Added examples of using startproject/app with URLs

thanks to Brent O'Connor for the idea and intial docs
This commit is contained in:
Preston Holmes 2012-11-15 21:17:58 -08:00
parent 187441602c
commit 6d85f1212f
1 changed files with 18 additions and 4 deletions

View File

@ -879,15 +879,20 @@ 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``) compressed file (``.tar.gz``, ``.tar.bz2``, ``.tgz``, ``.tbz``, ``.zip``)
containing the app template files. containing the app template files.
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 For example, this would look for an app template in the given directory when
creating the ``myapp`` app:: creating the ``myapp`` app::
django-admin.py startapp --template=/Users/jezdez/Code/my_app_template myapp django-admin.py startapp --template=/Users/jezdez/Code/my_app_template myapp
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, taking advantage of Github's feature to expose repositories as
zip files, you can use a URL like::
django-admin.py startapp --template=https://github.com/githubuser/django-app-template/archive/master.zip myapp
.. versionadded:: 1.4 .. versionadded:: 1.4
When Django copies the app template files, it also renders certain files When Django copies the app template files, it also renders certain files
@ -954,6 +959,15 @@ when creating the ``myproject`` project::
django-admin.py startproject --template=/Users/jezdez/Code/my_project_template myproject django-admin.py startproject --template=/Users/jezdez/Code/my_project_template myproject
Django will also accept URLs (``http``, ``https``, ``ftp``) to compressed
archives with the project template files, downloading and extracting them on the
fly.
For example, taking advantage of Github's feature to expose repositories as
zip files, you can use a URL like::
django-admin.py startproject --template=https://github.com/githubuser/django-project-template/archive/master.zip myproject
When Django copies the project template files, it also renders certain files When Django copies the project template files, it also renders certain files
through the template engine: the files whose extensions match the through the template engine: the files whose extensions match the
``--extension`` option (``py`` by default) and the files whose names are passed ``--extension`` option (``py`` by default) and the files whose names are passed