📗 Python back-end app for Guides
- HTTP API for Ekaterinburg guides website
- Notion data cacher. Static files downloader and optimizer
- Database viewer in Admin panel
- Telegram bot updater
Get urls list and metadata of all guides
https://guides-api.ekaterinburg.city/api/tree
Get guide data /<manual-name>
https://guides-api.ekaterinburg.city/api/content/street-name-plates
Get guide page data /<manual-name>/<page-name>
https://guides-api.ekaterinburg.city/api/content/street-name-plates/general-provisions
Get search results on pages by query
скамья
— search query
https://guides-api.ekaterinburg.city/api/search?pattern=скамья
Methods for raw Notion data debugging
Get guide page metadata in Notion format
5604e0725f794708b9094b7ce49a46f7
— Notion page id
https://guides-api.ekaterinburg.city/api/test/retrieve?id=5604e0725f794708b9094b7ce49a46f7
Get guide page content in Notion format
5604e0725f794708b9094b7ce49a46f7
— Notion page id
https://guides-api.ekaterinburg.city/api/test/children?id=5604e0725f794708b9094b7ce49a46f7
The site is managed via a Telegram bot
/update
— update content
/update -f
— force update (rebuild tree, reload images etc.)
-
Install Docker
-
Create
manuals/.env
file frommanuals/.env.example
with secrets- Notion token
- Django settings
- PostgreSQL settings
- Telegram (bot token from @BotFather and master chat id from @userinfobot).
-
Create static volume folder
mkdir /usr/local/docker/manuals-static-volume/
TODO: create folder automatically in project folder (the folder path must be contained in
.gitignore
) -
Run database migrations
docker compose exec manuals python manage.py migrate
-
Configure admin panel
https://<site-url>/admin
5.1. Build Django static for admin panel
docker compose exec manuals python manage.py collectstatic
5.2. (optional) Create Django user to view DB
docker compose exec manuals python manage.py createsuperuser
-
Run Django & Telegram bot
docker compose up -d --build
-
Send message to Telegram bot to force update
/update -f