/productimporter

this is a sample repo

Primary LanguagePython

django-vue-graphql-celery

This is a sample project demostrating the use of Django, Vuejs, Graphql, Celery, Redis to asychronously process huge job of loading file into the database. You will have to download the redis for windows from 1.https://github.com/rgl/redis/downloads

Steps:

  1. Goto https://github.com/abhishekzgithub/productimporter

  2. Clone the repo: https://github.com/abhishekzgithub/productimporter.git

  3. cd productimporter

  4. pip install pipenv && pipenv shell : this will install pipenv and create a virtual environment.

  5. pipenv install : this will install all the dependency packages

  6. python manage.py makemigrations && python manage.py migrate && python manage.py runserver

  7. celery -A productimporter worker -l info -P eventlet

  8. celery -A productimporter beat -l info . open the localhost:8000 on your browser . Look for the urls

. Sample graphql queries which may be used via http://127.0.0.1:8000/graphql/: for filtering-> """ query{ products(find:"{'name':'Bryce Jones'}") { name sku description } } """ for searching-> """ query{ products(search:"Bry"){ name sku } } """

How to deploy to heroku

  1. Install the heroku cli

  2. heroku login -> It will ask to open browser where you can login.

  3. heroku create -> this will become the url as well

  4. git push heroku master -> make sure you are in the root directory of your app

  5. heroku ps:scale web=1 -> to scale the web app created

  6. heroku open will show you your homepage

  7. if any changes are made, do

    1. git add .
    2. git commit -m "message"
    3. git push origin master
    4. git push heroku master
  8. For the database configuration on heroku, install the addon and use below line for the changes. DATABASES['default'] = dj_database_url.config(conn_max_age=None)

  9. configuring the redis is a bit costly as you may have to upgrade your account.

  10. It can be seen here. https://productimporter.herokuapp.com/