Package: django-server-controller
django-server-controllerDjango server controllers, e.g. UwsgiController, GunicornController.Installpipinstalldjango-server-controllerDjango Command HelpC:\Workspace\my_django_project>python manage.py wsgi-server --help
Usage: manage.py wsgi-server [OPTIONS] COMMAND [ARGS]...

Options:
  --version                      Show the version and exit.
  -h, --help                     Show this message and exit.
  -v, --verbosity INTEGER RANGE  Verbosity level; 0=minimal output, 1=normal
                                 output, 2=verbose output, 3=very verbose
                                 output.

  --settings SETTINGS            The Python path to a settings module, e.g.
                                 "myproject.settings.main". If this is not
                                 provided, the DJANGO_SETTINGS_MODULE
                                 environment variable will be used.

  --pythonpath PYTHONPATH        A directory to add to the Python path, e.g.
                                 "/home/djangoprojects/myproject".

  --traceback / --no-traceback   Raise on CommandError exceptions.
  --color / --no-color           Enable or disable output colorization.
                                 Default is to autodetect the best behavior.


Commands:
  reload   Reload uwsgi server.
  restart  Restart uwsgi server.
  start    Start uwsgi server.
  status   Get uwsgi server's status.
  stop     Stop uwsgi server.Usagepro/settings.pyINSTALLED_APPS = [
    ...
    'django_server_controller',
    ...
]

WSGI_SERVER_ENGINE = "uwsgi"   # required. uwsgi or gunicorn, default to uwsgi.

#
# optional config items
#
WSGI_PROJECT_NAME = xxx # used for name of the default pidfile
WSGI_PROJECT_BASE = xxx
WSGI_LOGS_ROOT = xxx
WSGI_PIDFILE = xxx
WSGI_CONFIG_FILE = xxx
WSGI_BIN = xxx
KILL_BIN = xxx # used for send signal to gunicorn process, no use for uwsgiAdd django_server_controller into INSTALLED_APPS, so that we can use it's django-management-commands.You can add server settings in django's settings.py. If not provide, the default values are used.UWSGI_PROJECT_BASE defaults to current directory.Suggest you set this variable.CONFIG_FILE search orders for uwsgi server engine:settings.CONFIG_FILE pointed file.settings.WSGI_PROJECT_BASE + "./etc/wsgi.ini"./etc/wsgi.ini~/etc/wsgi.inipython-lib-root/lib/python3.6/site-packages/the_project_package/wsgi.iniCONFIG_FILE search orders for gunicorn server engine:settings.CONFIG_FILE pointed file.settings.WSGI_PROJECT_BASE + "./etc/wsgi.conf.py"./etc/wsgi.conf.py~/etc/wsgi.conf.pypython-lib-root/lib/python3.6/site-packages/the_project_package/wsgi.conf.pySuggest project folders./bin/
./etc/
./lib/
./lib64/
./web/
./web/static/
./web/upload/
./logs/suggest you use virtualenv.bin/lib/lib64 folders are created by virutalenv.etc/web/logs folders are ours.Example template of wsgi.ini[uwsgi]
socket=0.0.0.0:5501
http=0.0.0.0:5502
stats=0.0.0.0:5503
chdir=/home/your-project-name
processes=2
threads=40
listen=1024
master=True
daemonize=/home/your-project-name/logs/uwsgi.logExample template of wsgi.conf.pybind = ["0.0.0.0:5505"]
workers = 2
threads = 40
max_requests = 10000
daemon = True
chdir = /home/your-project-name
accesslog = "/var/logs/pro1/gunicorn.access.log"
errorlog = "/var/logs/pro1/gunicorn.error.log"
keepalive = 300
timeout = 300
graceful_timeout = 300
loglevel = "info"NoticeMany nginx setkeepaliveto 60 seconds, but gunicornkeepalivedefaults to 2 seconds, this may cause many 502 errors. So that set the gunicorn'skeepalivevalue to higher than 60 seoncds, for example 300 seonds.Releasesv0.1.0First release.v0.1.1Fix psutil import problem.v0.1.2Fix reload parameter problem.v0.1.3Fix time import problem.v0.2.0Use as django's command.v0.2.1Add django-click in requriements.txt.Change uwsgi_ini_file search order, and uwsgi_bin search order.Update document.v0.3.0Add GunicornController.v0.3.2Add project_base folder to uwsgi/gunicorn's pythonpath.v0.4.0Stop command will wait for server to stop. Use --force to kill the server by force if stopping timeout.Add subcommand show-wsgi-config-file to show current wsgi.conf.py path.Add subcommand show-wsgi-config-file-paths to show wsgi.conf.py searching paths.v0.5.0Set default web root to project base.v0.5.1Doc update.