mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed #30160 -- Added support for LZMA and XZ templates to startapp/startproject management commands.
This commit is contained in:
parent
c95d063e77
commit
f618e033ac
@ -220,5 +220,7 @@ extension_map = dict.fromkeys((
|
|||||||
'.tar',
|
'.tar',
|
||||||
'.tar.bz2', '.tbz2', '.tbz', '.tz2',
|
'.tar.bz2', '.tbz2', '.tbz', '.tz2',
|
||||||
'.tar.gz', '.tgz', '.taz',
|
'.tar.gz', '.tgz', '.taz',
|
||||||
|
'.tar.lzma', '.tlz',
|
||||||
|
'.tar.xz', '.txz',
|
||||||
), TarArchive)
|
), TarArchive)
|
||||||
extension_map['.zip'] = ZipArchive
|
extension_map['.zip'] = ZipArchive
|
||||||
|
@ -1223,7 +1223,8 @@ For example::
|
|||||||
|
|
||||||
Provides the path to a directory with a custom app template file, or a path to
|
Provides the path to a directory with a custom app template file, or a path to
|
||||||
an uncompressed archive (``.tar``) or a compressed archive (``.tar.gz``,
|
an uncompressed archive (``.tar``) or a compressed archive (``.tar.gz``,
|
||||||
``.tar.bz2``, ``.tgz``, ``.tbz2``, ``.zip``) containing the app template files.
|
``.tar.bz2``, ``.tar.xz``, ``.tar.lzma``, ``.tgz``, ``.tbz2``, ``.txz``,
|
||||||
|
``.tlz``, ``.zip``) containing the app template files.
|
||||||
|
|
||||||
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::
|
||||||
@ -1239,6 +1240,11 @@ zip files, you can use a URL like::
|
|||||||
|
|
||||||
django-admin startapp --template=https://github.com/githubuser/django-app-template/archive/master.zip myapp
|
django-admin startapp --template=https://github.com/githubuser/django-app-template/archive/master.zip myapp
|
||||||
|
|
||||||
|
.. versionchanged:: 3.0
|
||||||
|
|
||||||
|
Support for XZ archives (``.tar.xz``, ``.txz``) and LZMA archives
|
||||||
|
(``.tar.lzma``, ``.tlz``) was added.
|
||||||
|
|
||||||
.. django-admin-option:: --extension EXTENSIONS, -e EXTENSIONS
|
.. django-admin-option:: --extension EXTENSIONS, -e EXTENSIONS
|
||||||
|
|
||||||
Specifies which file extensions in the app template should be rendered with the
|
Specifies which file extensions in the app template should be rendered with the
|
||||||
|
@ -250,6 +250,10 @@ Management Commands
|
|||||||
* The new :option:`--skip-checks` option skips running system checks prior to
|
* The new :option:`--skip-checks` option skips running system checks prior to
|
||||||
running the command.
|
running the command.
|
||||||
|
|
||||||
|
* The :option:`startapp --template` and :option:`startproject --template`
|
||||||
|
options now support templates stored in XZ archives (``.tar.xz``, ``.txz``)
|
||||||
|
and LZMA archives (``.tar.lzma``, ``.tlz``).
|
||||||
|
|
||||||
Migrations
|
Migrations
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
BIN
tests/utils_tests/archives/foobar.tar.lzma
Normal file
BIN
tests/utils_tests/archives/foobar.tar.lzma
Normal file
Binary file not shown.
BIN
tests/utils_tests/archives/foobar.tar.xz
Normal file
BIN
tests/utils_tests/archives/foobar.tar.xz
Normal file
Binary file not shown.
BIN
tests/utils_tests/archives/leadpath_foobar.tar.lzma
Normal file
BIN
tests/utils_tests/archives/leadpath_foobar.tar.lzma
Normal file
Binary file not shown.
BIN
tests/utils_tests/archives/leadpath_foobar.tar.xz
Normal file
BIN
tests/utils_tests/archives/leadpath_foobar.tar.xz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user