BolotZhusupekov07 / improved-umbrella

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Courses is a simple API allowing consumers to view courses and create one themselves.

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.


Prerequisites

This is a project written using Python, Django, and Django Rest Framework

1. Clone the repository
git clone https://github.com/BolotZhusupekov07/psychic-happiness
2. Create your own virtual enviroment
python3 -m venv venv
source venv/bin/activate
3. Install the requirments
pip install -r requirements.txt
4. Create a new PostgreSQL database

Assuming you already have pgAdmin and postgres installed.

In your terminal:

$ psql postgres
$ CREATE DATABASE databasename
$ \connect databasename

Go into pgAdmin, login, and check that the new database exists on the dbserver. The database credentials to go in your project’s settings.py are the same credentials for pgAdmin.

setting.py
DATABASES = {
             ‘default’: {
                 ‘ENGINE’: ‘django.db.backends.postgresql_psycopg2’,
                 ‘NAME’: env(‘DATABASE_NAME’),
                 ‘USER’: env(‘DATABASE_USER’),
                 ‘PASSWORD’: env(‘DATABASE_PASS’),
       }
 }

5. Generate a new secret key

You can use Djecrety to quickly generate secure secret keys.

6. Rename the project

Rename the directory that contains settings.py. Do a find all and replace to rename all instances of the new project name.

7. Make your migrations

In your terminal:

$ python manage.py makemigrations
$ python manage.py migrate
8. Create a new superuser
python manage.py createsuperuser
9. Final checks

Start the development server and ensure everything is running without errors.

python manage.py runserver

Running tests


You can run the automated tests for this project with

python manage.py test

You can find Postman tests here - Course Tests.postman_test_run.json

Built With


Django - The framework used
Django Rest Framework - The toolkit used to build API
API Blueprint - for API documentation

API Blueprint


API Blueprint

Deployed to Heroku

Courses

About


Languages

Language:CSS 48.4%Language:JavaScript 47.1%Language:Python 4.5%