Opened 6 years ago

Closed 5 years ago

#15095 closed New feature (fixed)

django-admin.py createconfig /path/to/settings.py

Reported by: Frank Wiles Owned by: nobody
Component: Core (Management commands) Version: 1.2
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Toss this in as I think it's a good idea. I often don't use django-admin.py startproject, for a variety of layout reasons, but would like to be able to just generate a base settings file on a regular basis. This path adds a command that does just that and nothing more.

Attachments (1)

createconfig.diff (1.3 KB) - added by Frank Wiles 6 years ago.
Patch

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by Frank Wiles

Attachment: createconfig.diff added

Patch

comment:1 Changed 6 years ago by Jannis Leidel

Triage Stage: UnreviewedDesign decision needed

I'm not sure if we should add more boilerplate generating management commands, to be honest, e.g. startproject has shown its limitations and this can easily be added to 3rd party apps like django-extensions.

comment:2 Changed 6 years ago by Frank Wiles

Totally understand if this is better suited to django-extensions, I know personally that I wish I had this command at least once a month and assume others do as well. One reason it might be better suited to django core is that it might be useful in docs/howtos/tutorials for explaining settings, setting up projects (outside of startproject obviously) without requiring that django-extensions be installed for new users.

comment:3 Changed 6 years ago by Alex Gaynor

At DjangoCon.eu last year Jacob and I discussed an idea for a management command that created things from various templates that could be provided (e.g. via VCS, or installed packages and stuff), so you could provide custom createapp, startproject, or even more fine grained like createmangamentcommand. It was just a thought but if someone wanted to prototype that in an external app I think it would be an interesting idea to explore.

comment:4 Changed 6 years ago by Russell Keith-Magee

I'm inclined to agree with Frank that this sort of thing is well suited to core; settings.py is the one part of startproject that isn't trivial to reproduce manually (unlike, say, most of startapp's functionality). It it could be templated/configured like Alex describes, that would be an added bonus.

IMHO, this would ideally land in parallel with revisions to the tutorial etc that describe best practices for building projects that aren't bound to the tutorial's current "project directory containing apps" focus. Of course, this would force us to actually make some recommendations as to what constitutes best practice :-)

comment:5 Changed 6 years ago by James Addison

Severity: Normal
Type: New feature

comment:6 Changed 6 years ago by joshua.bonnett@…

Easy pickings: unset

It would be very very useful for 3rd party libs(blogs, cms's, stores) to be able to use this to provide their own boiler plate.

comment:7 in reply to:  6 Changed 6 years ago by joshua.bonnett@…

Easy pickings: set

Replying to joshua.bonnett@…:

It would be very very useful for 3rd party libs(blogs, cms's, stores) to be able to use this to provide their own boiler plate.

not sure how I unset easy pickings.

comment:8 Changed 5 years ago by anonymous

Easy pickings: unset
UI/UX: unset

comment:9 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

Since we introduced support for custom project templates a few weeks ago, this ticket can be considered fixed.

Note: See TracTickets for help on using tickets.
Back to Top