name="village_update", ), # this has to be the last url in the list path( "<slug:slug>/", VillageDetailView.as_view(), name="village_detail", ), ], ), ), path("teams/", include("teams.urls", namespace="teams")), path("rideshare/", include("rideshare.urls", namespace="rideshare")), path("backoffice/", include("backoffice.urls", namespace="backoffice")), path("feedback/", FeedbackCreate.as_view(), name="feedback"), path("economy/", include("economy.urls", namespace="economy")), path("wishlist/", include("wishlist.urls", namespace="wishlist")), path("facilities/", include("facilities.urls", namespace="facilities")), path("phonebook/", include("phonebook.urls", namespace="phonebook")), ], ), ), ] if settings.DEBUG: import debug_toolbar urlpatterns = [path("__debug__/", include(debug_toolbar.urls))
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 django.views.decorators.clickjacking import xframe_options_exempt from django.views.generic.base import RedirectView # from feedback.api import APIRouter from feedback.views import FeedbackView, FeedbackCreate from django.views.generic import TemplateView admin.autodiscover() # router = APIRouter() urlpatterns = [ url(r'^admin/', admin.site.urls), # url(r'^v1/', include(router.urls)), url(r'^v1/', FeedbackView.as_view()), url(r'add', FeedbackCreate.as_view(), name='feedback-add'), url(r'thankyou', xframe_options_exempt( TemplateView.as_view( template_name='feedback/feedback_thankyou.html')), name='feedback-thankyou'), url(r'^$', RedirectView.as_view(url='v1/')), ]
include([ path('', VillageListView.as_view(), name='village_list'), path('create/', VillageCreateView.as_view(), name='village_create'), path('<slug:slug>/delete/', VillageDeleteView.as_view(), name='village_delete'), path('<slug:slug>/edit/', VillageUpdateView.as_view(), name='village_update'), # this has to be the last url in the list path('<slug:slug>/', VillageDetailView.as_view(), name='village_detail'), ])), path('teams/', include('teams.urls', namespace='teams')), path('rideshare/', include('rideshare.urls', namespace='rideshare')), path('backoffice/', include('backoffice.urls', namespace='backoffice')), path('feedback/', FeedbackCreate.as_view(), name='feedback'), ])) ] if settings.DEBUG: import debug_toolbar urlpatterns = [ path('__debug__/', include(debug_toolbar.urls)), ] + urlpatterns
urlpatterns = patterns( '', # Examples: # url(r'^$', 'factorex.views.home', name='home'), # url(r'^blog/', include('blog.urls')), # Admin url(r'^admin/', include(admin.site.urls)), # Browsing # url(r'^$', index), url(r'^$', land_page), url(r'^user/(?P<id>\w+)/$', user_page), url(r'^profile/', profile), url(r'^account/(?P<id>\w+)/$', account_page), url(r'^contact/$', FeedbackCreate.as_view(), name='request_contact'), url(r'^contact/success/$', TemplateView.as_view(template_name="contact_success.html")), url(r'^request-invite/$', InviteCreate.as_view(), name='request_invite'), url(r'^request-invite/success/$', invite_success), # Session management url(r'^login/$', 'django.contrib.auth.views.login'), url(r'^logout/$', logout_page), url(r'^register/$', register_page), url( r'^register/success/$', TemplateView.as_view( template_name='registration/register_success.html')), )