from django.conf.urls import patterns, include, url from django.contrib.auth.decorators import login_required from users.views import (SignupView, SigninView, AccountSettingsView, ForgotPasswordView) from notes.views import NoteListView urlpatterns = patterns('', # user relates urls url(r'^signup/', SignupView.as_view(), name='signup'), url(r'^signin/', SigninView.as_view(), name='signin'), url(r'^account/', login_required(AccountSettingsView.as_view()), name='account_settings'), url(r'^forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'), url(r'^signout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='signout'), # notes url(r'^notes/', include('notes.urls')), # pads url(r'^pads/', include('pads.urls')), url(r'^$', login_required(NoteListView.as_view()), name='home'), )
from django.conf.urls import include, url from django.contrib.auth.decorators import login_required from django.contrib.auth.views import logout from users.views import (SignupView, SigninView, AccountSettingsView, ForgotPasswordView) from notes.views import NoteListView from django.contrib import admin admin.autodiscover() urlpatterns = [ # user relates urls url('admin/', admin.site.urls), url(r'^signup/', SignupView.as_view(), name='signup'), url(r'^signin/', SigninView.as_view(), name='signin'), url(r'^account/', login_required(AccountSettingsView.as_view()), name='account_settings'), url(r'^forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'), url(r'^signout/$', logout, {'next_page': '/'}, name='signout'), # notes url(r'^notes/', include('notes.urls')), # pads url(r'^pads/', include('pads.urls')), url(r'^$', login_required(NoteListView.as_view()), name='home'), ]
from django.urls import path from users.views import SignupView, SigninView app_name = 'users' urlpatterns = [ path('', SignupView.as_view(), name='user_signup'), path('sign-in/', SigninView.as_view(), name='user_signin'), ]
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 from django.contrib import admin from reports.views import HomeView, CreateView #AnonymousView, HelpView, ExperienceView, ContactoView from users.views import LoginView, LogoutView, SigninView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', HomeView.as_view(), name='home'), # Reports URLs url(r'^new$', CreateView.as_view(), name='create_report'), # url(r'^anonimato$', AnonymousView.as_view(), name='anonimato'), # url(r'^help$', HelpView.as_view(), name='ayuda'), # url(r'^experiencias$', ExperienceView.as_view(), name='experiencias'), # url(r'^contacto$', ContactoView.as_view(), name='contancto'), # Users URLs url(r'^registro$', SigninView.as_view(), name='new_user'), url(r'^login$', LoginView.as_view(), name='users_login'), url(r'^logout$', LogoutView.as_view(), name='users_logout'), ]
from django.urls import path from users.views import SignupView,SigninView urlpatterns = [ path('/signup',SignupView.as_view()), path('/signin',SigninView.as_view()), ]
from users.api import UserViewSet, FollowUserViewSet from users.views import LoginView, SigninView, LogoutView, ProfileView, Followers, ResetPasswordRequestView, \ PasswordResetConfirmView from django.conf import settings from django.conf.urls.static import static router = DefaultRouter() router.register('users', UserViewSet) router.register('follow', FollowUserViewSet) urlpatterns = [ # API URLS url(r'^api/1.0/', include(router.urls)), #Web urls url(r'^login$', LoginView.as_view(), name='users_login'), url(r'^signin$', SigninView.as_view(), name='users_signin'), url(r'^logout$', LogoutView.as_view(), name='users_logout'), url(r'^profile/@(?P<follow_user>\w+)/following', Followers.as_view(), name='list_user_following'), url(r'^profile/@(?P<followed_user>\w+)/followed', Followers.as_view(), name='list_user_followed'), url(r'^profile$', views.edit_user, name='users_update'), url(r'^@(?P<username>\w+)$', ProfileView.as_view(), name='user_profile'), url(r'^reset_password$', ResetPasswordRequestView.as_view(), name="reset_password"), url(r'^account/reset_password_confirm/(?P<uidb64>.+)/(?P<token>.+)$', PasswordResetConfirmView.as_view(), name='reset_password_confirm'),