GithubHelp home page GithubHelp logo

suqi / channels-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacobian/channels-example

0.0 2.0 0.0 72 KB

An example Channels app

License: BSD 3-Clause "New" or "Revised" License

Python 40.64% CSS 43.89% JavaScript 3.67% HTML 11.80%

channels-example's Introduction

Django Channels Example

This is an example app demonstrating how to use (and deploy) Django Channels. It's a simple real-time chat app โ€” like a very, very light-weight Slack. There are a bunch of rooms, and everyone in the same room can chat, in real-time, with each other (using WebSockets).

For a walkthrough of what's going on here, see my article over on the Heroku blog.

You can visit my deployment of the example online, or deploy your own copy to Heroku with this button (which requires a free Heroku account):

Deploy

WARNING: you'll need to scale the worker process type up after using the button. Use the Dashboard, or run heroku ps:scale web=1:free worker=1:free.

Running locally

To run this app locally, you'll need Python, Postgres, and Redis. (On my Mac, I installed Postgres.app and Redis from Homebrew (brew install redis).)

Then, to run:

  • Install requirements: pip install -r requirements.txt (you almost certainly want to do this in a virtualenv).
  • Migrate: DATABASE_URL=postgres:///... python manage.py migrate
  • If you use heroku local, or foreman/forego, edit .env to add DATABASE_URL and REDIS_URL, then start heroku local/foreman/forego.
  • Or, to run locally with runserver, set DATABASE_URL and REDIS_URL in your environ, then run python manage.py runserver.
  • Or, to run locally with multiple proceses by setting the environ, then running the two commands (daphne and runworker) as shown in the Procfile.

channels-example's People

Contributors

fitblip avatar jacobian avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.