Solution of 03
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PostsConfig(AppConfig):
|
||||
name = 'posts'
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -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')
|
||||
]
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user