Fertige erste Django-Webapplikation: selbst generierter Text wird bei Aufruf von

http://127.0.0.1:8000/posts/

angezeigt!
This commit is contained in:
2018-10-29 16:50:31 +01:00
parent a4c7ce4b71
commit 99e8c4c710
9 changed files with 34 additions and 2 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'
+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.
+7
View File
@@ -0,0 +1,7 @@
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.index, name="index"),
]
+7
View File
@@ -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 :-)")