Demo API using Django with one route that takes a datetime string and returns open restaurants, if any.
The Django project was initialized using the command:
django-admin startproject project .
The api application was created using the command:
python manage.py startapp api
Create a .env file in the root directory of your project based off of the .env.sample
file.
sudo apt-get install gcc libpq-dev python3-dev
Install Docker and run the following command to startup the database/api in Docker:
docker compose up --build --pull postgresql --remove-orphans -V --wait
poetry run python manage.py migrate
To lint the project, run the following commands:
poetry run flake8 api project manage.py
poetry run pylint api project manage.py
To run the tests, be sure you have ran the Docker Compose Command, then run the following command:
poetry run python manage.py test