quota, distribution, inventory entry, quota sale transaction, product informations, signals ,....

This commit is contained in:
2025-07-02 15:42:51 +03:30
parent 2f23c5104d
commit 279afba977
45 changed files with 1408 additions and 88 deletions

View File

@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
import os.path
from datetime import timedelta
from pathlib import Path
import sentry_sdk
from django.conf import settings
@@ -27,6 +28,22 @@ SECRET_KEY = 'django-insecure-@0apn-lk85pfw=z00x2ib$w9#rwz8%2v4i_n^^9jz-m9b+y55*
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
sentry_sdk.init(
dsn="https://e8d8ff4f1bf729370af00b7775be441c@o4509597964697600.ingest.us.sentry.io/4509597966073856",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
# Set profile_session_sample_rate to 1.0 to profile 100%
# of profile sessions.
profile_session_sample_rate=1.0,
# Set profile_lifecycle to "trace" to automatically
# run the profiler on when there is an active transaction
profile_lifecycle="trace",
)
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
@@ -131,16 +148,18 @@ AUTH_USER_MODEL = 'authentication.User'
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
'Bearer': {
'type': 'apiKey',
'name': 'Authorization',
'in': 'header'
"bearer": {
"type": "apiKey",
"name": "Authorization",
"in": "header",
"description": 'JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer <token>"',
},
'basic': { # <<-- is for djagno authentication
'type': 'basic'
},
},
'USE_SESSION_AUTH': True,
'USE_SESSION_AUTH': False,
"DEFAULT_AUTO_SCHEMA_CLASS": "drf_yasg.inspectors.SwaggerAutoSchema"
}
LOGIN_URL = 'rest_framework:login'
@@ -159,7 +178,7 @@ REST_FRAMEWORK = {
'django_filters.rest_framework.DjangoFilterBackend',
'rest_framework.filters.SearchFilter',
],
'EXCEPTION_HANDLER': 'apps.core.error_handler.custom_exception_handler',
# 'EXCEPTION_HANDLER': 'apps.core.error_handler.custom_exception_handler',
"DEFAULT_PAGINATION_CLASS": 'apps.core.pagination.CustomPageNumberPagination',
"PAGE_SIZE": 20,
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'

View File

@@ -38,5 +38,6 @@ urlpatterns = [
path('tag/', include('apps.tag.urls')),
path('search/', include('apps.search.urls')),
path('product/', include('apps.product.urls')),
path('warehouse/', include('apps.warehouse.urls')),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]