MyDiary is an online journal where users can pen down their thoughts and feelings.
My Diary is an API developed using the Django Rest Framework.
pass
- Django Rest Framework.
- Postgres database.
- Install requirements, run
pip install -r requirements.txt
-
Database configuration.
- Download and install postgres from here
- Create database in terminal
$ psql postgres; $ CREATE DATABASE database_name;
-
Set the required environment variables.
-
Add a configuration file called
config.txt
where you will set the enviromnent variables.export DATABASE_URL='postgres://USER:PASSWORD@HOST:PORT/NAME' export EMAIL_HOST='email host' export EMAIL_PORT=465 export EMAIL_HOST_USER='email host user' export EMAIL_HOST_PASSWORD='email host ' export EMAIL_USE_TLS=True
-
Set these environment variables using the following command.
$ source ./config.txt
-
-
Switch to the project's root directory and run migrations to create database tables.
$ python manage.py makemigrations
$ python manage.py migrate
- Then run the application.
$ python manage.py runserver
pass