Skip to content

Knowledgebase

Choosing WSGI or ASGI for Django hosting

development

Django supports WSGI and ASGI deployment interfaces. The correct choice depends on application features and the server process model available on the hosting plan.

Information to have ready

Identify whether the application needs asynchronous request handling, long-lived connections or an extension such as a WebSocket stack. Confirm the panel supports the intended server rather than assuming every Python selector runs ASGI.

01 Choose WSGI or ASGI for Django hosting

  1. For a conventional WSGI deployment, use the project WSGI callable with a supported production WSGI server or panel integration. Configure the project path and virtual environment.

  2. For an ASGI deployment, use the project ASGI callable with an ASGI-capable production server. Confirm process supervision, proxy routing and required connection support.

  3. Keep static and uploaded-file delivery configured separately. The selected application interface does not automatically provide a production asset server.

  4. Review database, middleware and third-party package compatibility with the chosen execution model. Async views do not make every synchronous dependency non-blocking.

  5. Test the real workload through the public proxy, including timeouts and shutdown behavior, before moving production traffic.

02 Example: choose the callable for the actual server interface

For a Django project whose Python package is named config, the usual callable references differ as follows. Replace config with your real project package.

Deployment interface Illustrative callable Required hosting support
WSGI config.wsgi:application A supported WSGI server or the panel's WSGI integration.
ASGI config.asgi:application An ASGI server with the required process supervision and proxy behavior.

Do not paste an ASGI object into a panel field documented for a WSGI callable. Verify the exact application feature, such as an approved asynchronous endpoint, through the public proxy. Static files, persistent media, database connection policy and shutdown behavior still need their own configuration.

Confirm the expected result

Verify ordinary pages and the feature that motivated the interface choice. Confirm the app restarts after an intentional process stop and that persistent connections behave as expected.

Troubleshoot unexpected results

If a panel expects a WSGI object, supplying an ASGI app directly is not an interchangeable configuration. Use the supported integration or choose hosting that can run the required server.

A common question

Does ASGI automatically make my site faster?

Performance depends on the workload and dependencies. Choose it for a supported architecture and measured requirements, then size workers, connections and resource limits deliberately.

Sources and further reading

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support