add new api

This commit is contained in:
behruz-dev
2025-08-25 15:56:09 +05:00
parent 74ecc581ae
commit 30e0e3462f
15 changed files with 108 additions and 61 deletions

View File

@@ -0,0 +1,3 @@
from .celery import app as celery_app
__all__ = ['celery_app']

View File

@@ -1,11 +1,10 @@
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.base')
app = Celery('config')
app = Celery('config', broker="redis://redis:6379", backend="redis://redis:6379")
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

View File

@@ -1,6 +1,9 @@
from django.conf import settings
CELERY_BROKER_URL = 'redis://redis:6379/0'
CELERY_BROKER_URL = 'redis://redis:6379'
CELERY_RESULT_BACKEND = "redis://redis:6379"
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_TIMEZONE = settings.TIME_ZONE
CELERY_TIMEZONE = settings.TIME_ZONE
CELERY_ENABLED = True

View File

@@ -25,13 +25,13 @@ JAZZMIN_SETTINGS = {
"show_sidebar": True,
"navigation_expanded": True,
"hide_apps": [],
"hide_models": ["auth.Group"],
"hide_models": ["auth.Group"],
"order_with_respect_to": ["auth"],
"custom_links": {
"books": [{
"name": "Make Messages",
"url": "make_messages",
"name": "Make Messages",
"url": "make_messages",
"icon": "fas fa-comments",
"permissions": ["books.view_book"]
}]
@@ -45,11 +45,10 @@ JAZZMIN_SETTINGS = {
"default_icon_parents": "fas fa-chevron-circle-right",
"default_icon_children": "fas fa-circle",
"related_modal_active": True,
"use_google_fonts_cdn": True,
"show_ui_builder": False,
"changeform_format": "collapsible",
"language_chooser": False,
}
}

View File

@@ -1,7 +1,7 @@
CACHES = {
"default": {
"BACKEND": 'django_redis.cache.RedisCache',
"LOCATION": 'redis://redis:6379',
"LOCATION": 'redis://redis:6379z',
"TIMEOUT": 300,
},
}

View File

@@ -38,7 +38,6 @@ PACKAGES = [
'rest_framework_simplejwt',
'corsheaders',
'cacheops',
# 'silk',
]
DJANGO_APPS = [
@@ -100,7 +99,6 @@ DATABASES = {
'PASSWORD': env.str('POSTGRES_PASSWORD'),
'HOST': env.str('POSTGRES_HOST'),
'PORT': env.str('POSTGRES_PORT'),
'CONN_MAX_AGE': 0
}
}
@@ -159,5 +157,5 @@ from config.conf.logs import *
from config.conf.cors_headers import *
from config.conf.drf_yasg import *
from config.conf.jazzmin import *
from config.conf.redis import *
from config.conf.celery import *
from config.conf.celery import *
from config.conf.redis import *