Git Product home page Git Product logo

djangochat's Introduction

Django Chat

This is a simple chat room built using Django Channels.

Setup instructions on Ubuntu 16.04:

Follow this guide for the initial server setup.

Update package index :

sudo apt-get update

Install dependencies :

sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx

Database setup :

sudo -u postgres psql

CREATE DATABASE djangochat;

CREATE USER djangochatuser WITH PASSWORD 'YOUR_PASSWORD';

ALTER ROLE djangochatuser SET client_encoding TO 'utf8';

ALTER ROLE djangochatuser SET default_transaction_isolation TO 'read committed';

ALTER ROLE djangochatuser SET timezone TO 'UTC';

GRANT ALL PRIVILEGES ON DATABASE djangochat TO djangochatuser;

\q

Setup Django project :

git clone https://github.com/ploggingdev/djangochat.git

sudo apt install python3-venv

cd djangochat

mkdir venv

python3 -m venv venv/djangochat

source venv/djangochat/bin/activate

pip install -r requirements.txt

pip install --upgrade pip

Add environment variables :

sudo nano ~/.bashrc

#append the following to the end of the file

export djangochat_secret_key="SECRET_KEY"

export djangochat_db_name="djangochat"

export djangochat_db_user="djangochatuser"

export djangochat_db_password="YOUR_PASSWORD"

export djangochat_postmark_token="POSTMARK_TOKEN"

export DJANGO_SETTINGS_MODULE=djangochat.settings

Source the env variables :

deactivate

source ~/.bashrc

source venv/djangochat/bin/activate

Perform database migration :

python manage.py migrate

Install redis by following this guide.

Create Django superuser :

python manage.py createsuperuser

Start the development server :

python manage.py runserver

Start celery :

celery -A chatdemo worker -B -l info

Visit the local development server at 127.0.0.1:8000 to test the site.

djangochat's People

Watchers

James Cloos 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.