from __future__ import absolute_import, unicode_literals from django.conf.urls import url from accounts.views import DashboardView, UpdateUserForm, SecuredropEditView urlpatterns = [ url(r'^dashboard$', DashboardView.as_view(), name='dashboard'), url(r'^change_name/(?P<pk>[-\w]+)/', UpdateUserForm.as_view(), name='account_change_name'), url(r'^instances/add/$', SecuredropEditView.as_view(), name='securedroppage_add'), url(r'^instances/(?P<slug>[\w-]+)/$', SecuredropEditView.as_view(), name='securedroppage_edit'), ]
from django.conf.urls import patterns, url, include #from django.views.generic.base import RedirectView from accounts.views import ( AccountRegistrationView, BillingView, DashboardView, FavoriteView, LoginView, SettingsView, UpdateBillingView) urlpatterns = patterns( 'accounts.views', url(r'', include('social.apps.django_app.urls', namespace='social')), url(r'^register/$', AccountRegistrationView.as_view(), name='register'), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^logout/$', 'logout', name='logout'), url(r'^dashboard/$', DashboardView.as_view(), name="dashboard"), url(r'^settings/$', SettingsView.as_view(), name="settings"), url( r'^billing/update_card/$', UpdateBillingView.as_view(), name='update_card'), url(r'^favorites/$', FavoriteView.as_view(), name="favorites"), url(r'^billing/$', BillingView.as_view(), name="billing"), )
from django.contrib.auth.views import LoginView, LogoutView from django.urls import path from accounts.views import SignUpView, ActivateView, DashboardView, CreateWebsite urlpatterns = [ path('signup', SignUpView.as_view(), name='signup'), path('signup/<str:account_type>', SignUpView.as_view(), name='signup-account-type'), path('activate/<str:uidb64>/<str:token>', ActivateView.as_view(), name='activate'), path('login', LoginView.as_view(template_name='accounts/login.html', redirect_authenticated_user=True), name='login'), path('account', DashboardView.as_view(), name='account'), path('account/new-website', CreateWebsite.as_view(), name='create-website'), path('logout', LogoutView.as_view(), name='logout'), ]
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.urls import url, include from django.contrib import admin from accounts.views import DashboardView from projects.urls import api_urlpatterns from accounts.urls import account_urlpatterns urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', DashboardView.as_view(), name="main"), url(r'^', include('accounts.urls')), url(r'^projects/', include('projects.urls')), # include project endpoints url(r'^api/', include(api_urlpatterns, namespace='api')), url(r'^api/', include(account_urlpatterns)), ]
from django.conf.urls import patterns, url, include from django.views.generic.base import RedirectView from django.contrib.auth.decorators import login_required from accounts.views import (FavoriteView, BillingView, SettingsView, DashboardView, UpdateBillingView) urlpatterns = patterns( 'accounts.views', url(r'', include('social.apps.django_app.urls', namespace='social')), url(r'^dashboard/$', login_required(DashboardView.as_view()), name="dashboard"), url(r'^settings/$', login_required(SettingsView.as_view()), name="settings"), url(r'^billing/update_card/$', login_required(UpdateBillingView.as_view()), name='update_card'), url(r'^favorites/$', login_required(FavoriteView.as_view()), name="favorites"), url(r'^billing/$', login_required(BillingView.as_view()), name="billing"), url(r'^login/$', RedirectView.as_view(url="/accounts/login/github")), url(r'^logout/$', 'logout', name='logout'), )
from django.conf.urls import * from django.views.generic.base import RedirectView from django.contrib.auth.decorators import login_required from accounts.views import ( FavoriteView, BillingView, SettingsView, DashboardView, UpdateBillingView) urlpatterns = patterns( 'accounts.views', url(r'', include('social_auth.urls')), url(r'^dashboard/$', login_required(DashboardView.as_view()), name="dashboard"), url( r'^settings/$', login_required(SettingsView.as_view()), name="settings"), url( r'^billing/update_card/$', login_required(UpdateBillingView.as_view()), name='update_card'), url( r'^favorites/$', login_required(FavoriteView.as_view()), name="favorites"), url(r'^billing/$', login_required(BillingView.as_view()), name="billing"), url(r'^login/$', RedirectView.as_view(url="/accounts/login/github")), url(r'^logout/$', 'logout', name='logout'), )
from django.contrib.auth.views import LogoutView from django.urls import path from accounts.views import RegisterView, DashboardView, LoginView urlpatterns = [ path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('dashboard/', DashboardView.as_view(), name='dashboard'), path('register/', RegisterView.as_view(), name='register'), ]
from django.conf.urls import url, include from accounts.views import SettingsView, PasswordRecoveryView, LogoutView, DashboardView, \ SubscribeView, MySignUpView, MyLoginView, AuthorDetailView urlpatterns = [ url(r'^dashboard/$', DashboardView.as_view(), name='dashboard'), url(r'^signup/$', MySignUpView.as_view(), name='signup'), url(r'^login/$', MyLoginView.as_view(), name='login'), url(r'^logout/$', LogoutView.as_view(), name='logout'), url(r'^password_recovery/$', PasswordRecoveryView.as_view(), name='password_recovery'), url(r'^settings/$', SettingsView.as_view(), name='settings'), url(r'^author/(?P<pk>\d+)/$', AuthorDetailView.as_view(), name='author'), url(r'^subscribe/$', SubscribeView.as_view(), name='subscribe'), url(r'', include('allauth.urls')), ]
from django.conf.urls import patterns, url, include #from django.views.generic.base import RedirectView from accounts.views import (AccountRegistrationView, BillingView, DashboardView, FavoriteView, LoginView, SettingsView, UpdateBillingView) urlpatterns = patterns( 'accounts.views', url(r'', include('social.apps.django_app.urls', namespace='social')), url(r'^register/$', AccountRegistrationView.as_view(), name='register'), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^logout/$', 'logout', name='logout'), url(r'^dashboard/$', DashboardView.as_view(), name="dashboard"), url(r'^settings/$', SettingsView.as_view(), name="settings"), url(r'^billing/update_card/$', UpdateBillingView.as_view(), name='update_card'), url(r'^favorites/$', FavoriteView.as_view(), name="favorites"), url(r'^billing/$', BillingView.as_view(), name="billing"), )
from django.conf.urls import * from django.views.generic import TemplateView from django.views.generic.base import RedirectView from django.contrib.auth import logout as auth_logout from django.contrib.auth.decorators import login_required from accounts.views import BillingView, SettingsView, DashboardView urlpatterns = patterns('accounts.views', url(r'', include('social_auth.urls')), url(r'^dashboard/$', login_required(DashboardView.as_view()), name="dashboard" ), url(r'^favorites/$', 'favorites', name="favorites"), url(r'^settings/$', login_required(SettingsView.as_view()), name="settings"), url(r'^billing/$', login_required(BillingView.as_view()), name="billing" ), url(r'^login/$', RedirectView.as_view(url="/accounts/login/github") ), url(r'^logout/$', 'logout', name='logout'), )