summaryrefslogtreecommitdiff
path: root/django/core/management/templates.py
AgeCommit message (Collapse)Author
2025-04-27Fixed #18296 -- Created missing custom target directory for startproject and ↵Bruno Alla
startapp.
2024-11-29Fixed #35308 -- Handled OSError when launching code formatters.Jacob Walls
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2023-09-01Fixed #34778 -- Avoided importing modules in startapp/startproject.Jacob Walls
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2023-01-18Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak
2022-10-20Fixed #34085 -- Made management commands don't use black for non-Python files.Carlton Gibson
Bug in d113b5a837f726d1c638d76c4e88445e6cd59fd5. Co-authored-by: programmylife <acmshar@gmail.com> Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-09-07Fixed #33986 -- Hardened binary lookup in template commands.Shai Berger
Made template commands look up formatters before writing files. This makes sure files included in the template are not identified as executable formatter commands, even in case the template is rendered into the system path (as might easily happen on Windows, where the current directory is on the system path by default). While at it, Warned about trusting custom templates for startapp/startproject. Thanks Trung Pham of Viettel Cyber Security for reporting the issue, Django Security Team for discussions, and Adam Johnson and Carlton Gibson for reviews.
2022-05-11Refs #33173 -- Removed use of deprecated cgi module.Carlton Gibson
https://peps.python.org/pep-0594/#cgi
2022-02-11Refs #33476 -- Made management commands use black.Carlton Gibson
Run black on generated files, if it is available on PATH.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-11-25Fixed #32397 -- Made startapp/startproject management commands set User-Agent.Ad Timmering
This sets User-Agent to 'Django/<version>'.
2021-11-24Fixed #4282 -- Made startapp/startproject management commands honor umask.Ad Timmering
Co-authored-by: Christian Schmitt <c.schmitt@briefdomain.de>
2021-09-01Fixed #32309 -- Added --exclude option to startapp/startproject management ↵sage
commands.
2021-05-14Fixed #32734 -- Fixed validation of startapp's directory with trailing slash.Rohith PR
Regression in fc9566d42daf28cdaa25a5db1b5ade253ceb064f.
2020-06-24Fixed typo in django/core/management/templates.py docstring.excursus
2020-05-21Fixed #31546 -- Allowed specifying list of tags in ↵Hasan Ramezani
Command.requires_system_checks.
2020-04-27Refs #18325 -- Removed unnecessary line endings in management commands.François Freitag
The OutputWrapper automatically adds \n when it’s not present.
2019-08-19Fixed #30693 -- Removed separate import of os.path in ↵Maaz Bin Tahir Saeed
django.core.management.templates.
2019-04-25Fixed #30393 -- Added validation of startapp's directory option.oliver
2019-03-30Made startapp/project's overlaying error message use 'app' or 'project'.oliver
2019-01-31Fixed #30147 -- Simplified directory creation with os.makedirs(..., ↵Jon Dufresne
exist_ok=True).
2019-01-28Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-27Removed default mode='r' argument from calls to open().Jon Dufresne
2018-05-13Fixed #17379 -- Removed management commands deactivation of the locale.Claude Paroz
2018-04-02Removed unused regexes in django.core.management.templates.desigrammer
Unused since their introduction in a9a0f0b03f9a02deb03617bf7e9773a307d1328f.
2018-01-01Fixed typo in TemplateCommand argument help text.Philipp Bosch
2017-12-23Fixed #28594 -- Removed Jython docs and specific codeClaude Paroz
Thanks Andrey Martyanov for the reporti, and Tim Graham for the review.
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-05-30DRY'd startapp and startproject management commands.Adam Johnson
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-01-25Refs #23919 -- Replaced errno checking with PEP 3151 exceptions.Tim Graham
2017-01-18Refs #23919 -- Replaced io.open() with open().Aymeric Augustin
io.open() is an alias for open() on Python 3.
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-10-20Optimized file copy in TemplateCommandClaude Paroz
2016-10-02Fixed #27305 -- Removed BaseCommand.can_import_settings unused attributeClaude Paroz
Thanks Tim Graham for the review.
2016-09-30Removed unneeded no_settings_commands hardcoded listClaude Paroz
Thanks Tim Graham for the review.
2016-09-03Fixed #27171 -- Added unicode_literals and coding preamble to all files in ↵Ivan
startapp template on Python 2.
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-01-25Fixed #25968 -- Changed project/app templates to use a "py-tpl" suffix.Chris Lamb
Debian packages unconditionally byte-compile .py files on installation and do not silence errors by design. Therefore, we need a way of shipping these invalid .py files without a .py extension but ensuring that when we template them, they end up as .py. We don't special-case .py files so that the all the TemplateCommand command-line options (eg. extra_files and extensions) still work entirely as expected and it may even be useful for other formats too.
2015-10-22Fixed #25589 -- Allowed startapp/project to create apps with Unicode ↵Yoong Kang Lim
characters in the name.
2015-06-16Fixed #24971 -- Made startapp generate an apps.pyMounir Messelmeni
2015-06-11Fixed #24950 -- Added unicode_literals to models.py in app templateMarkus Holtermann
Thanks Tim Graham for the patch
2015-02-22Fixed a few uses of Template that relied on a default engine.Aymeric Augustin
Refs #24389.
2015-02-22Removed rmtree_errorhandler.Aymeric Augustin
The stated reason for its introduction in d18d37ce no longer applies since Django's code repository was switched from Subversion to git. Furthermore it never had any effect because shutil.rmtree ignores its onerror argument when ignore_errors is True. The reason for its use in template management commands is unclear.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-12-25Fixed #23866 -- Harmonized refs to Django documentation from codeClaude Paroz
2014-11-25Fixed #23899 -- Added 'Generated by Django X.Y' to startproject template.Martin Blech
2014-11-17Simplified handle_extensions management utilityClaude Paroz
makemessages now doesn't need any special ignoring logic, after commit bb4a92d784.