diff --git a/base_app/templates/index.html b/base_app/templates/index.html new file mode 100644 index 0000000..81f24e5 --- /dev/null +++ b/base_app/templates/index.html @@ -0,0 +1,5 @@ +{% extends "layout.html" %} + +{% block content %} + hello +{% endblock %} diff --git a/base_app/templates/layout.html b/base_app/templates/layout.html new file mode 100644 index 0000000..b1e238f --- /dev/null +++ b/base_app/templates/layout.html @@ -0,0 +1,48 @@ + + + + {% load static %} + + {{ title }} + + + + + + + + + + {% block headerExtension %} + {% endblock %} + + + + + +
+ + {% block content %} + {% endblock %} + + + +
+ + diff --git a/base_app/views.py b/base_app/views.py index 91ea44a..b77d52b 100644 --- a/base_app/views.py +++ b/base_app/views.py @@ -1,3 +1,12 @@ from django.shortcuts import render # Create your views here. +from django.shortcuts import render, redirect +from django.views.generic import TemplateView, FormView + +class IndexView(TemplateView): + + def get(self, request, *args, **kwargs): + return render(request, "index.html", {}) + + diff --git a/plchweb/settings.py b/plchweb/settings.py index 34aa06e..b955a92 100644 --- a/plchweb/settings.py +++ b/plchweb/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'base_app', ] MIDDLEWARE = [ @@ -118,3 +119,6 @@ USE_TZ = True # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' +MEDIA_URL = "/media/" +STATIC_ROOT = os.path.join(BASE_DIR, "static/") +MEDIA_ROOT = os.path.join(BASE_DIR, "media/") diff --git a/plchweb/urls.py b/plchweb/urls.py index 1be9f81..565b520 100644 --- a/plchweb/urls.py +++ b/plchweb/urls.py @@ -15,7 +15,9 @@ Including another URLconf """ from django.contrib import admin from django.urls import path +from base_app.views import IndexView urlpatterns = [ path('admin/', admin.site.urls), + path('', IndexView.as_view()), ]