docker fix

This commit is contained in:
Alexander Karpov 2023-01-03 10:58:52 +03:00
parent 49d29e127b
commit fb50713ecc
6 changed files with 13 additions and 17 deletions

View File

@ -1,6 +1,6 @@
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/akarpov
CELERY_BROKER_URL=redis://localhost:6379/0
REDIS_URL=redis://localhost:6379/1
REDIS_HOST=localhost
REDIS_CACHE=rediscache://localhost:6379/1
USE_DOCKER=no
EMAIL_HOST=127.0.0.1:8025

View File

@ -6,6 +6,7 @@ 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

View File

@ -55,4 +55,3 @@ jobs:
- name: Tear down the Stack
run: docker-compose -f local.yml down

View File

@ -56,14 +56,7 @@
# ------------------------------------------------------------------------------
CACHE_TTL = 60 * 1500
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": env.db("REDIS_URL"),
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient"},
"KEY_PREFIX": "example",
}
}
CACHES = {"default": env.cache("REDIS_CACHE")}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"
CACHEOPS_DEFAULTS = {"timeout": 60 * 60}
@ -73,11 +66,7 @@
"auth.permission": {"ops": "all"},
"*.*": {},
}
CACHEOPS_REDIS = {
"host": env.db("REDIS_HOST", default="redis"),
"port": 6379, # default redis port
"db": 1,
}
CACHEOPS_REDIS = env.str("REDIS_URL")
# URLS
# ------------------------------------------------------------------------------
@ -201,6 +190,7 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.middleware.cache.UpdateCacheMiddleware",
"corsheaders.middleware.CorsMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django_structlog.middlewares.RequestMiddleware",
@ -212,6 +202,11 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.common.BrokenLinkEmailsMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"cms.middleware.language.LanguageCookieMiddleware",
"cms.middleware.user.CurrentUserMiddleware",
"cms.middleware.page.CurrentPageMiddleware",
"cms.middleware.toolbar.ToolbarMiddleware",
"django.middleware.cache.FetchFromCacheMiddleware",
]
# STATIC

3
poetry.lock generated
View File

@ -196,6 +196,7 @@ click-plugins = ">=1.1.1"
click-repl = ">=0.2.0"
kombu = ">=5.2.3,<6.0"
pytz = ">=2021.3"
redis = {version = ">=3.4.1,<4.0.0 || >4.0.0,<4.0.1 || >4.0.1", optional = true, markers = "extra == \"redis\""}
vine = ">=5.0.0,<6.0"
[package.extras]
@ -2186,7 +2187,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
[metadata]
lock-version = "1.1"
python-versions = "^3.11"
content-hash = "e053f66444cdba0601b76b4df7fc989041a1f8aeaeceaf3ef9270fb8e93d7e82"
content-hash = "6758ffa352939b433d2b84408b087e8038e75762703b4831d7a2300c1fb69853"
[metadata.files]
alabaster = [

View File

@ -15,7 +15,7 @@ argon2-cffi = "^21.3.0"
whitenoise = "^6.2.0"
redis = "^4.4.0"
hiredis = "^2.1.0"
celery = "^5.2.7"
celery = {extras = ["redis"], version = "^5.2.7"}
django-celery-beat = "^2.4.0"
flower = "^1.2.0"
django = "^4.1.4"