Skip to content

JohananOppongAmoateng/website_api

 
 

Repository files navigation

website_api

Installation

  1. Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
  1. Install dependencies
pip3 install -r requirements.txt
  1. Setup a new postgres database Assuming postgresql is installed in your computer, follow what's next:

    •  # accessing the postgres CLI
       sudo -u postgres psql
    • -- Create a database
      CREATE DATABASE django_website_db;
      
      -- create a new user with the details below
      CREATE USER 'db_username' WITH ENCRYPTED PASSWORD 'password';
      -- Grant all priviledges
      GRANT ALL PRIVILEGES ON DATABASE django_website_db TO 'db_username'@'host';

    If postgreSQL is not installed in the computer, get to the tutorial for Linux or for Windows.

  2. Copy the .env.example file to .env and fill in the values in the .env file.

cp -r .env.example .env
  1. Apply database migrations
python3 manage.py migrate
  1. Run the server
python3 manage.py runserver

Contributing

Contributions are always welcome! If you have any bug reports, feature requests, or pull requests, please feel free to submit them.

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Other 1.7%