Commit bff0cdff authored by Alec Wang's avatar Alec Wang

added urls and views

parent 28755e2b
from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^$', home, name="home"),
url(r'^ingredients_list/$', ingredients_list, name="ingredients_list"),
url(r'^ingredients_update/$', ingredients_update_form,
name="ingredients_update"),
url(r'^ingredients_create/$', ingredients_create_form,
name="ingredients_create"),
url(r'^ingredients_detail/$', ingredients_detail, name="ingredients_detail"),
url(r'^orders_list/$', orders_list, name="orders_list"),
url(r'^orders_update/$', orders_update_form, name="orders_update"),
url(r'^orders_create/$', orders_create_form, name="orders_create"),
url(r'^orders_detail/$', orders_detail, name="orders_detail"),
url(r'^recipes_list/$', recipes_list, name="recipes_list"),
url(r'^recipes_update/$', recipes_update_form, name="recipes_update"),
url(r'^recipes_create/$', recipes_create_form, name="recipes_create"),
url(r'^recipes_detail/$', recipes_detail, name="recipes_detail"),
]
from django.shortcuts import render
# Create your views here.
# =============ingredients=================
def ingredients_list(request):
return render(request, 'ingredients_list.html')
def ingredients_detail(request):
return render(request, 'ingredients_detail.html')
def ingredients_create_form(request):
return render(request, 'ingredients_create_form.html')
def ingredients_update_form(request):
return render(request, 'ingredients_update_form.html')
# =============orders=================
def orders_list(request):
return render(request, 'orders_list.html')
def orders_detail(request):
return render(request, 'orders_detail.html')
def orders_create_form(request):
return render(request, 'orders_create_form.html')
def orders_update_form(request):
return render(request, 'orders_update_form.html')
# =============recipes=================
def recipes_list(request):
return render(request, 'recipes_list.html')
def recipes_detail(request):
return render(request, 'recipes_detail.html')
def recipes_create_form(request):
return render(request, 'recipes_create_form.html')
def recipes_update_form(request):
return render(request, 'recipes_update_form.html')
def home(request):
return render(request, 'home.html')
......@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'froyo',
]
MIDDLEWARE = [
......
......@@ -13,9 +13,10 @@ 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.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
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