update to django 3.0 & asgi

This commit is contained in:
2019-11-25 22:37:01 +03:00
parent 3f689da8ac
commit ec8f60876a
20 changed files with 259 additions and 86 deletions

16
config/asgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
ASGI config for config.settings project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0-rc1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
application = get_asgi_application()

View File

@@ -8,8 +8,6 @@ app = Celery('telegram_bots')
app.config_from_object({
'broker_url': 'redis://127.0.0.1:6379/4',
'result_backend': 'django-db',
'beat_scheduler': 'django_celery_beat.schedulers:DatabaseScheduler',
'worker_concurrency': 4,
'ONCE': {
'backend': 'celery_once.backends.Redis',

View File

@@ -21,8 +21,6 @@ INSTALLED_APPS = [
'bootstrap4',
'crispy_forms',
'djconfig',
'django_celery_results',
'django_celery_beat',
'django.contrib.admin',
'django.contrib.auth',
@@ -93,10 +91,18 @@ STATICFILES_FINDERS = [
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/4",
"BACKEND": "redis_cache.RedisCache",
"LOCATION": ["127.0.0.1:6379"],
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
'DB': 4,
'PARSER_CLASS': 'redis.connection.HiredisParser',
'CONNECTION_POOL_CLASS': 'redis.BlockingConnectionPool',
'CONNECTION_POOL_CLASS_KWARGS': {
'max_connections': 50,
'timeout': 20,
},
'MAX_CONNECTIONS': 1000,
'PICKLE_VERSION': -1,
}
}
}