Skip to content

edwardc91/drones_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drones Example

Basic REST Api example to manage transportation for drones made using Django Framework. Including technology as:

  • Celery and Redis for automated tasks.
  • Django Rest Framework to build REST APIs using Django.
  • PostgreSQL as database system.
  • Docker and Docker Compose for development and deployment.

To run the REST API with Docker and Docker Compose


Run on the terminal command on the root directory of the project docker-compose up --build -d or docker-compose up --build -d or docker compose up --build -d depending of your docker and docker compose installation.

You can access to API swagger schema on http://localhost:8005/api/docs/swagger/. You can also access to a basic admin application of Django on http://localhost:8005/admin/. A default superuser was created with username: admin and password: admin. You can use that user to log in on admin and to obtain a JWT token to use the API.

Important!!! The endpoint for drones, medications and loads managments require a authenticated user, you can use the endpoint http://localhost:8005/api/token/ to get a valid JWT token

Environment variables

You can add environment variables to the contianers modifying .env file. For example you can modify HTTP_PROXY var if you are running docker behind a corporate proxy or add custom variables for specific needs.

Drone's battery history log


A history log of the drone's batteries is save on the database and in a log file you can the database log on django admin in localhost:8005/admin/base/dronestatuslog. Log is updated each minute for all the drones.

Testing


Unit tests were added to test the API's endpoints, you can run the tests with command:

docker exec -it drones_api python manage.py test

Importants endpoints


To see more check swagger api on http://localhost:8005/api/docs/swagger/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published