Screencast:
Google drive link
.env file example:
MYSQL_DATABASE=mysql
MYSQL_USER=mysql
MYSQL_PASSWORD=pa$$word
MYSQL_ROOT_PASSWORD=pa$$word
HOST=mysql
DEBUG=False
docker-compose up -d
docker exec -it <container_id> bash
python manage.py parse_news --type=docker
- username: admin
- password: adminpass
Ensure you have Python >= 3.8.12
- python -m venv venv Make venv
- source /venv/bin/activate Activate venv
- cd djnews && pip install -r requirements.txt Install required packages
- edit settings.py to fit your settings (DB, DEBUG, etc.) Fix your settings
- python manage.py makemigrations && python manage.py migrate Make migrations and migrate
- python manage.py parse_news Wait for parsing to complete
- python manage.py runserver Run server
All news:
http://127.0.0.1:8000/news/
Filter by date:
http://127.0.0.1:8000/news/?date__exact=2022-8-25
http://127.0.0.1:8000/news/?date__gt=2022-8-25
http://127.0.0.1:8000/news/?date__lt=2022-8-25
Filter by tags:
http://127.0.0.1:8000/news/?tags=ozon?
Combined filtering:
http://127.0.0.1:8000/news/?tags=ozon?date__exact=2022-8-26