Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 3.2 KB

README.md

File metadata and controls

105 lines (67 loc) · 3.2 KB

Table of contents generated with markdown-toc

Backend setup

Installation

Adding environment variables

Refer this section of the README to add all the environment variables.

Installing dependencies

Using a virtual environment is encouraged.

pip install -r requirements.txt

Setting up database

python manage.py reset_db
python manage.py migrate

Running the server

python manage.py runserver

Environment variables

Create a .env file inside backend folder with the following environment variables:

# set this to True only in development, DON'T include in production
DEBUG=True

Django

RMP_SECRET_KEY: The secret key used in Django projects. Read more about it here.

Development

In order to generate your own secret key, checkout this.

Production

Be more careful with what secret key you use in production. Checkout this.

Database

RMP_DB_URL: The URL to the database to be used.

Development

For quick development-setup, you can go with SQLite. The corresponding URL will be: sqlite:///PATH. PATH is the path to the SQLite database file (which does not exist beforehand).

Example: sqlite:////home/reeshabh/Desktop/mentoringplatform/backend/db.sqlite3.

Note: In some rare cases, it might be required that the SQLite database needs to exist beforehand. In those cases, create an empty file named db.sqlite at PATH.

Production

For production environments, avoid SQLite. URLs for other database servers can be found here.

Email backend

RMP_EMAIL_HOST: The email service being used.

RMP_EMAIL_HOST_USER: The account name/username from which the emails are sent.

RMP_EMAIL_HOST_PASSWORD: The password/secret-key to authenticate the outgoing emails.

Development and Production

We suggest using SendGrid as the email backend.

RMP_EMAIL_HOST: smtp.sendgrid.net

RMP_EMAIL_HOST_USER: apikey (literally)

RMP_EMAIL_HOST_PASSWORD: Generate API key from Sendgrid using SMTP mode. Refer this after making a Sendgrid account. However, feel free to use any other service as your email-backend. Make sure you check out the offers available in your GitHub Student Developer Pack.