Solution of 03

This commit is contained in:
2018-11-23 12:09:33 +01:00
parent b09fba234b
commit b9a1224b39
14 changed files with 203 additions and 0 deletions
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class PostsConfig(AppConfig):
name = 'posts'
View File
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+8
View File
@@ -0,0 +1,8 @@
from . import views
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')
]
+6
View File
@@ -0,0 +1,6 @@
from django.http import HttpResponse
# Create your views here.
# if no value is given use the default ''
def home(request, value=''):
return HttpResponse(value)