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.
- Create a virtual environment with Python3.7:
virtualenv env -p python3.7
. If you dont havepython3.7
yet then you can install it with:- linux(ubuntu/debian) -
sudo apt install python3.7
- windows - Download installer from https://www.python.org/downloads/release/python-370/.
- linux(ubuntu/debian) -
- Activate the virutal environment:
source env/bin/activate
- Install all the dependencies in
requirements.txt
file:pip install -r requirements.txt
- Make a copy of
.env.sample
to.env
and change the values of variables with original values. Click here for sample .env file. - See below for celery setup.
- See below for email setup.
- Migrate the migrations:
python manage.py migrate
- Run the app:
python manage.py runserver
- Navigate to http://localhost:8000 in your browser
- When you are done using the app, deactivate the virtual environment:
deactivate
SECRET_KEY=''3izb^ryglj(bvrjb2_y1fZvcnbky#358_l6-nn#i8fkug4mmz!''
ALLOWED_HOSTS='*'
DEBUG='True'
EMAIL_HOST_USER='username@gmail.com'
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:
- MOCK_EMAIL defaults to True
For gmail:
- Set the
EMAIL_SERVICE
to 'DJANGO-SMTP' - 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.
- Then generate a new app password for teesco.
- The app password will look like this.
- This 16 letter code should be set to
EMAIL_HOST_PASSWORD
in.env
. - We have added below images for help.
For Amazon SES
- Set the
EMAIL_BACKEND
to 'AWS-SES' in.env
- Also set the
AWS_SECRET_ACCESS_KEY
,AWS_REGION_NAME
andAWS_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.
For linux
sudo apt install redis-server
- In a separate terminal run
celery -A server worker -l info
when the celery command is needed. - If you see the below image celery is running successfully in your system.
For windows
- Even though redis can be installed in windows but the celery(a python package needed in this project) doesn't work on windows.
- Dont you worry we are exploring other alternatives for windows.
- Still you can contributions which dont require celery. Open two terminals and run on second terminal