Commit 18eb025f authored by Li Niko M. Arceo's avatar Li Niko M. Arceo 🦈

urls.py should be setup

parent 7d00c34a
Pipeline #962 canceled with stages
<html>
<title>Home</title>
</html>
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
class HomePageTest(TestCase):
def test_uses_home_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response,'home.html')
from django.conf.urls import url
from .views import HomeView, IngredientsList
urlpatterns = [
url(r'^$', HomeView, name='home_page'),
url(r'^ingredients/list$', IngredientsList.as_view(), name='ingredients-list'),
url(r'^ingredients/detail$', IngredientsDetail.as_view(), name='ingredients-detail'),
url(r'^ingredients/update$', IngredientsUpdate.as_view(), name='ingredients-update'),
url(r'^ingredients/create$', IngredientsCreate.as_view(), name='ingredients-create'),
url(r'^recipes/list$', RecipesList.as_view(), name='recipes-list'),
url(r'^recipes/detail$', RecipesDetail.as_view(), name='recipes-detail'),
url(r'^recipes/update$', RecipesUpdate.as_view(), name='recipes-update'),
url(r'^recipes/create$', RecipesCreate.as_view(), name='recipes-create'),
url(r'^orders/list$', OrdersList.as_view(), name='orders-list'),
url(r'^orders/detail$', OrdersDetail.as_view(), name='orders-detail'),
url(r'^orders/update$', OrdersUpdate.as_view(), name='orders-update'),
url(r'^orders/create$', OrdersCreate.as_view(), name='orders-create'),
]
from django.views.generic.base import TemplateView
class HomeView(TemplateView):
template_name = "home.html"
#ingredients model
class IngredientsList(TemplateView):
template_name = "ingredients_list.html"
......
......@@ -14,8 +14,9 @@ Including another URLconf
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
urlpatterns = [
path('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