Skip to content

Commit

Permalink
serve static files
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Mar 1, 2016
1 parent a174093 commit d7084d6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
5 changes: 5 additions & 0 deletions NOTES
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Random notes and stuff, likely to become feedback to Andrew:

- static files is weird. how should it work in prod? WhiteNoise-ish would be
ideal; integrate with Daphe?
- channel backend - parse from URL?
4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: daphne channels_example.asgi:channel_layer
worker: python manage.py runworker
web: daphne channels_example.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
worker: python manage.py runworker -v2
6 changes: 6 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- websockets duh
- include old-school django POST view?
might make a good flow for the article, start with old-style and then add WSS
- channels backend shouild use config var (URL-ish?
- test deploy to heroku

9 changes: 8 additions & 1 deletion channels_example/routing.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
channel_routing = {}
from channels.staticfiles import StaticFilesConsumer

channel_routing = {
# This makes Django serve static files from settings.STATIC_URL, similar
# to django.views.static.serve. This isn't ideal (not exactly production
# quality) but it works for a minimal example.
'http.request': StaticFilesConsumer()
}
18 changes: 0 additions & 18 deletions channels_example/wsgi.py

This file was deleted.

1 change: 0 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ Django
channels
dj-database-url
psycopg2
whitenoise
asgi_redis
1 change: 1 addition & 0 deletions static/humans.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi

0 comments on commit d7084d6

Please sign in to comment.