Skip to content

A simple django service to place, edit and delete pizza orders into a postgresql database.

Notifications You must be signed in to change notification settings

MaralKay/pizza-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pizza-service

A simple django service to place, edit and delete pizza orders into a postgresql database.

Prerequisites: Python, Pip, Python Virtual Environment

Developed in: OS: Windows 10, IDE: PyCharm

To run the service

  • Clone the project.

  • Go in the project directory: cd pizza-service.

  • Activate the virtual environment by running env_pizzaService\Scripts\activate.

    (for macOS and linux . env_pizzaService/Scripts/activate)

  • Go in: cd pizzaService_proj.

  • Install required packges by running pip install -r requirements.txt .

    You might need administrator permissions for some packages to be installed.

Set up the database and run the server

  • In your postgresql shell (psql) run the following:

    CREATE USER pizza_lover WITH PASSWORD 'ilovepizza';

    CREATE DATABASE pizza_service_db OWNER pizza_lover;

    ALTER USER pizza_lover WITH SUPERUSER;

    ALTER USER pizza_lover CREATEDB;

  • In pizza-service\pizzaService_proj\ run: python manage.py createsuperuser --username pizza_lover

  • migrate the database by running python manage.py migrate

  • Run the server: python manage.py runserver

Access the API

POST for adding

GET, PUT and DELETE for updating and deleting

Functionalities

Test

To run the tests run the command python manage.py test orders .

The tests call the API views in reverse.

About

A simple django service to place, edit and delete pizza orders into a postgresql database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published