diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml index d1bedb8..82ab4df 100644 --- a/.github/workflows/flake.yml +++ b/.github/workflows/flake.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application +name: Flake 8 on: push: diff --git a/tldtest/settings.py b/tldtest/settings.py index 84ba062..8463465 100644 --- a/tldtest/settings.py +++ b/tldtest/settings.py @@ -38,7 +38,8 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'admin_extra_buttons', - 'tldtester', + 'tldtester.apps.TldtesterConfig', + 'tldtest', ] MIDDLEWARE = [ @@ -56,7 +57,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + "DIRS": [BASE_DIR / "templates"], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/tldtest/templates/404.html b/tldtest/templates/404.html new file mode 100644 index 0000000..e6be426 --- /dev/null +++ b/tldtest/templates/404.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block title %}Error 404{% endblock %} +{% block content %} + +{% endblock content %} diff --git a/tldtest/templates/500.html b/tldtest/templates/500.html new file mode 100644 index 0000000..8446050 --- /dev/null +++ b/tldtest/templates/500.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block title %}Error 404{% endblock %} +{% block content %} + +{% endblock content %} diff --git a/tldtest/templates/base.html b/tldtest/templates/base.html new file mode 100644 index 0000000..d61be45 --- /dev/null +++ b/tldtest/templates/base.html @@ -0,0 +1,12 @@ +{% load static %} + + + + + {% block title %}TLD Tester{% endblock %} + + +{% block content %} +{% endblock content %} + + \ No newline at end of file diff --git a/tldtest/templates/home.html b/tldtest/templates/home.html new file mode 100644 index 0000000..1247810 --- /dev/null +++ b/tldtest/templates/home.html @@ -0,0 +1,4 @@ +{% extends "base.html" %} +{% block content %} +Hello World +{% endblock content %} diff --git a/tldtest/urls.py b/tldtest/urls.py index ccd3d6c..59b728b 100644 --- a/tldtest/urls.py +++ b/tldtest/urls.py @@ -15,7 +15,9 @@ """ from django.contrib import admin from django.urls import path +from .views import Index urlpatterns = [ + path("", Index.as_view(), name="home"), path('admin/', admin.site.urls), ] diff --git a/tldtest/views.py b/tldtest/views.py new file mode 100644 index 0000000..a7fab18 --- /dev/null +++ b/tldtest/views.py @@ -0,0 +1,14 @@ +from django.shortcuts import render +from django.views.generic import TemplateView + + +class Index(TemplateView): + template_name = 'home.html' + + +def handler404(request): + return render(request, '404.html', status=404) + + +def handler500(request): + return render(request, '500.html', status=500)