This is a bakcend built with Django for Slackidum web application. Following technologies have been used.
- django web framework
- djangorestframework - to build API endpoints
- django-channels, for WebSocket
- redis, as a backing store
- postgresql, as a database
Please make sure you that you have following prerequisites installed before installing on your machine.
- Python 3.5 or later
- Postgresql 9.4 or later
- Redis 5.0
- Clone this respository.
$ git clone https://github.com/arjun2504/slackidum-backend.git $ cd slackidum-backend
- Create a virtual envrionment.
$ virtualenv venv $ source venv/bin/activate
- Install the dependencies
(venv) $ pip install -r requirements.txt
- Open up
slackidum/settings.py
and modify your database settings.DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'slackidum', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'localhost', 'PORT': '5432', } }
- In case you are running redis on a different port, make sure your update it in the following code in the same file.
CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { "hosts": [('127.0.0.1', 6379)], }, }, }
- Migrate database.
(venv) $ python manage.py makemigrations (venv) $ python manage.py migrate
- Now serve the backend using:
(venv) $ python manage.py runserver
Now its time to setup front end. Please look at this repository.