Solution of 04

This commit is contained in:
2018-11-23 12:21:19 +01:00
parent b9a1224b39
commit 1d65d9c9a3
6 changed files with 66 additions and 6 deletions
+1 -1
View File
@@ -4,5 +4,5 @@ from django.urls import path, re_path
urlpatterns = [
# use re_path for regex (.*) - this regex accepts anything - see https://docs.python.org/3/library/re.html for more
path('', views.home, name=''),
re_path('(?P<value>.*)/$', views.home, name='textwiedergabe')
re_path('(?P<value>.*)/$', views.home, name='textausgabe')
]
+7 -4
View File
@@ -1,6 +1,9 @@
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
# if no value is given use the default ''
def home(request, value=''):
return HttpResponse(value)
def home(request, value=""):
context = {
"title": "Beboop",
"message": value
}
return render(request, 'index.html', context)