Ejemplo n.º 1
0
"""recipe_app URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf import settings
from django.urls import path
from django.conf.urls.static import static

from recipe.views import RecipeListView, RecipeDetailView

urlpatterns = [
    path(f'{settings.ADMIN_URL}', admin.site.urls),
    path('', RecipeListView.as_view(), name="recipe_list"),
    path('<pk>/', RecipeDetailView.as_view(), name="recipe_detail"),
]
Ejemplo n.º 2
0
from django.conf.urls import include, url
from django.contrib import admin

from recipe.views import (
    RecipeDetailView,
    UserRecipeListView,
    PublicRecipeListView,
    RecipeCreate,
    ReciperUpdate,
    RecipeDelete,
    OverView,
)


urlpatterns = [
    url(r"^admin/", include(admin.site.urls)),
    url(r"^/$", OverView.as_view(), name="overview"),
    url(r"^recipe/(?P<pk>\d+)/$", RecipeDetailView.as_view(), name="recipe_detail"),
    url(r"^recipe/list/$", UserRecipeListView.as_view(), name="user_recipe_list"),
    url(r"^recipe/publist/$", PublicRecipeListView.as_view(), name="public_recipe_list"),
    url(r"^recipe/add/$", RecipeCreate.as_view(), name="recipe_add"),
    url(r"^recipe/update/(?P<pk>\d+)/$", ReciperUpdate.as_view(), name="recipe_update"),
    url(r"^recipe/delete/(?P<pk>\d+)/$", RecipeDelete.as_view(), name="recipe_delete"),
    # authentication
    url("^accounts/", include("django.contrib.auth.urls")),
]
Ejemplo n.º 3
0
from django.conf.urls import include, url
from django.contrib import admin

from recipe.views import RecipeDetailView, UserRecipeListView, PublicRecipeListView,  RecipeCreate, ReciperUpdate,\
    RecipeDelete, OverView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^/$', OverView.as_view(), name='overview'),
    url(r'^recipe/(?P<pk>\d+)/$',
        RecipeDetailView.as_view(),
        name='recipe_detail'),
    url(r'^recipe/list/$',
        UserRecipeListView.as_view(),
        name='user_recipe_list'),
    url(r'^recipe/publist/$',
        PublicRecipeListView.as_view(),
        name='public_recipe_list'),
    url(r'^recipe/add/$', RecipeCreate.as_view(), name='recipe_add'),
    url(r'^recipe/update/(?P<pk>\d+)/$',
        ReciperUpdate.as_view(),
        name='recipe_update'),
    url(r'^recipe/delete/(?P<pk>\d+)/$',
        RecipeDelete.as_view(),
        name='recipe_delete'),

    # authentication
    url('^accounts/', include('django.contrib.auth.urls')),
]
Ejemplo n.º 4
0
    `url(r'^$', Home.as_view(), name='home')`

Including another URL conf
--
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, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic import TemplateView

from recipe.views import RecipeDetailView, RecipeListView
from blog.views import PostView

urlpatterns = [
    url(r'^redactor/', include('redactor.urls')),
    url(r'^$', TemplateView.as_view(template_name='index.html')),
    url(r'^admin/', admin.site.urls),
    url(r'^posts/(?P<slug>[-\w\d\_]+)/$', PostView.as_view(), name='post_view'),
    url(r'^recipes/list/', RecipeListView.as_view()),
    url(r'^recipes/(?P<slug>[-\w\d\_]+)/$', RecipeDetailView.as_view(), name='recipe_view')
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Ejemplo n.º 5
0
       'accounts.views.profile_edit',
       name='userena_profile_edit'),

    url(r'^message_comet/$', 'accounts.views.message_comet', name='message_comet'),

    url(r'^accounts/', include('userena.urls')),

    url(r'^messages/', include('userena.contrib.umessages.urls')),

    url(r'^grappelli/', include('grappelli.urls')),
    #url(r'^$', 'recipe.views.nav', name='homepage'),
	url(r'^$', 'recipe.views.index', name='homepage'),

    # URL for recipe
    url(r'^recipe/add/$', 'recipe.views.recipe_create', name='recipe_create'),
    url(r'^recipe/(?P<pk>\d+)/$', RecipeDetailView.as_view(), name='recipe_detail'),
    url(r'^recipe/(?P<pk>\d+)/rate/$', 'recipe.views.rate', name='rate'),
    url(r'^recipe/(?P<pk>\d+)/like/$', 'recipe.views.like', name='like'),
    url(r'^recipe/(?P<pk>\d+)/unlike/$', 'recipe.views.unlike', name='unlike'),
    url(r'^recipe/(?P<pk>\d+)/edit/$', 'recipe.views.recipe_edit', name='recipe_edit'),
    url(r'^recipe/(?P<pk>\d+)/delete/$', 'recipe.views.recipe_delete', name='recipe_delete'),
    url(r'^recipe/(?P<pk>\d+)/did/$', 'recipe.views.did_recipe_upload', name='did_recipe_upload'),
    url(r'^didrecipe/(?P<pk>\d+)/$', DidRecipeDetailView.as_view(), name='did_recipe_detail'),

    url(r'^recipecategory/(\d+)/(hot|time|trend|rating)/$', RecipeCategoryListView.as_view(), name='recipe_category'),
    url(r'^hot/$', HotRecipeListView.as_view(), name='hot_recipes'),
    url(r'^recipe/cover_image_upload/$', 'recipe.views.cover_image_upload', name='recipe_image_upload'),
    url(r'^recipe/step_image_upload/$', 'recipe.views.step_image_upload', name='step_image_upload'),

    # URL for food
    url(r'^food/(?P<pk>\d+)/$', FoodDetailView.as_view(), name='food_detail'),
Ejemplo n.º 6
0
from django.contrib import admin
from django.urls import path

from recipe.views import RecipeDetailView, RecipeListView

app_name = "recipe"

urlpatterns = [
    path('', RecipeListView.as_view(), name="index"),
    path('<int:pk>', RecipeDetailView.as_view(), name="detail"),
]