This commit is contained in:
r0mchik 2025-05-26 19:27:32 +07:00
parent 19bdf80a04
commit 906082577c
5 changed files with 36 additions and 29 deletions

5
.gitignore vendored
View File

@ -1,3 +1,6 @@
.env
__pycache__
venv
venv
--cached
media
web/logs

View File

@ -8,7 +8,7 @@ services:
volumes:
- .:/app
- ./media:/app/media
- ./static:/app/staticfiles
- ./web/staticfiles:/app/web/staticfiles
# - ./media:/app/media
ports:
- "8000:8000"

View File

@ -7,14 +7,11 @@ services:
volumes:
- .:/app
- ./media:/app/media
- ./static:/app/staticfiles
- ./web/staticfiles:/app/staticfiles
# - ./media:/app/media
ports:
- "8106:8106"
expose:
- 8000
depends_on:
- redis
# - vpn
@ -43,14 +40,12 @@ services:
# ports:
# - "80:80"
# volumes:
# - ./static:/home/app/static
# # - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# # - ./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf
# - ./nginx/nginx/conf.d/nginx.conf:/etc/nginx/conf.d/nginx.conf
# depends_on:
# - web
# restart: always
# restart: always
redis:

View File

@ -17,6 +17,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
WORKDIR /app/web
RUN cd /app/web && mkdir logs
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .

View File

@ -129,7 +129,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = '/staticfiles/'
STATIC_URL = 'staticfiles'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
# Default primary key field type
@ -148,21 +148,28 @@ CHANNEL_LAYERS = {
},
}
# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'WARNING',
# 'class': 'logging.FileHandler',
# 'filename': '/app/logs/django.log',
# },
# },
# 'loggers': {
# 'django': {
# 'handlers': ['file'],
# 'level': 'WARNING',
# 'propagate': True,
# },
# },
# }
LOGGING = {
'version': 1,
'disable_existing_loggers': False, # чтобы не отключать встроенные логи Django
'formatters': {
'simple': {
'format': '[{levelname}] {asctime} {name}: {message}',
'style': '{',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'simple',
},
'file': {
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR,'logs', 'django.log'),
'formatter': 'simple',
},
},
'root': {
'handlers': ['console', 'file'],
'level': 'INFO',
},
}