check this one out

https://forum.djangoproject.com/t/tutorial-how-to-combine-frontend-and-backend-for-python-web-developers/15214

On Wednesday, August 23, 2023 at 6:50:22 AM UTC-5 Muhammad Juwaini Abdul 
Rahman wrote:

> Please delete this. You just exposed your DB host, name, and password.
>
> On Wed, 23 Aug 2023 at 17:58, Kani Sbt <[email protected]> wrote:
>
>> HI sir , 
>> Please Help me to how to solve this problem , 
>>
>>
>> this is settings.py :
>> import os
>> from pathlib import Path
>> from datetime import timedelta
>>
>> BASE_DIR = Path(__file__).resolve().parent.parent
>>
>>
>> SECRET_KEY = 
>> 'django-insecure-ihofv8tmht)!q**8efqqr1t+#(a&a$71s080zs^x*s#w5#sx!4'
>>
>> DEBUG = True
>>
>> ALLOWED_HOSTS = ['*']
>>
>>
>> # Application definition
>> THIRD_PARTY_APPS = (
>>     'django.contrib.admin',
>>     'django.contrib.auth',
>>     'django.contrib.contenttypes',
>>     'django.contrib.sessions',
>>     'django.contrib.messages',
>>     'django.contrib.staticfiles',
>>     'rest_framework',
>>     'corsheaders',
>>     'rest_framework.authtoken',
>>     'rest_framework_simplejwt.token_blacklist',
>>     'drf_yasg',
>>     'import_export', # import and export db data
>>
>>     'django_crontab', # periodical task trigger
>>     'dbbackup',  # django-dbbackup
>>     'django_celery_beat',
>>     'django_extensions',
>>     # 'storages',
>>     # 'gdstorage'
>>     
>>     
>> )
>>
>> OUR_APPS = (
>>     'employee',
>>     'configuration',
>>     'attendance',
>>     'audit',
>>     'master',
>> )
>>
>> INSTALLED_APPS = OUR_APPS + THIRD_PARTY_APPS
>>
>> MIDDLEWARE = [
>>     'server.middleware.UserIpMiddleware',
>>     'django.middleware.security.SecurityMiddleware',
>>     'django.contrib.sessions.middleware.SessionMiddleware',
>>     "corsheaders.middleware.CorsMiddleware",
>>     'django.middleware.common.CommonMiddleware',
>>     'django.middleware.csrf.CsrfViewMiddleware',
>>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>>     'django.contrib.messages.middleware.MessageMiddleware',
>>     'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> ]
>>
>> ROOT_URLCONF = 'server.urls'
>>
>> TEMPLATES = [
>>     {
>>         'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>         'DIRS': [BASE_DIR / 'templates'],
>>         'APP_DIRS': True,
>>         'OPTIONS': {
>>             'context_processors': [
>>                 'django.template.context_processors.debug',
>>                 'django.template.context_processors.request',
>>                 'django.contrib.auth.context_processors.auth',
>>                 'django.contrib.messages.context_processors.messages',
>>             ],
>>         },
>>     },
>> ]
>>
>> # WSGI_APPLICATION = 'server.wsgi.application'
>> ASGI_APPLICATION = 'server.asgi.application'
>>
>> DATABASES = {
>>     'default': {
>>         'ENGINE': 'django.db.backends.sqlite3',
>>         'NAME': 'sbthrmodule_y0ltln',
>>          'USER': 'sbthrmodule_mmsv7',
>>         'PASSWORD': '17mBxjt6sercIAyw',
>>         'HOST': 'localhost',
>>         'PORT': '3306',
>>     },
>>     'attendance_db': {
>>         'ENGINE': 'django.db.backends.mysql',
>>         'NAME': 'skylab',
>>         'USER': 'admin',
>>         'PASSWORD': 'kJsgwek8488!ghf^$%',
>>         'HOST': 'spt-hrm-db.cdhbi944avx7.ap-south-1.rds.amazonaws.com',
>>         'PORT': '3306',
>>     },
>> }
>>
>>
>> AUTH_PASSWORD_VALIDATORS = [
>>     {
>>         'NAME': 
>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>>     },
>>     {
>>         'NAME': 
>> 'django.contrib.auth.password_validation.MinimumLengthValidator',
>>     },
>>     {
>>         'NAME': 
>> 'django.contrib.auth.password_validation.CommonPasswordValidator',
>>     },
>>     {
>>         'NAME': 
>> 'django.contrib.auth.password_validation.NumericPasswordValidator',
>>     },
>> ]
>>
>>
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE =  'UTC'
>>
>> USE_I18N = True
>>
>> USE_TZ = True
>>
>>
>>
>> STATIC_URL = '/static/'
>> MEDIA_URL = '/media/'
>> # STATICFILES_DIRS = os.path.join(BASE_DIR, "static"),
>>
>> if DEBUG:
>>     STATIC_ROOT = os.path.join(BASE_DIR,'static')
>>     MEDIA_ROOT =  os.path.join(BASE_DIR, 'media') 
>> else:
>>     STATIC_ROOT = '/var/www/server/static/'
>>     MEDIA_ROOT =  '/var/www/server/media/' 
>>
>> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>> AUTH_USER_MODEL = 'configuration.User'
>>
>> CORS_ORIGIN_ALLOW_ALL = True
>> CORS_ORIGIN_WHITELIST = (
>>     'http://localhost:3000',
>>     'http://127.0.0.1:3000',
>>     'https://sbthrmodule.in',
>>     "https://sbthrmodule.in";,
>>     'http://hrmodule.sbthrmodule.in:8084',
>>    'http://hrmodule.sbthrmodule.in:8084',
>>     'http://127.0.0.1:8000',
>> )
>> # CORS_ALLOW_CREDENTIALS = True
>>
>> CSRF_TRUSTED_ORIGINS = ['http://127.0.0.1:8000',"http://localhost:3000";,'
>> https://sbthrmodule.in',
>>     "https://sbthrmodule.in";,
>>     'http://hrmodule.sbthrmodule.in/',
>>     "http://hrmodule.sbthrmodule.in/","http://127.0.0.1:3000";]
>>
>> REST_FRAMEWORK = {
>>     'DEFAULT_AUTHENTICATION_CLASSES': [
>>         'rest_framework.authentication.TokenAuthentication',
>>     ],
>>     'DEFAULT_RENDERER_CLASSES': [
>>         "rest_framework.renderers.JSONRenderer",
>>         "rest_framework.renderers.BrowsableAPIRenderer",
>>     ],
>>     'DEFAULT_PAGINATION_CLASS': 
>> 'rest_framework.pagination.PageNumberPagination',
>>     'PAGE_SIZE': 10,
>> }
>>
>>
>> SIMPLE_JWT = {
>>     'ACCESS_TOKEN_LIFETIME': timedelta(minutes=30),
>>     'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
>>     'ROTATE_REFRESH_TOKENS': True,
>>     'BLACKLIST_AFTER_ROTATION': True,
>>     'AUTH_HEADER_TYPES': ('Bearer','Token', ),
>>     'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken', 
>> ),
>> }
>>
>> EMAIL_ACTIVE = False
>> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
>> EMAIL_HOST_USER = ''
>> EMAIL_HOST_PASSWORD = ''
>> EMAIL_HOST = 'smtp.gmail.com'
>> EMAIL_USE_TLS = True
>>
>> # celery settings
>>
>> CELERY_BROKER_URL = 'redis://127.0.0.1:6379'
>> CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379'
>> CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
>>
>> # redis
>>
>> CHANNEL_LAYERS = {
>>     'default': {
>>         'BACKEND': 'channels_redis.core.RedisChannelLayer',
>>         'CONFIG': {
>>             'hosts': [('127.0.0.1', 6379)],
>>         },
>>     }
>> }
>>
>> # LOGGING = {
>> #     'version': 1,
>> #     'disable_existing_loggers': False,
>> #     'handlers': {
>> #         'file': {
>> #             'level': 'DEBUG',
>> #             'class': 'logging.FileHandler',
>> #             'filename': 'logfile.log',
>> #         },
>> #     },
>> #     'loggers': {
>> #         'django': {
>> #             'handlers': ['file'],
>> #             'level': 'DEBUG',
>> #             'propagate': True,
>> #         },
>> #     },
>> #     'formatters': {
>> #         'standard': {
>> #             'format': '%(asctime)s [%(levelname)s] %(name)s 
>> [%(filename)s:%(lineno)s] [%(process)d] [%(thread)d] [%(user_ip)s] 
>> %(message)s',
>> #             'datefmt': '%Y-%m-%d %H:%M:%S',
>> #         },
>> #     },
>> # }
>>
>>
>> # Configure the database backup settings
>> # DBBACKUP_STORAGE = 'storages.backends.googledrive.GoogleDriveStorage'
>> # DBBACKUP_GOOGLE_DRIVE_CLIENT_ID = '
>> 470509872192-436kvee5qjlj8qht6dgopad7d4lvh4tc.apps.googleusercontent.com'
>> # DBBACKUP_GOOGLE_DRIVE_CLIENT_SECRET_FILE = 'client.json'
>> # DBBACKUP_FILENAME_TEMPLATE = '{datetime}.{extension}'
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3121fa93-f287-45ed-a8ff-bd0e2aadb167n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3121fa93-f287-45ed-a8ff-bd0e2aadb167n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84eb0552-1335-4496-a1a5-cd9af41d9546n%40googlegroups.com.

Reply via email to