initial commit

This commit is contained in:
behruz-dev
2025-08-26 10:12:09 +05:00
commit 8feea731b9
55 changed files with 1066 additions and 0 deletions

4
config/conf/__init__.py Normal file
View File

@@ -0,0 +1,4 @@
from .rest_framework import *
from .jwt import *
from .jazzmin import *
from .cache import *

24
config/conf/cache.py Normal file
View File

@@ -0,0 +1,24 @@
CACHES = {
"default": {
"BACKEND": 'django_redis.cache.RedisCache',
"LOCATION": 'redis://redis:6379',
"TIMEOUT": 300,
},
}
CACHE_MIDDLEWARE_SECONDS = 300
CACHEOPS_REDIS = 'redis://redis:6379'
CACHEOPS_DEFAULTS = {
"timeout": 300,
}
CACHEOPS = {
"accounts.*": {
"ops": "all",
"timeout": 60 * 5,
},
}
CACHEOPS_DEGRADE_ON_FAILURE = True
CACHEOPS_ENABLED = True

55
config/conf/jazzmin.py Normal file
View File

@@ -0,0 +1,55 @@
JAZZMIN_SETTINGS = {
"site_title": "Avto Cargo Admin",
"site_header": "Avto Cargo",
"site_brand": "Avto Cargo",
"site_logo": None,
"login_logo": None,
"login_logo_dark": None,
"site_logo_classes": "img-circle",
"site_icon": None,
"welcome_sign": "Welcome to the Avto Cargo",
"copyright": "Acme Avto Cargo Ltd",
"search_model": ["auth.User"],
"user_avatar": None,
"topmenu_links": [
{"name": "Home", "url": "admin:index", "permissions": ["auth.view_user"]},
{"model": "auth.User"},
],
"usermenu_links": [
{"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
{"model": "auth.user"}
],
"show_sidebar": True,
"navigation_expanded": True,
"hide_apps": [],
"hide_models": ["auth.Group"],
"order_with_respect_to": ["auth"],
"custom_links": {
"books": [{
"name": "Make Messages",
"url": "make_messages",
"icon": "fas fa-comments",
"permissions": ["books.view_book"]
}]
},
"icons": {
"auth": "fas fa-users-cog",
"auth.user": "fas fa-user",
},
"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,
}

10
config/conf/jwt.py Normal file
View File

@@ -0,0 +1,10 @@
from datetime import timedelta
SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(days=5),
"REFRESH_TOKEN_LIFETIME": timedelta(days=90),
"ROTATE_REFRESH_TOKENS": True,
"BLACKLIST_AFTER_ROTATION": True,
"UPDATE_LAST_LOGIN": True,
}

View File

@@ -0,0 +1,12 @@
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
],
'DEFAULT_PARSER_CLASSES': [
'rest_framework.parsers.JSONParser',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework_simplejwt.authentication.JWTAuthentication',
]
}