Browse Source

update settings - login redirect url, static/media roots, custom print setting,

Mohammed Khan 1 year ago
parent
commit
86fceeacad

+ 1 - 1
backend/UnTube/settings/allauth.py

@@ -3,7 +3,7 @@ Django AllAuth package related settings
 """
 
 SITE_ID = 2  # increment/decrement site ID as necessary
-LOGIN_REDIRECT_URL = '/'
+LOGIN_REDIRECT_URL = '/home/'
 LOGOUT_REDIRECT_URL = '/'
 
 # Additional configuration settings

+ 15 - 13
backend/UnTube/settings/base.py

@@ -22,23 +22,21 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
-
     'django.contrib.humanize',  # A set of Django template filters useful for adding a “human touch” to data.
-
     'django.contrib.sites',
+
+    'crispy_forms',
+    'import_export',
     'allauth',
     'allauth.account',
     'allauth.socialaccount',
     'allauth.socialaccount.providers.google',  # specifies google as OAuth provider
 
-    'crispy_forms',
-    'backend.users',  # has stuff related to user management in it (login, signup, show homepage, import)
-    'backend.main',  # main app, shows user their homepage
-    'backend.manage_playlists',
-    'backend.charts',
-    'backend.search',
-
-    'import_export',
+    'backend.users.apps.UsersConfig',  # has stuff related to user management in it (login, signup, show homepage, import)
+    'backend.main.apps.MainConfig',  # main app, shows user their homepage
+    'backend.manage_playlists.apps.ManagePlaylistsConfig',
+    'backend.charts.apps.ChartsConfig',
+    'backend.search.apps.SearchConfig',
 ]
 
 MIDDLEWARE = [
@@ -56,7 +54,8 @@ ROOT_URLCONF = 'backend.UnTube.urls'  # path to the urls.py file in root UnTube
 TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [BASE_DIR / 'backend', BASE_DIR / 'backend' / 'templates'],  # type: ignore
+        'DIRS': [BASE_DIR / 'backend' / 'templates'],  # type: ignore
+        # 'DIRS': [BASE_DIR / 'backend', BASE_DIR / 'backend' / 'templates'],
         # 'DIRS': [os.path.join(BASE_DIR, "templates")],
         'APP_DIRS': True,
         'OPTIONS': {
@@ -120,12 +119,15 @@ USE_TZ = True
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/3.2/howto/static-files/
 STATIC_URL = '/static/'
-STATIC_ROOT = BASE_DIR / 'backend' / 'static'  # type: ignore
+STATIC_ROOT = BASE_DIR / 'staticfiles'  # type: ignore
 # STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
+STATICFILES_DIRS = (
+    BASE_DIR / 'backend' / 'main',  # type: ignore
+)
 
 # Default primary key field type
 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
 DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 
 MEDIA_URL = '/media/'
-MEDIA_ROOT = BASE_DIR / 'backend' / 'media'  # type: ignore
+MEDIA_ROOT = BASE_DIR / 'media'  # type: ignore

+ 1 - 0
backend/UnTube/settings/templates/settings.dev.py

@@ -1,5 +1,6 @@
 DEBUG = True
 SECRET_KEY = "django-insecure-ycs22y+20sq67y(6dm6ynqw=dlhg!)%vuqpd@$p6rf3!#1h$u="
+ENABLE_PRINT_STATEMENTS = False
 
 SITE_ID = 2  # increment/decrement site ID as necessary