diff --git a/dnd_db_site/settings.py b/dnd_db_site/settings.py index 0f803a0..e6c5ac7 100644 --- a/dnd_db_site/settings.py +++ b/dnd_db_site/settings.py @@ -19,14 +19,14 @@ BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! -import os -SECRET_KEY = os.environ['SECRET_KEY'] +import environ +env = environ.Env() +environ.Env.read_env() +SECRET_KEY = env('SECRET_KEY') -# SECURITY WARNING: don't run with debug turned on in production! DEBUG = False -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = [env('HOST_1')] # Application definition diff --git a/dnd_db_site/urls.py b/dnd_db_site/urls.py index 1b4a302..5540641 100644 --- a/dnd_db_site/urls.py +++ b/dnd_db_site/urls.py @@ -14,8 +14,9 @@ Including another URLconf 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 include, path urlpatterns = [ path('admin/', admin.site.urls), + path('', include('polls.urls')), ] diff --git a/polls/__init__.py b/polls/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/polls/admin.py b/polls/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/polls/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/polls/apps.py b/polls/apps.py new file mode 100644 index 0000000..5a5f94c --- /dev/null +++ b/polls/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class PollsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'polls' diff --git a/polls/migrations/__init__.py b/polls/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/polls/models.py b/polls/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/polls/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/polls/tests.py b/polls/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/polls/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/polls/urls.py b/polls/urls.py new file mode 100644 index 0000000..4c9189f --- /dev/null +++ b/polls/urls.py @@ -0,0 +1,8 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] + diff --git a/polls/views.py b/polls/views.py new file mode 100644 index 0000000..e36da09 --- /dev/null +++ b/polls/views.py @@ -0,0 +1,5 @@ +from django.http import HttpResponse + +def index(request): + return HttpResponse('Hallo, Welt!') +