0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/posthog/wsgi.py
Frank Hamand 2c0dc75016
feat: Switch from wsgi to asgi (attempt 3) (#21579)
* Try switching from wsgi to asgi

By default I don't believe this will change anything (everything runs
sync by default), but it will allow us to wrap e.g. clickhouse calls in
sync_to_async wrappers to stop them blocking for ages

* Trigger e2e tests

* Set env var with ASGI/WSGI info

* Fix sentry tracing sampling in ASGI

This was relying on wsgi_environ which is replaced by asgi_scope

* Remove bad headers typecast

* fix linting errors
2024-04-17 11:39:39 +01:00

18 lines
449 B
Python

"""
WSGI config for posthog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posthog.settings")
os.environ.setdefault("SERVER_GATEWAY_INTERFACE", "WSGI")
application = get_wsgi_application()