This project is a small example Django application that demonstrates how to create a REST API with a few models.
- Clone this repository
- Install poetry using pip
pip install poetry - cd into the project folder
- Install dependencies using the poetry
poetry install - Setup local postgres database and edit the .env file with your connection values
- Run the tests using
python manage.py test - Run the database migrations using
python manage.py migrate - Run the scheduler migration using
python manage.py qmigrate
- Start the background scheduler using
python manage.py cluster - Start the development server using
python manage.py runserver. - Navigate to
http://localhost:8000/schema/to view the API Swagger.
- id - uuid type, autogenerated
- name - string type, max length 64
- description - string type, max length 256
- Create a new product
- Get a list of products
- Get a specific product
- Update all data of the product
- Update any field of the product
- Delete a specific product
- id - uuid type, autogenerated
- price - int type
- item_in_stock - int type
- get a list of products and list of offers for each product
internal model for communicating with external API
- token - string type, max length 256
- exp - datetime type