Skip to content

Commit ab57d75

Browse files
committed
Update Configuration
1 parent 890c0e0 commit ab57d75

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

core/settings.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
https://docs.djangoproject.com/en/4.1/ref/settings/
1111
"""
1212

13+
import os, random, string
1314
from pathlib import Path
1415

1516
# Build paths inside the project like this: BASE_DIR / 'subdir'.
1617
BASE_DIR = Path(__file__).resolve().parent.parent
1718

18-
1919
# Quick-start development settings - unsuitable for production
2020
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
2121

@@ -25,8 +25,9 @@
2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
2727

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']
3031

3132
# Application definition
3233

@@ -37,6 +38,12 @@
3738
"django.contrib.sessions",
3839
"django.contrib.messages",
3940
"django.contrib.staticfiles",
41+
42+
# APPS
43+
"home",
44+
45+
# Util
46+
"debug_toolbar",
4047
]
4148

4249
MIDDLEWARE = [
@@ -47,14 +54,19 @@
4754
"django.contrib.auth.middleware.AuthenticationMiddleware",
4855
"django.contrib.messages.middleware.MessageMiddleware",
4956
"django.middleware.clickjacking.XFrameOptionsMiddleware",
57+
58+
# Util
59+
"debug_toolbar.middleware.DebugToolbarMiddleware",
5060
]
5161

5262
ROOT_URLCONF = "core.urls"
5363

64+
UI_TEMPLATES = os.path.join(BASE_DIR, 'templates')
65+
5466
TEMPLATES = [
5567
{
5668
"BACKEND": "django.template.backends.django.DjangoTemplates",
57-
"DIRS": [],
69+
"DIRS": [UI_TEMPLATES],
5870
"APP_DIRS": True,
5971
"OPTIONS": {
6072
"context_processors": [
@@ -117,6 +129,12 @@
117129

118130
STATIC_URL = "static/"
119131

132+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
133+
134+
STATICFILES_DIRS = (
135+
os.path.join(BASE_DIR, 'static'),
136+
)
137+
120138
# Default primary key field type
121139
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
122140

core/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
1616
from django.contrib import admin
17-
from django.urls import path
17+
from django.urls import path, include
1818

1919
urlpatterns = [
20+
path("", include("home.urls")),
2021
path("admin/", admin.site.urls),
22+
path("__debug__/", include("debug_toolbar.urls")),
2123
]

0 commit comments

Comments
 (0)