Permalink
Browse files

Django app serves a View

  • Loading branch information...
lukaszkuczynski committed Jun 20, 2017
1 parent 4fd7175 commit 7d6f8dd5c63df07f84e5bebc39597332482d9fa1
View
@@ -1,3 +1,3 @@
start.cmd
*.sqlite3
*/__pycache__
__pycache__
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
Hello Mr Django 160
</body>
</html>
View
@@ -0,0 +1,22 @@
"""site_160 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.index),
]
@@ -1,3 +1,4 @@
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'app_160/index.html')
@@ -31,6 +31,7 @@
# Application definition
INSTALLED_APPS = [
'app_160',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -15,7 +15,9 @@
"""
from django.conf.urls import url
from django.contrib import admin
from django.conf.urls import include
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('app_160.urls'))
]

0 comments on commit 7d6f8dd

Please sign in to comment.