Opened 5 years ago

Closed 5 years ago

#20406 closed New feature (wontfix) generate nginx/apache/uWSGI/gunicorn sample config

Reported by: est Owned by: nobody
Component: Core (Management commands) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



This is just an idea, if this issue is inappropriet please ignore.

I see a lot of people having troulbe setting up django for production because the hassle of setup and config process.

For lower the barriers to entry of Django, I suggest we implement scaffolding some sample config based on current dir and settings.

For example:

$ python getconfig uwsgi+nginx

The utility will ask the user to input the domain for the project:

The command output two files, uwsgi.ini and


module = wsgi:application
workers = 2 # number of cores
master = true
socket = LAST_COMMAND_CWD/django.sock should be automatically placed under nginx sites-available, and prompt the user to ln -s to the sites-enabled dir.

server {

location /static/ {

# generated using MEDIA_PATH and STATIC_PATH.

location / {

include uwsgi_params;
uwsgi_pass LAST_COMMAND_CWD/django.sock;



In the above example LAST_COMMAND_CWD is the abspath where user executed command.

This is just a rough example. The goal is to give an official standard reference deploy structure and process.

Later we can even add some parameters that allows SA to automatically genreate the correct config for seamless infrastructure migration.

Change History (1)

comment:1 Changed 5 years ago by Claude Paroz

Component: UncategorizedCore (Management commands)
Resolution: wontfix
Status: newclosed
Type: UncategorizedNew feature

Deployment is hard to standardize, because you have so many different parameters to take into account.

I don't say that we should not do it, but nothing prevent you from creating a package outside of core Django to achieve this, and when/if it is popular and recognized as a very useful addition, we can then conceive integrating it in Django.

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