Opened 7 years ago
Closed 7 years ago
#29540 closed New feature (wontfix)
Project specific default app template
| Reported by: | Nathan Gaberel | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 2.0 |
| Severity: | Normal | Keywords: | app_template, default, settings |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Context: We use custom project and app templates at my company.
Problem: Having to pass a --template https://... argument every time we use ./manage.py startapp:
- developers are likely to forget the argument (and waste time re-setting up what was in the template)
- when they don't, having to lookup the correct url is a pain.
Suggestion:
- Ideally we could define a default app template once for a project and every following call to
./manage.py startappwould use that template. - Having looked at the code, I think he'd be possible to add a
DEFAULT_APP_TEMPLATEsetting which could be used as the default case inTemplateCommand.handle_template(https://github.com/django/django/blob/master/django/core/management/templates.py#L187). - It would default to the current app template default in
django/conf/app_template(no breaking change). - I could add:
to my
DEFAULT_APP_TEMPLATE = "https://github.com/xxx/yyy/archive/master.zip"
settings.pyto change the default app template for the current project.
If this is accepted, I'd happy to send a PR.
Note:
See TracTickets
for help on using tickets.
This sounds like a good use case for overriding the
startappcommand in your project and making whatever customizations you need.