http://127.0.0.1:8000/posts/ angezeigt!master
@@ -13,9 +13,13 @@ Including another URLconf | |||
1. Import the include() function: from django.urls import include, path | |||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | |||
""" | |||
from django.contrib import admin | |||
from django.urls import path | |||
from django.conf.urls import include, url | |||
from django.contrib import admin | |||
urlpatterns = [ | |||
path('admin/', admin.site.urls), | |||
url(r'^admin/', admin.site.urls), | |||
url(r'^posts/', include('posts.urls')), | |||
] |
@@ -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,7 @@ | |||
from django.conf.urls import include, url | |||
from . import views | |||
urlpatterns = [ | |||
url(r'^$', views.index, name="index"), | |||
] | |||
@@ -0,0 +1,7 @@ | |||
from django.shortcuts import render | |||
from django.http import HttpResponse | |||
# Create your views here. | |||
def index(request): | |||
return HttpResponse("Praktikum -> done :-)") |