mirror of
https://github.com/task-17-lct/backend.git
synced 2025-02-20 07:30:32 +03:00
updated readme, docker
This commit is contained in:
parent
ac467f498e
commit
ae6dd136d6
|
@ -1,4 +1,4 @@
|
||||||
orconfig
|
.editorconfig
|
||||||
.gitattributes
|
.gitattributes
|
||||||
.github
|
.github
|
||||||
.gitignore
|
.gitignore
|
||||||
|
@ -6,6 +6,7 @@ orconfig
|
||||||
.idea
|
.idea
|
||||||
.pre-commit-config.yaml
|
.pre-commit-config.yaml
|
||||||
.readthedocs.yml
|
.readthedocs.yml
|
||||||
.travis.yml
|
|
||||||
venv
|
venv
|
||||||
data
|
data
|
||||||
|
data.json
|
||||||
|
parsers
|
||||||
|
|
17
.envs/.local/.django
Normal file
17
.envs/.local/.django
Normal 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
7
.envs/.local/.postgres
Normal 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
16
.envs/.production/.django
Normal 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
|
7
.envs/.production/.postgres
Normal file
7
.envs/.production/.postgres
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# PostgreSQL
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
POSTGRES_HOST=postgres
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
POSTGRES_DB=passfinder
|
||||||
|
POSTGRES_USER=debug
|
||||||
|
POSTGRES_PASSWORD=debug
|
15
README.md
15
README.md
|
@ -1,8 +1,16 @@
|
||||||
# Pass Finder
|
# Pass Finder
|
||||||
|
[Логика проекта и структура данных](https://www.figma.com/file/2De9jBDhNbFg8ScjKGmorY/Untitled?type=whiteboard&node-id=0%3A1&t=NGIe9sKMeVjNiK9j-1)
|
||||||
|
|
||||||
## Basic Commands
|
## 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
|
### Runserver
|
||||||
|
|
||||||
$ ./manage.py runserver_plus
|
$ ./manage.py runserver_plus
|
||||||
|
@ -30,11 +38,8 @@ This app comes with Celery.
|
||||||
To run a celery worker:
|
To run a celery worker:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
cd passfinder
|
celery -A config.celery_app worker -B -l warning
|
||||||
celery -A config.celery_app worker -l info
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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)
|
made with [cookiecutter-django](https://github.com/Alexander-D-Karpov/cookiecutter-django)
|
||||||
|
|
|
@ -61,8 +61,6 @@ def check_temperature():
|
||||||
"user": route.user,
|
"user": route.user,
|
||||||
"route": route,
|
"route": route,
|
||||||
"alerts": alerts,
|
"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)
|
email_plaintext_message = render_to_string("weather_alert.txt", context)
|
||||||
|
|
|
@ -5,4 +5,3 @@
|
||||||
- {{ alert }}
|
- {{ alert }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
Вы можете изменить маршрут по ссылке: {{ link }}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user