Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--noasgi won't serve static files #512

Open
JulienPalard opened this issue May 14, 2024 · 2 comments
Open

--noasgi won't serve static files #512

JulienPalard opened this issue May 14, 2024 · 2 comments

Comments

@JulienPalard
Copy link

When running ./manage.py runserver --noasgi I don't get static files served.

This is because both daphne and django.contrib.staticfiles provides a runserver replacement. Running daphne's runserver with --noasgi just cause the real runserver to be used, giving no chance to the staticfiles runserver.

I don't know if there's an elegant solution here, maybe shadowing commands are not a good idea (I don't blame daphne, staticfiles does the same :D).

Maybe the elegant solution is to link from https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/daphne/ to https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#django.contrib.staticfiles.views.serve for easy finding?

Running Django 5.0.6 with daphne 4.1.2 on Debian Trixie.

@carltongibson
Copy link
Member

The simple thing here is to comment out Daphne from INSTALLED APPS if you don't actually want it.

The noasgi flag predates the runserver implementation.

@karolyi
Copy link
Contributor

karolyi commented Jul 9, 2024

Same issue here. The idea is to use daphne with --noasgi so that django debug toolbar can provide the history view.

With running daphne, it senses a multi-process environment and shuts down the history panel:

https://django-debug-toolbar.readthedocs.io/en/latest/panels.html#history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants