Updated KARBS

This commit is contained in:
Kristofers Solo 2023-01-19 17:11:11 +02:00
parent bce82d5c5f
commit a565762f65
18 changed files with 48 additions and 39 deletions

View File

@ -1,3 +0,0 @@
# from django.contrib import admin
# Register your models here.

View File

@ -1,6 +0,0 @@
from django.apps import AppConfig
class KarbsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "karbs"

View File

@ -1,3 +0,0 @@
# from django.db import models
# Create your models here.

View File

@ -1,3 +0,0 @@
# from django.test import TestCase
# Create your tests here.

View File

@ -1,7 +0,0 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.karbs, name="karbs"),
path("instructions", views.instructions, name="instructions"),
]

View File

@ -1,11 +0,0 @@
from django.shortcuts import render
def instructions(request):
"""Karbs Instruction"""
return render(request, "karbs/instructions.html", {"title": "Karbs Instructions"})
def karbs(request):
"""Karbs install script"""
return render(request, "karbs/karbs", {"title": "KARBS"})

View File

@ -4,6 +4,6 @@ from . import views
urlpatterns = [ urlpatterns = [
path("", views.index, name="home"), path("", views.index, name="home"),
path("projects", views.projects, name="projects"), path("karbs", views.karbs, name="karbs"),
path("lightsaber", views.lightsaber, name="lightsaber"), path("lightsaber", views.lightsaber, name="lightsaber"),
] ]

View File

@ -1,4 +1,4 @@
from django.shortcuts import render from django.shortcuts import redirect, render
def index(request): def index(request):
@ -11,3 +11,8 @@ def lightsaber(request):
def projects(request): def projects(request):
return render(request, "main/projects.html", {"title": "Projects"}) return render(request, "main/projects.html", {"title": "Projects"})
def karbs(request):
"""Karbs install script"""
return redirect("/projects/karbs/")

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ProjectsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'projects'

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,9 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.projects, name="projects"),
path("karbs", views.karbs, name="karbs"),
path("karbs/instructions", views.instructions, name="instructions"),
]

View File

@ -0,0 +1,13 @@
from django.shortcuts import render
def projects(request):
return render(request, "projects/projects.html", {"title": "Projects"})
def karbs(request):
return render(request, "projects/karbs/karbs", {"title": "KARBS"})
def instructions(request):
return render(request, "projects/karbs/instructions.html", {"title": "Karbs Instructions"})

View File

@ -46,7 +46,7 @@ INSTALLED_APPS = [
"django.contrib.staticfiles", "django.contrib.staticfiles",
"fontawesomefree", "fontawesomefree",
"main", "main",
"karbs", "projects",
] ]
MIDDLEWARE = [ MIDDLEWARE = [

View File

@ -13,15 +13,15 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path 1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path("blog/", include("blog.urls")) 2. Add a URL to urlpatterns: path("blog/", include("blog.urls"))
""" """
from django.contrib import admin
from django.urls import path, include
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", include("main.urls")), path("", include("main.urls")),
path("karbs/", include("karbs.urls")), path("projects/", include("projects.urls")),
] ]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)