- Python 3.9
- Django 4.0.4
- Goto main package -> check_point_dj
- run: 'python manage.py runserver'
- run Docker server
- docker build --tag python-django .
- docker run --publish 8000:8000 python-django
- You can access the admin page at http://localhost:8000/admin/
- username: admin, password: 0
- run 'python manage.py test' to run all tests
- Most importantly this includes ulrs.py and settings.py that map our URLs and control settings respectively.
- urls.py:
- maps the internal URLs of the api.
- models.py:
- This holds our Model "EventItem" that represents a row in an SQLite Database.
- views.py:
- In Django views are functions/classes that take requests & return responses.
- We define here 2 views, one for each of our api endpoints.
- data - in the forma of a string.
- stats - Json object, counter of key-word occurences.
- a timestamp - datetime.datetime object.
- Was not clear exactly what interval was - I assumed that it meant get interval seconds back
- I assumed we tally only full words.
- I assumed the search is case insensitive.