Pizza Order Delivery System
EndPoints Api To Allow Users To Do Thier Own Orders Delete Orders Retrive Order And Update Thier Own Orders
1.Postgresql DataBase Server version >= 10
1.Django
4.Psycopg2 Postgresql Connector
Please Make Sure That PreeRequsts Installed On Your System To Run This Project Corectly
- First Create Db pizza On Your Server Localhost Or Remote Server
psql --host=localhost --username=postgres --dbname=postgres
if you will use remote host use
--host={ip for remote host}
then you will be prompt for password then preform these orders in order to create database pizza
create database pizza with encoding="UTF8" owner=postgres;
then exit by type
exit
\q
- second use git to clone project on your system with command
git clone https://github.com/BakrFrag/Pizza-Order-System
this will clone project and get it on folder called Pizza-Order_System 3.redirect to Project folder Pizza-Order-System
cd Pizza-Order-System
active the virtualenv
pipenv shell
install Dependancies Library Used
pipenv install
4.redirect to actual Project
cd PizaaApp
5.To Edit Setting File To Edit Databas Password
cd PizaaApp
Edit settings.py file On Database Settings By Replace
PASSWORD:With Your Password
HOST:With Your Host
USER:With Postgresql User
Port:Actual Running Port In Your System
- applay migrations on database with commands
python manage.py makemigrations
python manage.py migrate
- Run The Development Server Of Django By
cd ..
python manage.py runserver
- Then Got To Browser And Place
http://127.0.0.1:8000/pizza/list/api/
You Will Find List Of All Orders
these endpoints tested and works fine and behave as expected
- List All Order Url Get Request
http://127.0.0.1:8000/pizza/list/api/
You Can Custimze Result By Using Filters On status And customer Or Poth Of Them Like
http://127.0.0.1:8000/pizza/list/api/?status=in_progress&customer=bk
replace status with you need and also custome you can custimize list by customer only like
http://127.0.0.1:8000/pizza/list/api/?customer=bk
also you can custimze list by status only
http://127.0.0.1:8000/pizza/list/api/?status=in_progress
- Create Order With Post Request
http://127.0.0.1/pizza/create/api/
- update order by Put Request and order ID
http://127.0.0.1:8000/pizza/update/api/<int:id>/
- Delete Order By Delete Request And order Id
http://127.0.0.1:8000/pizza/delete/api/<int:pk>/
- Retrive Order By Get Request And Order ID
http://127.0.01:8000/pizza/order/<int:pk>/
These tests tested and works fine There Is 3 Test On tests.py File To Run Them Type
Please Read Comments On tests.py before run it
python manage.py test
this will run tests
if you run this project in Debian Destributions Like Ubuntu Or Linux Mint Please Install libpq-dev
sudo apt-get install libpq-dev
Please Read Comments On Database models , tests , views