Skip to content

Django-Projects-Ls/VehiclesAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VehiclesAPI

An API for register and consult vehicles.

Setup API

Create and active your virtual environment using the command bellow:

python3 -m venv .venv
python3 source .venv/bin/activate

if you are using windows, maybe the alias for your interpreter is different, try trade python3 for python only.

Making migrations

Create your db.sqlite3 and all tables necessary with one commmand bellow:

python3 manage.py migrate

Runserver

Run your api for listen by default in localhost:8000.

python3 manage.py runserver

API Reference

List all vehicles:

GET http://localhost:8000/api/vehicles/

Create a vehicle:

POST http://localhost:8000/api/vehicles/
Parameter Type Description
name string Required
model string Required
price float Required
speed int Required
passengers int Required
year int Required

List a specific vehicle

GET http://localhost:8000/api/vehicles/${id}/

Update vehicle

PUT http://localhost:8000/api/vehicles/${id}/
Parameter Type Description
name string Required
model string Required
price float Required
speed int Required
passengers int Required
year int Required

Delete vehicle

DELETE http://localhost:8000/api/vehicles/${id}/

Keep in mind to change ${id} for correspondent object what you want to play.

About

An API for register and consult vehicles.

Resources

License

Stars

Watchers

Forks

Languages