|
10 | 10 | https://docs.djangoproject.com/en/4.1/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
| 13 | +import os, random, string |
13 | 14 | from pathlib import Path |
14 | 15 |
|
15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
16 | 17 | BASE_DIR = Path(__file__).resolve().parent.parent |
17 | 18 |
|
18 | | - |
19 | 19 | # Quick-start development settings - unsuitable for production |
20 | 20 | # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ |
21 | 21 |
|
|
25 | 25 | # SECURITY WARNING: don't run with debug turned on in production! |
26 | 26 | DEBUG = True |
27 | 27 |
|
28 | | -ALLOWED_HOSTS = [] |
29 | | - |
| 28 | +# Hosts Settings |
| 29 | +ALLOWED_HOSTS = ['localhost', '127.0.0.1', '.onrender.com', '0.0.0.0'] |
| 30 | +CSRF_TRUSTED_ORIGINS = ['http://localhost:8000', 'http://localhost:5085', 'http://127.0.0.1:8000', 'http://127.0.0.1:5085', 'https://core-django.onrender.com'] |
30 | 31 |
|
31 | 32 | # Application definition |
32 | 33 |
|
|
37 | 38 | "django.contrib.sessions", |
38 | 39 | "django.contrib.messages", |
39 | 40 | "django.contrib.staticfiles", |
| 41 | + |
| 42 | + # APPS |
| 43 | + "home", |
| 44 | + |
| 45 | + # Util |
| 46 | + "debug_toolbar", |
40 | 47 | ] |
41 | 48 |
|
42 | 49 | MIDDLEWARE = [ |
|
47 | 54 | "django.contrib.auth.middleware.AuthenticationMiddleware", |
48 | 55 | "django.contrib.messages.middleware.MessageMiddleware", |
49 | 56 | "django.middleware.clickjacking.XFrameOptionsMiddleware", |
| 57 | + |
| 58 | + # Util |
| 59 | + "debug_toolbar.middleware.DebugToolbarMiddleware", |
50 | 60 | ] |
51 | 61 |
|
52 | 62 | ROOT_URLCONF = "core.urls" |
53 | 63 |
|
| 64 | +UI_TEMPLATES = os.path.join(BASE_DIR, 'templates') |
| 65 | + |
54 | 66 | TEMPLATES = [ |
55 | 67 | { |
56 | 68 | "BACKEND": "django.template.backends.django.DjangoTemplates", |
57 | | - "DIRS": [], |
| 69 | + "DIRS": [UI_TEMPLATES], |
58 | 70 | "APP_DIRS": True, |
59 | 71 | "OPTIONS": { |
60 | 72 | "context_processors": [ |
|
117 | 129 |
|
118 | 130 | STATIC_URL = "static/" |
119 | 131 |
|
| 132 | +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') |
| 133 | + |
| 134 | +STATICFILES_DIRS = ( |
| 135 | + os.path.join(BASE_DIR, 'static'), |
| 136 | +) |
| 137 | + |
120 | 138 | # Default primary key field type |
121 | 139 | # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field |
122 | 140 |
|
|
0 commit comments