From 516483c865af2b95f7a1671571d005d5c697c647 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 21 Jul 2023 10:07:51 +0200 Subject: [PATCH] Fix old code --- {apps/website => app/public}/__init__.py | 0 {apps/website => app/public}/admin.py | 0 {apps/website => app/public}/apps.py | 4 ++-- {apps/website => app/public}/migrations/__init__.py | 0 {apps/website => app/public}/models.py | 0 {apps/website => app/public}/urls.py | 4 ++-- {apps/website => app/public}/views.py | 0 core/settings.py | 11 +++-------- core/urls.py | 2 +- env.example | 7 ++++++- {apps/website/templates => templates}/home.html | 0 11 files changed, 14 insertions(+), 14 deletions(-) rename {apps/website => app/public}/__init__.py (100%) rename {apps/website => app/public}/admin.py (100%) rename {apps/website => app/public}/apps.py (61%) rename {apps/website => app/public}/migrations/__init__.py (100%) rename {apps/website => app/public}/models.py (100%) rename {apps/website => app/public}/urls.py (68%) rename {apps/website => app/public}/views.py (100%) rename {apps/website/templates => templates}/home.html (100%) diff --git a/apps/website/__init__.py b/app/public/__init__.py similarity index 100% rename from apps/website/__init__.py rename to app/public/__init__.py diff --git a/apps/website/admin.py b/app/public/admin.py similarity index 100% rename from apps/website/admin.py rename to app/public/admin.py diff --git a/apps/website/apps.py b/app/public/apps.py similarity index 61% rename from apps/website/apps.py rename to app/public/apps.py index 0d4a5d4..6ff69da 100644 --- a/apps/website/apps.py +++ b/app/public/apps.py @@ -1,6 +1,6 @@ from django.apps import AppConfig -class WebsiteConfig(AppConfig): +class PublicConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" - name = "apps.website" + name = "app.public" diff --git a/apps/website/migrations/__init__.py b/app/public/migrations/__init__.py similarity index 100% rename from apps/website/migrations/__init__.py rename to app/public/migrations/__init__.py diff --git a/apps/website/models.py b/app/public/models.py similarity index 100% rename from apps/website/models.py rename to app/public/models.py diff --git a/apps/website/urls.py b/app/public/urls.py similarity index 68% rename from apps/website/urls.py rename to app/public/urls.py index 3fbd58a..2d882b0 100644 --- a/apps/website/urls.py +++ b/app/public/urls.py @@ -1,7 +1,7 @@ from django.urls import path -from apps.website.views import home +from app.public.views import home urlpatterns = [ path("", home, name="home"), -] \ No newline at end of file +] diff --git a/apps/website/views.py b/app/public/views.py similarity index 100% rename from apps/website/views.py rename to app/public/views.py diff --git a/core/settings.py b/core/settings.py index 7d10a55..ccf04a2 100644 --- a/core/settings.py +++ b/core/settings.py @@ -24,14 +24,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get("SECRET_KEY") -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.environ.get("DEBUG", "True") == "True" +DEBUG = os.environ.get("DEBUG", "True").lower() == "true" +ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",") -ALLOWED_HOSTS = [] - -# ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",") -if not os.environ.get("ALLOWED_HOSTS") == None: - ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",") # Application definition @@ -44,7 +39,7 @@ INSTALLED_APPS = [ "django.contrib.staticfiles", "django_extensions", "rest_framework", - "apps.website", + "app.public", ] MIDDLEWARE = [ diff --git a/core/urls.py b/core/urls.py index 576217f..e6cf6d3 100644 --- a/core/urls.py +++ b/core/urls.py @@ -17,6 +17,6 @@ from django.contrib import admin from django.urls import path, include urlpatterns = [ - path("", include("apps.website.urls")), + path("", include("app.public.urls")), path("admin/", admin.site.urls), ] diff --git a/env.example b/env.example index 167c035..c56c50f 100644 --- a/env.example +++ b/env.example @@ -1,10 +1,15 @@ PROJECT_NAME=project # Django -DJANGO_SECRET_KEY=mysecret +DEBUG=True +SECRET_KEY=mysecret DOMAIN=project.localhost DOMAIN_URL=http://project.localhost ALLOWED_HOSTS=project.localhost,localhost +STATIC_ROOT=static +STATIC_URL=/static/ +MEDIA_ROOT=media +MEDIA_URL=/media/ # Captcha HCAPTCHA_ENABLED=False diff --git a/apps/website/templates/home.html b/templates/home.html similarity index 100% rename from apps/website/templates/home.html rename to templates/home.html