Commit 74904011 authored by Keith Adrian Santos's avatar Keith Adrian Santos

added a froyo homepage to views,tests,urls,made urls.py in froyo and made...

added a froyo homepage to views,tests,urls,made urls.py in froyo and made froyo_home.html. test.py ran successfully na
parent 75eca6df
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<header>
<h1> Froyo Home Page </h1>
</header>
</body>
</html>
\ No newline at end of file
from django.test import TestCase from django.test import TestCase
class FroyoHomePageTest(TestCase):
def test_froyo_home_page_returns_correct_html(self):
response = self.client.get('/froyo')
self.assertTemplateUsed(response,'froyo_home.html')
# Create your tests here. # Create your tests here.
from django.conf.urls import url
from.views import FroyoView
urlpatterns = [
url(r'^froyo$',FroyoView.as_view(),name='froyo_list'),
]
\ No newline at end of file
from django.shortcuts import render from django.shortcuts import render
from django.views.generic.base import TemplateView
# Create your views here. # Create your views here.
class FroyoView(TemplateView):
template_name = "froyo_home.html"
\ No newline at end of file
...@@ -37,6 +37,7 @@ INSTALLED_APPS = [ ...@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'froyo',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
......
...@@ -13,9 +13,10 @@ Including another URLconf ...@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include 1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import url from django.conf.urls import url, include
from django.contrib import admin from django.contrib import admin
urlpatterns = [ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'', include('froyo.urls')),
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment