gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
8
config/conf/__init__.py
Executable file
8
config/conf/__init__.py
Executable file
@@ -0,0 +1,8 @@
|
||||
from . import apps # noqa
|
||||
from .cache import * # noqa
|
||||
from .ckeditor import * # noqa
|
||||
from .cron import * # noqa
|
||||
from .jazzmin import * # noqa
|
||||
from .jwt import * # noqa
|
||||
from .logs import * # noqa
|
||||
from .rest_framework import * # noqa
|
||||
24
config/conf/apps.py
Normal file
24
config/conf/apps.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#####################
|
||||
# My Settings
|
||||
#####################
|
||||
INSTALLED_APPS = [
|
||||
"rest_framework",
|
||||
"corsheaders",
|
||||
"django_filters",
|
||||
"rosetta",
|
||||
"django_redis",
|
||||
"rest_framework_simplejwt",
|
||||
"drf_yasg",
|
||||
"crispy_forms",
|
||||
"import_export",
|
||||
"django_ckeditor_5",
|
||||
"polymorphic",
|
||||
#####################
|
||||
# My apps
|
||||
#####################
|
||||
"core.apps.home.apps.HomeConfig",
|
||||
"core.http.HttpConfig",
|
||||
"core.apps.accounts.apps.AccountsConfig",
|
||||
"core.console.ConsoleConfig",
|
||||
"core.apps.eggs.apps.EggsConfig",
|
||||
]
|
||||
11
config/conf/cache.py
Executable file
11
config/conf/cache.py
Executable file
@@ -0,0 +1,11 @@
|
||||
from common.env import env
|
||||
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": env("CACHE_BACKEND"),
|
||||
"LOCATION": env("REDIS_URL"),
|
||||
"TIMEOUT": env("CACHE_TIMEOUT"),
|
||||
},
|
||||
}
|
||||
|
||||
# CACHE_MIDDLEWARE_SECONDS = env("CACHE_TIMEOUT")
|
||||
147
config/conf/ckeditor.py
Executable file
147
config/conf/ckeditor.py
Executable file
@@ -0,0 +1,147 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
STATIC_URL = "/static/"
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = os.path.join(Path().parent.parent, "media")
|
||||
|
||||
customColorPalette = [
|
||||
{"color": "hsl(4, 90%, 58%)", "label": "Red"},
|
||||
{"color": "hsl(340, 82%, 52%)", "label": "Pink"},
|
||||
{"color": "hsl(291, 64%, 42%)", "label": "Purple"},
|
||||
{"color": "hsl(262, 52%, 47%)", "label": "Deep Purple"},
|
||||
{"color": "hsl(231, 48%, 48%)", "label": "Indigo"},
|
||||
{"color": "hsl(207, 90%, 54%)", "label": "Blue"},
|
||||
]
|
||||
|
||||
CKEDITOR_5_CONFIGS = {
|
||||
"default": {
|
||||
"toolbar": [
|
||||
"heading",
|
||||
"|",
|
||||
"bold",
|
||||
"italic",
|
||||
"link",
|
||||
"bulletedList",
|
||||
"numberedList",
|
||||
"blockQuote",
|
||||
"imageUpload",
|
||||
],
|
||||
},
|
||||
"extends": {
|
||||
"blockToolbar": [
|
||||
"paragraph",
|
||||
"heading1",
|
||||
"heading2",
|
||||
"heading3",
|
||||
"|",
|
||||
"bulletedList",
|
||||
"numberedList",
|
||||
"|",
|
||||
"blockQuote",
|
||||
],
|
||||
"toolbar": [
|
||||
"heading",
|
||||
"|",
|
||||
"outdent",
|
||||
"indent",
|
||||
"|",
|
||||
"bold",
|
||||
"italic",
|
||||
"link",
|
||||
"underline",
|
||||
"strikethrough",
|
||||
"code",
|
||||
"subscript",
|
||||
"superscript",
|
||||
"highlight",
|
||||
"|",
|
||||
"codeBlock",
|
||||
"sourceEditing",
|
||||
"insertImage",
|
||||
"bulletedList",
|
||||
"numberedList",
|
||||
"todoList",
|
||||
"|",
|
||||
"blockQuote",
|
||||
"imageUpload",
|
||||
"|",
|
||||
"fontSize",
|
||||
"fontFamily",
|
||||
"fontColor",
|
||||
"fontBackgroundColor",
|
||||
"mediaEmbed",
|
||||
"removeFormat",
|
||||
"insertTable",
|
||||
],
|
||||
"image": {
|
||||
"toolbar": [
|
||||
"imageTextAlternative",
|
||||
"|",
|
||||
"imageStyle:alignLeft",
|
||||
"imageStyle:alignRight",
|
||||
"imageStyle:alignCenter",
|
||||
"imageStyle:side",
|
||||
"|",
|
||||
],
|
||||
"styles": [
|
||||
"full",
|
||||
"side",
|
||||
"alignLeft",
|
||||
"alignRight",
|
||||
"alignCenter",
|
||||
],
|
||||
},
|
||||
"table": {
|
||||
"contentToolbar": [
|
||||
"tableColumn",
|
||||
"tableRow",
|
||||
"mergeTableCells",
|
||||
"tableProperties",
|
||||
"tableCellProperties",
|
||||
],
|
||||
"tableProperties": {
|
||||
"borderColors": customColorPalette,
|
||||
"backgroundColors": customColorPalette,
|
||||
},
|
||||
"tableCellProperties": {
|
||||
"borderColors": customColorPalette,
|
||||
"backgroundColors": customColorPalette,
|
||||
},
|
||||
},
|
||||
"heading": {
|
||||
"options": [
|
||||
{
|
||||
"model": "paragraph",
|
||||
"title": "Paragraph",
|
||||
"class": "ck-heading_paragraph",
|
||||
},
|
||||
{
|
||||
"model": "heading1",
|
||||
"view": "h1",
|
||||
"title": "Heading 1",
|
||||
"class": "ck-heading_heading1",
|
||||
},
|
||||
{
|
||||
"model": "heading2",
|
||||
"view": "h2",
|
||||
"title": "Heading 2",
|
||||
"class": "ck-heading_heading2",
|
||||
},
|
||||
{
|
||||
"model": "heading3",
|
||||
"view": "h3",
|
||||
"title": "Heading 3",
|
||||
"class": "ck-heading_heading3",
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
"list": {
|
||||
"properties": {
|
||||
"styles": "true",
|
||||
"startIndex": "true",
|
||||
"reversed": "true",
|
||||
}
|
||||
},
|
||||
}
|
||||
0
config/conf/cron.py
Executable file
0
config/conf/cron.py
Executable file
127
config/conf/jazzmin.py
Executable file
127
config/conf/jazzmin.py
Executable file
@@ -0,0 +1,127 @@
|
||||
from typing import Any
|
||||
|
||||
JAZZMIN_SETTINGS: dict[str | Any, str | None | Any] = {
|
||||
"site_title": "Felix IT Solution",
|
||||
"site_header": "Felix IT Solution",
|
||||
"site_brand": "Felix IT Solution",
|
||||
"site_logo": "/images/logo.png",
|
||||
"login_logo": None,
|
||||
"login_logo_dark": None,
|
||||
"site_logo_classes": "img-circle",
|
||||
"site_icon": None,
|
||||
"welcome_sign": "Felix IT Solution",
|
||||
"copyright": "Felix IT Solution LLC",
|
||||
"search_model": ["auth.User"],
|
||||
"user_avatar": None,
|
||||
"topmenu_links": [
|
||||
{
|
||||
"name": "Home",
|
||||
"url": "admin:index",
|
||||
"permissions": ["auth.view_user"],
|
||||
},
|
||||
{
|
||||
"name": "Support",
|
||||
"url": "https://github.com/farridav/django-jazzmin/issues",
|
||||
"new_window": True,
|
||||
},
|
||||
{"model": "auth.User"},
|
||||
{"app": "books"},
|
||||
],
|
||||
"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": [],
|
||||
"order_with_respect_to": ["auth", "books", "books.author", "books.book"],
|
||||
"custom_links": {
|
||||
"books": [
|
||||
{
|
||||
"name": "Make Messages",
|
||||
"url": "make_messages",
|
||||
"icon": "fas fa-comments",
|
||||
"permissions": ["books.view_book"],
|
||||
}
|
||||
]
|
||||
},
|
||||
"icons": {
|
||||
"http.Comment": "fas fa-comments",
|
||||
"http.FrontendTranslation": "fas fa-globe",
|
||||
"http.Post": "fas fa-bars",
|
||||
"http.User": "fas fa-user",
|
||||
"http.Tags": "fas fa-tag",
|
||||
"http.SmsConfirm": "fas fa-comments",
|
||||
"auth.Group": "fas fa-users",
|
||||
"eggs.Courier": "fas fa-user-tie",
|
||||
"eggs.CourierHistory": "fas fa-history",
|
||||
"eggs.CourierProduct": "fas fa-envelope-open-text",
|
||||
"eggs.Group": "fas fa-users",
|
||||
"eggs.Party": "fas fa-person-booth",
|
||||
"eggs.Product": "fas fa-egg",
|
||||
"eggs.Invoice": "fas fa-envelope-open-text",
|
||||
"eggs.Location": "fas fa-location-arrow",
|
||||
"eggs.Market": "fas fa-store",
|
||||
"eggs.Order": "fas fa-envelope-open-text",
|
||||
"eggs.OrderItems": "fas fa-object-group",
|
||||
"eggs.Broken": "fas fa-trash-alt",
|
||||
"eggs.Debt": "fas fa-hand-holding-usd",
|
||||
"eggs.History": "fas fa-history",
|
||||
"eggs.AllHistory": "fas fa-history",
|
||||
"eggs.AdditionalCost": "fas fa-money-bill-wave",
|
||||
"eggs.Sklad": "fas fa-warehouse",
|
||||
"eggs.Monitoring": "fas fa-chart-line",
|
||||
"eggs.Notification": "fas fa-bell",
|
||||
},
|
||||
"default_icon_parents": "fas fa-chevron-circle-right",
|
||||
"default_icon_children": "fas fa-circle",
|
||||
"related_modal_active": False,
|
||||
"custom_css": "css/jazzmin.css",
|
||||
"custom_js": None,
|
||||
"use_google_fonts_cdn": True,
|
||||
"show_ui_builder": False,
|
||||
"changeform_format": "horizontal_tabs",
|
||||
"changeform_format_overrides": {
|
||||
"auth.user": "collapsible",
|
||||
"auth.group": "vertical_tabs",
|
||||
},
|
||||
"language_chooser": True,
|
||||
}
|
||||
|
||||
JAZZMIN_UI_TWEAKS = {
|
||||
"navbar_small_text": False,
|
||||
"footer_small_text": False,
|
||||
"body_small_text": True,
|
||||
"brand_small_text": False,
|
||||
"brand_colour": "navbar-navy",
|
||||
"accent": "accent-primary",
|
||||
"navbar": "navbar-navy navbar-dark",
|
||||
"no_navbar_border": False,
|
||||
"navbar_fixed": True,
|
||||
"layout_boxed": False,
|
||||
"footer_fixed": False,
|
||||
"sidebar_fixed": True,
|
||||
"sidebar": "sidebar-dark-navy",
|
||||
"sidebar_nav_small_text": False,
|
||||
"sidebar_disable_expand": False,
|
||||
"sidebar_nav_child_indent": False,
|
||||
"sidebar_nav_compact_style": True,
|
||||
"sidebar_nav_legacy_style": False,
|
||||
"sidebar_nav_flat_style": False,
|
||||
"theme": "minty",
|
||||
"dark_mode_theme": None,
|
||||
"button_classes": {
|
||||
"primary": "btn-outline-primary",
|
||||
"secondary": "btn-outline-secondary",
|
||||
"info": "btn-outline-info",
|
||||
"warning": "btn-warning",
|
||||
"danger": "btn-danger",
|
||||
"success": "btn-success",
|
||||
},
|
||||
"actions_sticky_top": False,
|
||||
}
|
||||
37
config/conf/jwt.py
Executable file
37
config/conf/jwt.py
Executable file
@@ -0,0 +1,37 @@
|
||||
from datetime import timedelta
|
||||
|
||||
from common.env import env
|
||||
|
||||
SIMPLE_JWT = {
|
||||
"ACCESS_TOKEN_LIFETIME": timedelta(days=30),
|
||||
"REFRESH_TOKEN_LIFETIME": timedelta(days=365),
|
||||
"ROTATE_REFRESH_TOKENS": False,
|
||||
"BLACKLIST_AFTER_ROTATION": False,
|
||||
"UPDATE_LAST_LOGIN": False,
|
||||
"ALGORITHM": "HS256",
|
||||
"SIGNING_KEY": env("DJANGO_SECRET_KEY"),
|
||||
"VERIFYING_KEY": "",
|
||||
"AUDIENCE": None,
|
||||
"ISSUER": None,
|
||||
"JSON_ENCODER": None,
|
||||
"JWK_URL": None,
|
||||
"LEEWAY": 0,
|
||||
"AUTH_HEADER_TYPES": ("Bearer",),
|
||||
"AUTH_HEADER_NAME": "HTTP_AUTHORIZATION",
|
||||
"USER_ID_FIELD": "id",
|
||||
"USER_ID_CLAIM": "user_id",
|
||||
"USER_AUTHENTICATION_RULE": "rest_framework_simplejwt.authentication.default_user_authentication_rule",
|
||||
"AUTH_TOKEN_CLASSES": ("rest_framework_simplejwt.tokens.AccessToken",),
|
||||
"TOKEN_TYPE_CLAIM": "token_type",
|
||||
"TOKEN_USER_CLASS": "rest_framework_simplejwt.models.TokenUser",
|
||||
"JTI_CLAIM": "jti",
|
||||
"SLIDING_TOKEN_REFRESH_EXP_CLAIM": "refresh_exp",
|
||||
"SLIDING_TOKEN_LIFETIME": timedelta(days=30),
|
||||
"SLIDING_TOKEN_REFRESH_LIFETIME": timedelta(days=365),
|
||||
"TOKEN_OBTAIN_SERIALIZER": "rest_framework_simplejwt.serializers.TokenObtainPairSerializer",
|
||||
"TOKEN_REFRESH_SERIALIZER": "rest_framework_simplejwt.serializers.TokenRefreshSerializer",
|
||||
"TOKEN_VERIFY_SERIALIZER": "rest_framework_simplejwt.serializers.TokenVerifySerializer",
|
||||
"TOKEN_BLACKLIST_SERIALIZER": "rest_framework_simplejwt.serializers.TokenBlacklistSerializer",
|
||||
"SLIDING_TOKEN_OBTAIN_SERIALIZER": "rest_framework_simplejwt.serializers.TokenObtainSlidingSerializer",
|
||||
"SLIDING_TOKEN_REFRESH_SERIALIZER": "rest_framework_simplejwt.serializers.TokenRefreshSlidingSerializer",
|
||||
}
|
||||
7
config/conf/logs.py
Executable file
7
config/conf/logs.py
Executable file
@@ -0,0 +1,7 @@
|
||||
import logging
|
||||
|
||||
logging.basicConfig(
|
||||
filename=f"./logs/django.log",
|
||||
level=logging.DEBUG,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
)
|
||||
5
config/conf/rest_framework.py
Executable file
5
config/conf/rest_framework.py
Executable file
@@ -0,0 +1,5 @@
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user