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 apiCreate 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-devInstall Docker and run the following command to startup the database/api in Docker:
docker compose up --build --pull postgresql --remove-orphans -V --waitpoetry run python manage.py migrateTo lint the project, run the following commands:
poetry run flake8 api project manage.py
poetry run pylint api project manage.pyTo run the tests, be sure you have ran the Docker Compose Command, then run the following command:
poetry run python manage.py test