/movie-shop

Simple shop api with CRUD operations

Primary LanguagePythonMIT LicenseMIT

Movie Shop - Simple shop api with CRUD operations

How to setup and test the application

  1. Install pip first using this command

    sudo apt-get install python3-pip

  2. Install virtualenv using pip3 sudo pip3 install virtualenv

  3. Create a virtual environment virtualenv venv

  4. Activate your virtual environment: source venv/bin/activate

  5. Clone this repo with the following command:

    git clone https://github.com/Nyakaru/movie-shop.git

  6. Cd into the movieshop directory: cd movieshop

  7. Install the requirements by running the command:

    pip install

  8. Create a database: In the terminal run the following after installing postgres and setting up:

    psql create DATABASE <name_of_your_database>

  9. Create a .env file in the project folder and and the following exports:

    export DATABASE="<name of your database>"

    export USER="<your postgres username>"

    export HOST="<localhost>"

    export PASSWORD="<your postgres password>"

  10. Export the settings by running the command: source .env

  11. Migrate the database:

    python manage.py makemigrations

    python manage.py migrate

  12. Run the server:

    python manage.py runserver

  13. Access the endpoints via:

    1. Web browser(Swagger) - http://127.0.0.1:8000/docs/
    2. Postman - http://127.0.0.1:8000/api