Coder Social home page Coder Social logo

teesco-backend's Introduction

teesco-backend

Branches

The repository has the following primary branches:

  • master - This contains the code which has been released (production ready code).
  • develop - This contains the latest code. All the contributing PRs must be sent to this branch.

Setup and run

  1. Create a virtual environment with Python3.7: virtualenv env -p python3.7. If you dont have python3.7 yet then you can install it with:
    1. linux(ubuntu/debian) - sudo apt install python3.7
    2. windows - Download installer from https://www.python.org/downloads/release/python-370/.
  2. Activate the virutal environment: source env/bin/activate
  3. Install all the dependencies in requirements.txt file: pip install -r requirements.txt
  4. Make a copy of .env.sample to .env and change the values of variables with original values. Click here for sample .env file.
  5. See below for celery setup.
  6. See below for email setup.
  7. Migrate the migrations: python manage.py migrate
  8. Run the app: python manage.py runserver
  9. Navigate to http://localhost:8000 in your browser
  10. When you are done using the app, deactivate the virtual environment: deactivate

Example env file

SECRET_KEY=''3izb^ryglj(bvrjb2_y1fZvcnbky#358_l6-nn#i8fkug4mmz!''
ALLOWED_HOSTS='*'
DEBUG='True'
EMAIL_HOST_USER='[email protected]'
EMAIL_HOST_PASSWORD='password'
MOCK_EMAIL = <True-or-False>
EMAIL_SERVICE = '<DJANGO-SMTP or AWS-SES>'
AWS_REGION_NAME = 'AWS_REGION_NAME'
EMAIL_HOST= 'smtp.gmail.com'
AWS_ACCESS_KEY_ID = 'AWS_ACCESS_KEY_ID'
AWS_SECRET_ACCESS_KEY = 'AWS_SECRET_ACCESS_KEY'

note:

  1. MOCK_EMAIL defaults to True

Email Setup

For gmail:

  1. Set the EMAIL_SERVICE to 'DJANGO-SMTP'
  2. If your are using gmail then normal password is not enough to send email through django email package. You have to enable two step verification in https://myaccount.google.com/security.
  3. Then generate a new app password for teesco.
  4. The app password will look like this.
  5. This 16 letter code should be set to EMAIL_HOST_PASSWORD in .env.
  6. We have added below images for help.

For Amazon SES

  1. Set the EMAIL_BACKEND to 'AWS-SES' in .env
  2. Also set the AWS_SECRET_ACCESS_KEY,AWS_REGION_NAME and AWS_ACCESS_KEY_ID in .env.

Other than gmail: Other email providers like outlook, hotmail, rediffmail, yahoo mail etc., should work with normal email password. Else they will have a similar approach.

Celery Setup

For linux

  1. sudo apt install redis-server
  2. In a separate terminal run celery -A server worker -l info when the celery command is needed.
  3. If you see the below image celery is running successfully in your system. image

For windows

  1. Even though redis can be installed in windows but the celery(a python package needed in this project) doesn't work on windows.
  2. Dont you worry we are exploring other alternatives for windows.
  3. Still you can contributions which dont require celery. Open two terminals and run on second terminal

teesco-backend's People

Contributors

priyanshisharma avatar naveennvrgup avatar anshsrtv avatar sahil9001 avatar pratibhashrivastav avatar kunalankur avatar adityatiwari23 avatar akhil-maker avatar

Watchers

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