Figure out how to make `runserver_nostatic` work with Channels
See original GitHub issueAt present, runserver_nostatic
works by simply shadowing the runserver
command from contrib.staticfiles
and replacing it with the runserver
command from Django core. However, this won’t work with Channels, which needs its own runserver command.
A possible approach might be to require that runserver_nostatic
be at the top of the INSTALLED_APPS
list and for it to discover the next highest priority runserver
command (by inspecting the app registry and delegate to that, after setting the appropriate --no-static
flag.
This is obviously more complex and fragile, but it would be nice to have a simple (for the user) solution which was agnostic as to whether Channels was being used.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Learning Go - Concurrency using Goroutines & Channels
Replicate the setup and concurrency increased. Now I guess somethings would have started to sink in.Took me multiple sources and getting hands ...
Read more >Using channels to communicate between goroutines | Smart Go
The channel datatype in Go lets you send messages easily between goroutines, or concurrent operations. Learn how to get started with them in ......
Read more >Django channels error when attempting to serve static files ...
I have got little to no idea where the issue could lie since I don't see how this coming up relates to my...
Read more >How to Start a Channel on TV: A Complete Guide - Amagi
Want to start a channel on TV to earn revenue from your content? Choose a method that delivers quality results while remaining efficient...
Read more >Go Channels Tutorial - TutorialEdge.net
A Simple Example. Let's start off by seeing how we can build up a really simple example of how this works in Go....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@edevil No, I don’t think so. WhiteNoise works fine with Channels, but the small “runserver_nostatic” feature doesn’t. You can either ignore the issue in which case your app will use the default static file handling when in DEBUG mode, or you can manually pass the
--nostatic
option to runserver.@amureki
Yes, you can now integrate WhiteNoise by adding it to
settings.MIDDLEWARE_CLASSES
rather than editingwsgi.py
. This works with standard Django and with Channels.See: http://whitenoise.evans.io/en/stable/changelog.html#simpler-cleaner-django-middleware-integration