Skip to content

Commit

Permalink
pre-realease6
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegGsk committed Sep 28, 2024
1 parent 83a9f17 commit fa2d1db
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/prod_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- feature/convert_ci-cd_to_the_prod

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/core/config/dev_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base_settings import *
from . base_settings import *

ROOT_DIR = BASE_DIR.parent

Expand Down
78 changes: 78 additions & 0 deletions adaptive_hockey_federation/core/config/prod_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from .base_settings import *

ROOT_DIR = BASE_DIR.parent

env.read_env(ROOT_DIR / ".env")

INTERNAL_IPS = [
"127.0.0.1",
]

DATABASES = {
"default": {
"ENGINE": env("DB_ENGINE", default="django.db.backends.postgresql"),
"NAME": env("POSTGRES_DB", default="postgres_db"),
"USER": env("POSTGRES_USER", default="postgres_user"),
"PASSWORD": env("POSTGRES_PASSWORD", default="postgres_password"),
"HOST": env("DB_HOST", default="localhost"),
"PORT": env("DB_PORT", default="5432"),
}
}

FIXSTURES_DIR = BASE_DIR / "core" / "fixtures"
JSON_PARSER_FILE = "data.json"
FIXSTURES_FILE = FIXSTURES_DIR / JSON_PARSER_FILE
RESOURSES_ROOT = BASE_DIR / "resourses"

# Важен порядок ключей для вставки/удаления
FILE_MODEL_MAP = {
"main_player_team": "Player",
"main_player": "Player",
"main_team": "Team",
"main_staffteammember": "StaffTeamMember",
"main_staffmember": "StaffMember",
"main_city": "City",
"main_diagnosis": "Diagnosis",
"main_nosology": "Nosology",
"main_disciplinelevel": "DisciplineLevel",
"main_disciplinename": "DisciplineName",
}

EMAIL_BACKEND = env.str(
"EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend"
)

EMAIL_TEMPLATE_NAME = "emailing/email.html"

EMAIL_HOST = env.str("EMAIL_HOST", default="smtp.yandex.ru")

try:
EMAIL_PORT = env.int("EMAIL_PORT", default=587)
except ValueError:
EMAIL_PORT = 587

EMAIL_HOST_USER = env.str("EMAIL_HOST_USER", default="example@yandex.ru")

EMAIL_HOST_PASSWORD = env.str("EMAIL_HOST_PASSWORD", default="password")

EMAIL_USE_TLS = env.str("EMAIL_USE_TLS", default=True)

DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

SERVER_EMAIL = EMAIL_HOST_USER

EMAIL_ADMIN = EMAIL_HOST_USER

ADMIN_PAGE_ORDERING = {
"main": [
"Player",
"Team",
"StaffMember",
"DisciplineName",
"DisciplineLevel",
"City",
"Nosology",
"Diagnosis",
"GameDataPlayer",
],
}
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.config.dev_settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.config.prod_settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion infra/prod/docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
- VALIDATION=http
- STAGING=${ST}
volumes:
- ../nginx/default.conf:/config/nginx/site-confs/default.conf
- ../nginx/nginx_stage.conf:/config/nginx/site-confs/default.conf
- swag_volume_stage:/config
- static_value:/var/html/static/
- ../../media:/var/html/media/
Expand Down

0 comments on commit fa2d1db

Please sign in to comment.