updated readme, docker

This commit is contained in:
Alexander Karpov 2023-05-28 21:41:25 +03:00
parent ac467f498e
commit ae6dd136d6
8 changed files with 60 additions and 10 deletions

View File

@ -1,4 +1,4 @@
orconfig
.editorconfig
.gitattributes
.github
.gitignore
@ -6,6 +6,7 @@ orconfig
.idea
.pre-commit-config.yaml
.readthedocs.yml
.travis.yml
venv
data
data.json
parsers

17
.envs/.local/.django Normal file
View File

@ -0,0 +1,17 @@
# General
# ------------------------------------------------------------------------------
USE_DOCKER=yes
IPYTHONDIR=/app/.ipython
DJANGO_READ_DOT_ENV_FILE=no
# Redis
# ------------------------------------------------------------------------------
REDIS_URL=redis://redis:6379/1
REDIS_CACHE=rediscache://redis:6379/1
CELERY_BROKER_URL=redis://redis:6379/0
# Celery
# ------------------------------------------------------------------------------
# Flower
CELERY_FLOWER_USER=debug
CELERY_FLOWER_PASSWORD=debug

7
.envs/.local/.postgres Normal file
View File

@ -0,0 +1,7 @@
# PostgreSQL
# ------------------------------------------------------------------------------
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=passfinder
POSTGRES_USER=debug
POSTGRES_PASSWORD=debug

16
.envs/.production/.django Normal file
View File

@ -0,0 +1,16 @@
# General
# CHANGE ON REAL SERVER
# ------------------------------------------------------------------------------
USE_DOCKER=yes
DJANGO_READ_DOT_ENV_FILE=no
# Redis
# ------------------------------------------------------------------------------
REDIS_URL=redis://redis:6379/0
CELERY_BROKER_URL=redis://localhost:6379/0
# Celery
# ------------------------------------------------------------------------------
# Flower
CELERY_FLOWER_USER=debug
CELERY_FLOWER_PASSWORD=debug

View File

@ -0,0 +1,7 @@
# PostgreSQL
# ------------------------------------------------------------------------------
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=passfinder
POSTGRES_USER=debug
POSTGRES_PASSWORD=debug

View File

@ -1,8 +1,16 @@
# Pass Finder
[Логика проекта и структура данных](https://www.figma.com/file/2De9jBDhNbFg8ScjKGmorY/Untitled?type=whiteboard&node-id=0%3A1&t=NGIe9sKMeVjNiK9j-1)
## Basic Commands
### Load data
be sure to create .env file in top directory(clone .env.template)
$ ./manage.py migrate
$ ./manage.py loaddata data.json
data.json can be downloaded here: https://akarpov.ru/media/passfinder/data.json
### Runserver
$ ./manage.py runserver_plus
@ -30,11 +38,8 @@ This app comes with Celery.
To run a celery worker:
``` bash
cd passfinder
celery -A config.celery_app worker -l info
celery -A config.celery_app worker -B -l warning
```
Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right.
made with [cookiecutter-django](https://github.com/Alexander-D-Karpov/cookiecutter-django)

View File

@ -61,8 +61,6 @@ def check_temperature():
"user": route.user,
"route": route,
"alerts": alerts,
# TODO: change to frontend link
"link": f"http://127.0.0.1:8000/path/{route.id}/change",
}
email_plaintext_message = render_to_string("weather_alert.txt", context)

View File

@ -5,4 +5,3 @@
- {{ alert }}
{% endfor %}
Вы можете изменить маршрут по ссылке: {{ link }}