Serve a Django application using Gunicorn

Create systemd service file


On the above, you need to replace “/path/to/app/backend” with the path to your application. In backend.wsgi, backend is the application name here, change it to whatever your Django application name is.

You can change this to whatever user you use to upload your Django application files.

Enable and start the service

Now your Django application will be available on port 8080. You can configure nginx or apache to proxy to this port.

Here is a sample nginx config

Here Django application is served as /api/ folder, you can change this as required.

Back to Gunicorn

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *