Small movies service to search a movie on external API, save it to database and add comments.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python > 3.6.5
- Django > 2.1
- PostgreSQL > 9.5 - project uses database specific fields.
Before you run the project you need to create a .env file.
- DJANGO_SETTINGS_MODULE - Django settings module
- SECRET_KEY - Django app Secret Key
- DB_NAME - database name
- DB_USER - database user name
- DB_PASSWORD - databas password
- API_KEY - your API key to access http://www.omdbapi.com/
After pulling application remember to change settings DEBUG = True!
Otherwise application will use production settings.
To use production version run:
pip install -r requirements.txt
To use minimal basic requirements version run:
pip install -r requirements/base.txt
To use full development version run:
pip install -r requirements/dev.txt
/api/movies/
/api/movies/top/?period_start=<date>&period_end=<date>
/api/comments/
You can run tests using pytest:
pytest
Test style adjustments accordingly to PEP8:
flake8 .
Small check against the most popular vulnerabilities with bandit tool.
bandit -r .
Application is ready for deployment on Heroku. Just change DEBUG = False, create app, push repo and enjoy!
Rembember to add HEROKU_HOST variable:
heroku config:set HEROKU_HOST=<you_host_name>
- Django - The web framework used
- Django Rest Framework - Framework for API building
- Chiefir - LinkedIn