Skip to content

Commit

Permalink
Added homepage to Django
Browse files Browse the repository at this point in the history
  • Loading branch information
codingforentrepreneurs committed Jan 9, 2024
1 parent d53cdc9 commit 0763b29
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cfehome/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True # twingate

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["*"]


# Application definition
Expand All @@ -37,6 +37,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"landing",
]

MIDDLEWARE = [
Expand All @@ -54,7 +55,7 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [BASE_DIR / "templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down
3 changes: 3 additions & 0 deletions src/cfehome/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
from django.contrib import admin
from django.urls import path

from landing import views as landing_views

urlpatterns = [
path("", landing_views.home_page_view),
path("admin/", admin.site.urls),
]
Empty file added src/landing/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions src/landing/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions src/landing/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class LandingConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "landing"
Empty file.
3 changes: 3 additions & 0 deletions src/landing/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions src/landing/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
5 changes: 5 additions & 0 deletions src/landing/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.shortcuts import render

# Create your views here.
def home_page_view(request):
return render(request, "landing/home.html", {})
1 change: 1 addition & 0 deletions src/templates/landing/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello World</h1>

0 comments on commit 0763b29

Please sign in to comment.