Skip to content

Commit

Permalink
Update Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
app-generator committed Jan 19, 2024
1 parent 890c0e0 commit ab57d75
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
26 changes: 22 additions & 4 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

import os, random, string
from pathlib import Path

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


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

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

ALLOWED_HOSTS = []

# Hosts Settings
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '.onrender.com', '0.0.0.0']
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']

# Application definition

Expand All @@ -37,6 +38,12 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",

# APPS
"home",

# Util
"debug_toolbar",
]

MIDDLEWARE = [
Expand All @@ -47,14 +54,19 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",

# Util
"debug_toolbar.middleware.DebugToolbarMiddleware",
]

ROOT_URLCONF = "core.urls"

UI_TEMPLATES = os.path.join(BASE_DIR, 'templates')

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [UI_TEMPLATES],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down Expand Up @@ -117,6 +129,12 @@

STATIC_URL = "static/"

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

Expand Down
4 changes: 3 additions & 1 deletion core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include

urlpatterns = [
path("", include("home.urls")),
path("admin/", admin.site.urls),
path("__debug__/", include("debug_toolbar.urls")),
]

0 comments on commit ab57d75

Please sign in to comment.