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.urls import path, include from django_registration.backends.one_step.views import RegistrationView from users.forms import CustomUserForm from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path('acccounts/register/', RegistrationView.as_view( form_class=CustomUserForm, success_url="/", ), name='django_registration_register'), path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), path('api-auth/', include('rest_framework.urls')), path('api/', include('users.api.urls')), path('api/', include('questions.api.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration/', include('rest_auth.registration.urls')), path('', IndexTemplateView.as_view(), name='index') ]
https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 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 import settings from django.conf.urls import url, include from django.contrib import admin from django.conf.urls.static import static from core.views import IndexTemplateView, CustomCreateView, PagesList, \ PagesDetail urlpatterns = [ url(r'^$', IndexTemplateView.as_view()), url(r'^create-view/$', CustomCreateView.as_view(), name='create_view'), url(r'^markdownx/', include('markdownx.urls')), url(r'^admin/', include(admin.site.urls)), url(r'pages/', PagesList.as_view()), url(r'^(?P<slug>[-\w]+)/$', PagesDetail.as_view(), name='markdownpage-detail'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
path('accounts/register/', RegistrationView.as_view( form_class=CustomUserForm, template_name='django_registration/registration.html', success_url='/'), name='django_registration_register'), # other urls used by django-registration package path('accounts/', include('django_registration.backends.one_step.urls')), # login urls provided by django path('accounts/', include('django.contrib.auth.urls')), # our 'users' api urls path('api/', include('users.api.urls')), # # our 'questions' api urls path('api/', include('questions.api.urls')), # login url for browsable api path('api-auth/', include('rest_framework.urls')), # login endpoints via REST path('api/rest-auth/', include('rest_auth.urls')), # registration endpoint via REST path('api/rest-auth/registration/', include('rest_auth.registration.urls')), re_path(r'^.*$', IndexTemplateView.as_view(), name='entry') ]
#Login: path("api-auth/", include("rest_framework.urls")), #REST: #Login path("api/rest-auth/", include("rest_auth.urls")), #registration path("api/rest-auth/registration/", include("rest_auth.registration.urls")), # re_path(r'^.+jpg/$', # IndexTemplateView.as_view(), # name="entry-point-jpg"), path("dexotime/", dexo_current_datetime, name="dexotime"), path("test/", IndexTemplateViewTEST.as_view(), name="entry-point-start"), re_path(r"^event/.*$", IndexTemplateView.as_view(), name="entry-point"), path("", IndexTemplateView.as_view(), name="entry-point-start"), #vue routes: --> re_path(r"^$", IndexTemplateView.as_view(), name="entry-point"), path("sede", IndexTemplateView.as_view(), name="homepageSede"), path("sedeOrari", IndexTemplateView.as_view(), name="homepageOrari"), path("links", IndexTemplateView.as_view(), name="homepagelinks"), path("contatti", IndexTemplateView.as_view(), name="homepagecontatti"), path("chisiamo", IndexTemplateView.as_view(), name="homepagechisiamo"), path("chisiamosoci", IndexTemplateView.as_view(), name="homepagechisiamosoci"), path("chisiamobenemerite", IndexTemplateView.as_view(), name="homepagechisiamobenemerite"),
""" from django.contrib import admin from django.urls import path, include, re_path from django_registration.backends.one_step.views import RegistrationView from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path("accounts/register/", RegistrationView.as_view(success_url="/", ), name="django_registration_register"), # Register and Login via browser path('accounts/', include('django_registration.backends.one_step.urls')), # Register and Login via browser path('accounts/', include('django.contrib.auth.urls')), # Login via REST path("api/rest-auth/", include("rest_auth.urls")), # Registration via REST path("api/rest-auth/registration/", include("rest_auth.registration.urls")), path("api/", include("todos.api.urls")), path("", IndexTemplateView.as_view(), name="index-point"), re_path(r"^.*$", IndexTemplateView.as_view(), name="entry-point"), ]
path("api/rest-auth/", include("rest_auth.urls")), path("api/rest-auth/registration/", include("rest_auth.registration.urls")), url('^', include('django.contrib.auth.urls')), path("match/", views.matchplayed, name='matchplayed'), path('reset_password/', auth_views.PasswordResetView.as_view(template_name="password_reset.html"), name="reset_password"), path('reset_password_sent/', auth_views.PasswordResetDoneView.as_view(template_name="password_reset_sent.html"), name="password_reset_done"), path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name="password_reset_forn.html"), name="password_reset_confirm"), path('reset_password_complete/', auth_views.PasswordResetCompleteView.as_view(template_name="password_reset_done.html"), name="password_reset_complete"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += re_path(r"^.*$", IndexTemplateView.as_view(), name="entry-point"),
# profiles api path('api/user/', include('profiles.api.urls')), # recipe api path('api/recipe/', include('recipe.api.urls')), # Login via rest path('api/rest-auth/', include('rest_auth.urls')), # Login via browsable api path('api-auth/', include('rest_framework.urls')), # registation via rest path('api/rest_auth/registration/', include('rest_auth.registration.urls')), # login/logout/password reset via browser path('accounts/', include('django.contrib.auth.urls')), # registration via browser path('accounts/register/', RegistrationView.as_view(form_class=CustomUserForm, template_name="registration/register.html"), name='django_registration_register'), # path('accounts/', include('django_registration.backends.on_step.urls')) path('accounts/', include('django_registration.backends.activation.urls')), re_path(r"^.*$", IndexTemplateView.as_view(), name='entry-point'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
path('api/', include('core.api.urls')), # This View is provided by django registration path("accounts/register/", RegistrationView.as_view( form_class=CustomUserForm, success_url="/", ), name="django_registration_register"), path("accounts/", include("django_registration.backends.one_step.urls")), path("accounts/", include("django.contrib.auth.urls")), # Login via browsable API path("api/", include("users.api.urls")), # Login via browsable API path("api-auth/", include("rest_framework.urls")), # Login via Rest-API path("api/rest-auth/", include("rest_auth.urls")), # Registration via Rest-API path("api/rest-auth/registration/", include("rest_auth.registration.urls")), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += [re_path(r'^.*$', IndexTemplateView.as_view(), name='entry-point')]
from django.contrib import admin from django.urls import include, path, re_path from django.conf.urls.static import static from django.conf import settings from django_registration.backends.one_step.views import RegistrationView from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('django.contrib.auth.urls')), path('accounts/register/', RegistrationView.as_view( success_url='/'), name='django_registration_register'), path('api-auth/', include('rest_framework.urls')), path('api/', include('users.api.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration/', include('rest_auth.registration.urls')), path('api/', include('places.api.urls')), re_path(r"^(?!media).*$", IndexTemplateView.as_view(), name="entry-point"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.contrib import admin from django.urls import path, include, re_path from users.forms import CustomUserForm from django_registration.backends.one_step.views import RegistrationView from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path('accounts/register/', RegistrationView.as_view(form_class=CustomUserForm, success_url='/'), name='django_registration_register'), path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), #user-api-urls path('api/', include('users.api.urls')), #question api path('api/q/', include('questions.api.urls')), path('api-auth/', include('rest_framework.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration/', include('rest_auth.registration.urls')), # re_path(r"^.*$",IndexTemplateView.as_view(),name='core_point'), path('', IndexTemplateView.as_view(), name='core-point'), ]
from django.conf.urls import patterns, url, include from django.contrib import admin from rest_framework import routers from core import views from core.views import IndexTemplateView admin.autodiscover() router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) router.register(r'groups', views.GroupViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browseable API. urlpatterns = patterns('', url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^index/$', IndexTemplateView.as_view(), name='index'), url(r'^admin/', include(admin.site.urls)), )
__author__ = 'file_author' # Standard Library Imports # Core Django Imports from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() # Third Party Imports # App Imports from core.views import IndexTemplateView urlpatterns = patterns('', # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), # Index url( regex=r'^$', view=IndexTemplateView.as_view(), name='home' ), )
"""MHIS 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.urls import path, include from ntp import urls from django.shortcuts import redirect from .views import redirect_view from rest_framework import urls from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('ntp.urls')), path('', redirect_view), path('notify/', IndexTemplateView.as_view()), path('api-auth/', include('rest_framework.urls')) ]
path('register/', user_views.register, name='register'), url(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', user_views.activate, name='activate'), path("accounts/register/", RegistrationView.as_view( form_class=CustomUserForm, success_url="/", ), name="django_registration_register"), path("accounts/", include("django_registration.backends.one_step.urls")), path("accounts/", include("django.contrib.auth.urls")), path("api/", include("users.api.urls")), path("api/", include("app.api.urls")), url('^', include('django.contrib.auth.urls')), path("api-auth/", include("rest_framework.urls")), path("api/rest-auth/", include("rest_auth.urls")), path("api/rest-auth/registration/", include("rest_auth.registration.urls")), path("match/", views.matchplayed, name='matchplayed'), url(r'match/(?P<id>[0-9]+)/delete/$', views.deletematch, name='deletematch'), path('accounts/', include('allauth.urls')), path('repass/', include('password_reset.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += re_path(r"^.*$", IndexTemplateView.as_view(), name="entry-point"),
form_class=CustomUserForm, success_url="/", ), name="django_registration_register"), # Other urls provided by django-registration package path('accounts/', include('django_registration.backends.one_step.urls')), # Login urls provided by django to login via browser path('accounts/', include('django.contrib.auth.urls')), # Login via browsable API path('api-auth/', include('rest_framework.urls')), # Login via REST API(mainly an end-point for API) path('api/rest-auth/', include('rest_auth.urls')), # Registration via REST API(mainly an end-point for API) path('api/rest-auth/registration/', include('rest_auth.registration.urls')), #home page view path("", IndexTemplateView.as_view(), name="entry-point"), # URLs for accessing users endpoints path('api/', include('users.api.urls')), # URLs for Question model path('api/', include('questions.api.urls')), ]
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.urls import path, include, re_path from django_registration.backends.one_step.views import RegistrationView from users.forms import CustomUserForm from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path('accounts/register/', RegistrationView.as_view( form_class=CustomUserForm, success_url='/' ), name='django-registration-register'), path('accounts/', include('django.contrib.auth.urls')), path('accounts/', include('django_registration.backends.one_step.urls')), path('api/', include('users.api.urls')), path('api/', include('questions.api.urls')), path('api-auth/', include('rest_framework.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration/', include('rest_auth.registration.urls')), re_path('^.*$', IndexTemplateView.as_view(), name='entry-point') ]
#from core.views import LocaisList, IndexTemplateView, LocalDetailView, RegCreateView, Pt1CreateView from core.views import IndexTemplateView from django.urls import path from . import views app_name = 'core' urlpatterns = [ path('', IndexTemplateView.as_view(), name="index"), path('pt1/', views.pt1_new, name='pt1'), ] # path('pt1/', Pt1CreateView.as_view(), name="pt1"), # path('post/<int:pk>/', views.post_detail, name='post_detail'), # path('post/new/', views.post_new, name='post_new'), # path('pt2/', situacoes, name="pt2"), # path("sit_m/", sit_met, name="sit_m"), # path("si_m/", si_m, name="si_m"), # path("mi_col/", mi_col, name="mi_col"), # GET/POST /funcionario/{pk} #path('pt2/<pk>', Pt2UpdateView.as_view(), name="parte2"), # GET /localidades #path('locais/', LocaisList.as_view(), name="lista_locais"), # GET/POST /local_detail/{pk} #path('local_detail/<pk>', LocalDetailView.as_view(), name="detail_local"), # GET /aditivo/cadastrar #path('add_reg/', RegCreateView.as_view(), name="add_reg"), # GET/POST /pasta/{pk} #path('pasta/<pk>', PastaDetailView.as_view(), name="detail_pasta"), # GET /funcionarios # path('<int:pasta_id>/', views.getPastas, name='getPastas'),
# re_path(r'^visualize/$', views.visualize_data, name='visualize_data'), # re_path(r'^visualize/generate_chart$', views.generate_chart, name='generate_chart'), # re_path(r'^analyse/$', views.analyse_data, name='analyse_data'), # re_path(r'^analyse/prediction/$', views.analyse_prediction, name='analyse_prediction'), # re_path(r'^analyse/prediction/auto$', views.analyse_prediction_auto, name='analyse_prediction_auto'), # re_path(r'^analyse/clustering/$', views.analyse_clustering, name='analyse_clustering'), # re_path(r'^publish/$', views.publish_model, name='publish_model'), # re_path(r'^document/file_settings/$', views.file_settings, name='file_settings'), # re_path(r'^document/delete/(?P<pk>\d+)/$', views.delete_document, name='delete_document'), # re_path(r'^model/delete/(?P<pk>\d+)/$', views.delete_model, name='delete_model'), # re_path(r'^document/setactive/(?P<pk>\d+)/$', views.setactive_document, name='setactive_document'), # re_path(r'^model/status/(?P<pk>\d+)/$', views.toggle_status_model, name='toggle_status_model'), ] if settings.DEBUG: urlpatterns += static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static( settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += re_path(r'^.*$', IndexTemplateView.as_view(), name='entry-path'), # handler404 = views.error_404 # handler500 = views.error_500
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.urls import include, path, re_path from django_registration.backends.one_step.views import RegistrationView from users.forms import CustomUserForm from core.views import IndexTemplateView urlpatterns = [ path('admin/', admin.site.urls), path("accounts/register/", RegistrationView.as_view( form_class=CustomUserForm, success_url='/', ), name="django_registration_register"), path("accounts/", include("django.contrib.auth.urls")), path("api/", include("users.api.urls")), path("api/", include("questions.api.urls")), path("api-auth/", include("rest_framework.urls")), path("api/rest-auth/", include("rest_auth.urls")), path("api/auth-registration/", include("rest_auth.registration.urls")), re_path(r"^.*$", IndexTemplateView.as_view(), name="entry_point") ]
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.urls import include, path, re_path from django_registration.backends.one_step.views import RegistrationView from core.views import IndexTemplateView from users.forms import CustomUserForm urlpatterns = [ path('admin/', admin.site.urls), path('accounts/register/', RegistrationView.as_view(form_class=CustomUserForm, success_url='/'), name='django_registration_register'), path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), path('api/', include('users.api.urls')), path('api/', include('questions.api.urls')), path('api-auth/', include('rest_framework.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration', include('rest_auth.registration.urls')), re_path(r'^.*$', IndexTemplateView.as_view(), name="entry-point") ]
def test_index_template_user(self): """Test that index.html is used when debug = False""" response = IndexTemplateView.get_template_names(self) self.assertEqual(response, "index.html")
from django.contrib import admin from django.urls import include, path, re_path from django.views.i18n import JavaScriptCatalog from django_registration.backends.one_step.views import RegistrationView from core.views import IndexTemplateView from users.forms import CustomUserForm urlpatterns = [ path('admin/', admin.site.urls), path('accounts/register/', RegistrationView.as_view(form_class=CustomUserForm, success_url='/'), name='django_registration_register'), path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), path('api/', include('users.api.urls')), path('api/', include('tasks.api.urls')), path('api-auth/', include('rest_framework.urls')), path('api/rest-auth/', include('rest_auth.urls')), path('api/rest-auth/registration', include('rest_auth.registration.urls')), re_path(r"^.*$", IndexTemplateView.as_view(), name="home-page") ] js_info_dict = { 'packages': ('reccurrence', ), } urlpatterns += [ url(r'^jsi18n/$', JavaScriptCatalog.as_view(), js_info_dict), ]