djangocameroon / website_api

Django Cameroon Website API
https://api.djangocameroon.site/redoc/
MIT License
8 stars 4 forks source link
community django django-cameroon django-rest-framework

website_api

Installation

  1. Create and activate a virtual environment

    python3 -m venv venv
    source venv/bin/activate
  2. Install dependencies

    pip3 install -r requirements.txt
  3. 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.

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

    cp -r .env.example .env
  5. Apply database migrations

    python3 manage.py migrate
  6. 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.