Skip to content
A simple POC app on Django framework
Branch: master
Clone or download
Rjtsahu Merge pull request #22 from Rjtsahu/dev
update django version to fix vulv?
Latest commit c58c367 Feb 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea django project setup Jan 16, 2019
food_ordering fixed a bug,with declined task state Feb 5, 2019
mysite another test with adding connections.close in consumers for connectio… Jan 29, 2019
.gitignore added websocket code in client side Jan 24, 2019
LICENSE Initial commit Jan 15, 2019
Procfile fixed procfile web path 2 Jan 23, 2019
README.md added how to run instructions Feb 4, 2019
db.sqlite3
manage.py django project setup Jan 16, 2019
requirements.txt update django version to fix vulv? Feb 12, 2019

README.md

food ordering management

A simple POC app on Django framework

What is this app ?

  • This app demonstrate how to solve producer consumer problem using priority queuing in redis.
  • It contains two user roles Manager and Delivery Agent
  • A manager can create a task with priority as High/Medium/Low.
  • A delivery agent can accept the highest priority task.
  • Task can have various life cycle states viz. New->Accepted->Complted->Declined->Cancelled.
  • Any event happening should be updated in realtime(websockets).

Library and Framework used

  • Django as web framework
  • Django.db as ORM with postgres as database.
  • Channels with channel_redis to perform realtime communication by using websocket and redis as channel layer.
  • Redis datastore to store task queues with above priorities.

How to Run?

  • Use python3 and install all requirements : pip install -r requirements.txt
  • Host/install redis server and save 'REDIS_CONNECTION' as environment variable. For example if you have hosted redis in your local system then : 'REDIS_CONNECTION' = redis://127.0.0.1:6379
  • Similarly add environment variable with key 'DJANGO_SECRECT_KEY' and 'DATABASE_URL' where first one is random secret key,which second should be valid database URI for example : postgres://user:password@127.0.0.1:5432/test_database
  • Run migrations python manage.py makemigrations and python manage.py migrate
  • Run server python manage.py runserver
  • This will run application in localhost:8000

This is a simple app to demonstate how to work in django app with realtime communication.

Any improvements/suggestions are appreciable.
You can’t perform that action at this time.