/my_diary

Using Django Rest Framework to create a diary API.

Primary LanguagePython

MyDiary

Maintainability Build Status Coverage Status

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.

Supported features.

pass

Technologies used.

  • Django Rest Framework.
  • Postgres database.

Getting started.

Prerequisites

  1. Install requirements, run
     pip install -r requirements.txt
  1. Database configuration.

    • Download and install postgres from here
    • Create database in terminal
       $ psql postgres;
       $ CREATE DATABASE database_name;
  2. 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
  3. Switch to the project's root directory and run migrations to create database tables.

    $ python manage.py makemigrations
    $ python manage.py migrate
  1. Then run the application.
   $ python manage.py runserver

Tests

pass