commit
56f673ff3f
2
.github/workflows/flake.yml
vendored
2
.github/workflows/flake.yml
vendored
|
@ -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:
|
||||
|
|
|
@ -38,7 +38,8 @@ INSTALLED_APPS = [
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'admin_extra_buttons',
|
||||
'tldtester',
|
||||
'tldtester.apps.TldtesterConfig',
|
||||
'tldtest',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
@ -56,7 +57,7 @@ ROOT_URLCONF = 'tldtest.urls'
|
|||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
"DIRS": [BASE_DIR / "templates"],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
|
5
tldtest/templates/404.html
Normal file
5
tldtest/templates/404.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Error 404{% endblock %}
|
||||
{% block content %}
|
||||
<img src="https://http.cat/images/404.jpg">
|
||||
{% endblock content %}
|
5
tldtest/templates/500.html
Normal file
5
tldtest/templates/500.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Error 404{% endblock %}
|
||||
{% block content %}
|
||||
<img src="https://http.cat/images/500.jpg">
|
||||
{% endblock content %}
|
12
tldtest/templates/base.html
Normal file
12
tldtest/templates/base.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}TLD Tester{% endblock %}</title>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</body>
|
||||
</html>
|
4
tldtest/templates/home.html
Normal file
4
tldtest/templates/home.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
Hello World
|
||||
{% endblock content %}
|
|
@ -15,7 +15,9 @@ Including another URLconf
|
|||
"""
|
||||
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),
|
||||
]
|
||||
|
|
14
tldtest/views.py
Normal file
14
tldtest/views.py
Normal file
|
@ -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)
|
Loading…
Reference in a new issue