Skip to content

Instantly share code, notes, and snippets.

View keystroke3's full-sized avatar

Ted keystroke3

View GitHub Profile
@keystroke3
keystroke3 / gonicorn_nginx_django.md
Created September 11, 2021 22:45 — forked from mhsamiei/gonicorn_nginx_django.md
deploy django with nginx and gunicorn config

Testing Gunicorn’s Ability to Serve the Project The last thing we want to do before leaving our virtual environment is test Gunicorn to make sure that it can serve the application. We can do this by entering our project directory and using gunicorn to load the project’s WSGI module:

    (myenv) $ cd ~/myprojectdir
    (myenv) $ gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Creating systemd Socket and Service Files for Gunicorn We have tested that Gunicorn can interact with our Django application, but we should implement a more robust way of starting and stopping the application server. To accomplish this, we’ll make systemd service and socket files.