The project is running on the local server, but when I try to run on the production server, it gives an error ImportError: cannot import name 'LastModMixin' from partially initialized module 'snippets.models.abstracts' (most likely due to a circular import)
, for example, if you delete this import, the error will be sent to another, and so on, I tried manual
import django
django.setup()
in settings.py, asgi.py
, but doesn't work
this is my asgi.py
import os
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from channels.http import AsgiHandler
from apps.drivers import routing
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
application = ProtocolTypeRouter({
"http": AsgiHandler(),
"websocket": AuthMiddlewareStack(
URLRouter(
routing.websocket_urlpatterns
)
),
})
the command with which I will start the server
gunicorn project.asgi --preload -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8009
also tried daphne -p 8009 project.asgi:application
but the result is the same.
Thanks in advance