Skip to content

Commit

Permalink
Merge pull request #2 from tldtest/basic_web
Browse files Browse the repository at this point in the history
preping views
  • Loading branch information
altf4arnold authored Feb 23, 2024
2 parents 49c565a + c002b2d commit 56f673f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flake.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
5 changes: 3 additions & 2 deletions tldtest/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'admin_extra_buttons',
'tldtester',
'tldtester.apps.TldtesterConfig',
'tldtest',
]

MIDDLEWARE = [
Expand All @@ -56,7 +57,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
"DIRS": [BASE_DIR / "templates"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down
5 changes: 5 additions & 0 deletions tldtest/templates/404.html
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions tldtest/templates/500.html
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions tldtest/templates/base.html
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions tldtest/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block content %}
Hello World
{% endblock content %}
2 changes: 2 additions & 0 deletions tldtest/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
14 changes: 14 additions & 0 deletions tldtest/views.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 56f673f

Please sign in to comment.