﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20406	manage.py generate nginx/apache/uWSGI/gunicorn sample config	est	nobody	"Hello,

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 manage.py getconfig uwsgi+nginx

The utility will ask the user to input the domain for the project: example.com

The command output two files, uwsgi.ini and example.com.nginx.conf

uwsgi.ini:

[uwsgi]
chdir = LAST_COMMAND_CWD
module = wsgi:application
workers = 2 # number of cores
master = true
socket = LAST_COMMAND_CWD/django.sock


example.com.nginx.conf should be automatically placed under nginx sites-available, and prompt the user to ln -s to the sites-enabled dir.

server {
  server_name example.com
  location /static/ {
     # generated using settings.py 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 manage.py 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.
"	New feature	closed	Core (Management commands)	1.4	Normal	wontfix			Unreviewed	0	0	0	0	0	0
