question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Figure out how to make `runserver_nostatic` work with Channels

See original GitHub issue

At 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
evansdcommented, Feb 1, 2017

@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.

1reaction
evansdcommented, Jun 13, 2016

@amureki

Yes, you can now integrate WhiteNoise by adding it to settings.MIDDLEWARE_CLASSES rather than editing wsgi.py. This works with standard Django and with Channels.

See: http://whitenoise.evans.io/en/stable/changelog.html#simpler-cleaner-django-middleware-integration

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found