Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Run Django application using Gunicorn

"""Gunicorn *development* config file (suppose > dev.py)""" 

"""Django WSGI application path in pattern MODULE_NAME:VARIABLE_NAME"""
wsgi_app = "project.wsgi:application"
"""The granularity of Error log outputs"""
loglevel = "debug"
"""The number of worker processes for handling requests"""
workers = 2
"""The socket to bind"""
bind = "0.0.0.0:8000"
"""Restart workers when code changes (development only!)"""
reload = True
"""Write access and error info to /var/log"""
accesslog = errorlog = "/var/log/gunicorn/dev.log"
"""Redirect stdout/stderr to log file"""
capture_output = True
"""PID file so you can easily fetch process ID"""
pidfile = "/var/run/gunicorn/dev.pid"
"""Daemonize the Gunicorn process (detach & enter background)"""
daemon = True

"""With the dev.py file above, run this"""
gunicorn -c config/gunicorn/dev.py
Comment

PREVIOUS NEXT
Code Example
Python :: python find length of list 
Python :: how to define a dictionary in python 
Python :: f string python 
Python :: simple bmi calculator using python 
Python :: python calling method from constructor 
Python :: converting timezones 
Python :: google youtuve api python 
Python :: numpy datatime to string 
Python :: pandas how to read csv 
Python :: duplicate remove 
Python :: how to set default file directory for jupyter notebook 
Python :: if or python 
Python :: sort dataframe by function 
Python :: immutability in python 
Python :: sessions in flask 
Python :: python online 
Python :: subarrays in python 
Python :: dictionary get all values 
Python :: python print array 
Python :: python if greater than and less than 
Python :: python programming language 
Python :: count function in python 
Python :: python generators with for 
Python :: python modules list 
Python :: Show all column names and indexes dataframe python 
Python :: Unreadable Notebook: jupyter 
Python :: python list of paths 
Python :: python string: string concatenation 
Python :: python - dashboard 
Python :: python specify multiple possible types 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =