some plumbing stuff
This commit is contained in:
parent
b367012d5c
commit
4c6732f9d0
6 changed files with 147 additions and 8 deletions
|
@ -1,4 +1,9 @@
|
|||
from pathlib import Path
|
||||
from environs import Env
|
||||
|
||||
env = Env()
|
||||
env.read_env()
|
||||
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
@ -11,9 +16,10 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||
SECRET_KEY = "django-insecure-$5nkma6cv^a58n4%4$nef2tp8u!2vt=qbhoog5waui0iwe+8yp"
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
DEBUG = env.bool("DEBUG", default=False)
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])
|
||||
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
@ -27,6 +33,9 @@ INSTALLED_APPS = [
|
|||
"django.contrib.staticfiles",
|
||||
"services",
|
||||
]
|
||||
if DEBUG:
|
||||
INSTALLED_APPS += ["django_browser_reload"]
|
||||
|
||||
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
|
@ -37,6 +46,11 @@ MIDDLEWARE = [
|
|||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
]
|
||||
if DEBUG:
|
||||
MIDDLEWARE += [
|
||||
"django_browser_reload.middleware.BrowserReloadMiddleware",
|
||||
]
|
||||
|
||||
|
||||
ROOT_URLCONF = "hub.urls"
|
||||
|
||||
|
@ -110,3 +124,6 @@ STATIC_URL = "static/"
|
|||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = BASE_DIR / "media"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
|
||||
|
@ -5,3 +7,8 @@ urlpatterns = [
|
|||
path("admin/", admin.site.urls),
|
||||
path("", include("services.urls")),
|
||||
]
|
||||
if settings.DEBUG:
|
||||
urlpatterns += [
|
||||
path("__reload__/", include("django_browser_reload.urls")),
|
||||
]
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Services Marketplace</title>
|
||||
<title>Servala - The Cloud Native Services Hub</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'services:service_list' %}">Services Marketplace</a>
|
||||
<a class="navbar-brand" href="{% url 'services:service_list' %}">Servala - The Cloud Native Services Hub</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue