prod.py 623 B

123456789101112131415161718
  1. import multiprocessing
  2. # Django WSGI application path in pattern MODULE_NAME:VARIABLE_NAME
  3. wsgi_app = "store_back.wsgi:application"
  4. # The number of worker processes for handling requests
  5. workers = multiprocessing.cpu_count() * 2 + 1
  6. # The socket to bind
  7. bind = "0.0.0.0:8000"
  8. # Write access and error info to /var/log
  9. accesslog = "/var/log/gunicorn/access.log"
  10. errorlog = "/var/log/gunicorn/error.log"
  11. # Redirect stdout/stderr to log file
  12. capture_output = True
  13. # PID file so you can easily fetch process ID
  14. pidfile = "/var/run/gunicorn/prod.pid"
  15. # Daemonize the Gunicorn process (detach & enter background)
  16. daemon = True