Пример #1
0
from django.conf.urls import url
from users.views import ListUsers, RegisterUser, DetailUpdateUser, \
    ObtainAuthToken

urlpatterns = (
    url(r'^$', ListUsers.as_view(), name='list_users'),
    url(r'^register', RegisterUser.as_view(), name='register_user'),
    url(r'^(?P<pk>\d+)', DetailUpdateUser.as_view(),
        name='user-detail'),
    url(r'^obtain-token', ObtainAuthToken.as_view(),
        name='obtain_auth_token'),
)
Пример #2
0
def test_signup_view_default_values():
    view = RegisterUser()
    assert view.success_url == reverse_lazy("users:login")
    assert view.form_class == RegisterUserForm
    assert view.template_name == "users/register.html"
    assert view.model == User
Пример #3
0
from django.urls import path
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token

from users.views import RegisterUser, UserViewSet

urlpatterns = [
    path('login/', obtain_jwt_token),
    path('register/', RegisterUser.as_view()),
]

router = DefaultRouter()
router.register('users', UserViewSet, base_name='users'),

urlpatterns += router.urls
Пример #4
0
    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 chirps.views import ChirpList
from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import logout
from django.core.urlresolvers import reverse_lazy
from users.views import RegisterUser

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^chirps/', include("chirps.urls")),
    url(r'^logout/$', logout, {'next_page':reverse_lazy('chirp_list')},
        name='logout'),
    url(r"^api/", include('api.urls')),
    url(r"^register/$", RegisterUser.as_view(), name="register"),
    url(r"^$", ChirpList.as_view()),
    url(r"^docs/", include('rest_framework_swagger.urls')),
    url('^', include('django.contrib.auth.urls'))


]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #5
0
#from drf_yasg import openapi

"""
schema_view = get_schema_view(
   openapi.Info(
      title="Snippets API",
      default_version='v1',
      description="Test description",
      terms_of_service="https://www.google.com/policies/terms/",
      contact=openapi.Contact(email="*****@*****.**"),
      license=openapi.License(name="BSD License"),
   ),
   public=True,
   permission_classes=(permissions.AllowAny,),
)
"""
urlpatterns = [
    path('admin/', admin.site.urls),
    path('register/', RegisterUser.as_view(), name='register'),
    path('token/', jwt_views.TokenObtainPairView.as_view(),
         name='token_obtain_pair'),
    path('token/refresh/', jwt_views.TokenRefreshView.as_view(), name='token_refresh'),
    path('projects/', include('projects.urls')),
    path('boards/', include('boards.urls')),
    path('me/', Me.as_view(), name="me"),
    path('notifications/', NotificationList.as_view(), name="notification-list"),
    #    re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    #    re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    #    re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #6
0
from django.urls import include, path
from pennychat.views import UpdateDeleteFollowUp
from users.views import (
    RegisterUser,
    UserExists,
    VerifyEmail,
    SendVerificationEmail,
)

# Wire up our API using automatic URL routing.

follow_up_detail = UpdateDeleteFollowUp.as_view()

urlpatterns = [
    path('auth/register/', RegisterUser.as_view(), name='register-user'),
    path('auth/verify/', VerifyEmail.as_view(), name='verify-email'),
    path('auth/verification-email/',
         SendVerificationEmail.as_view(),
         name='verification-email'),
    path('auth/exists/', UserExists.as_view(), name='user-exists'),
    path('auth/', include('dj_rest_auth.urls')),
    path('chats/', include('pennychat.urls')),
    path('follow-ups/<int:pk>/', follow_up_detail, name='followup-detail'),
    path('users/', include('users.urls'))
]
Пример #7
0
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from users import views
from users.views import RegisterUser, LoginUser, LogoutUser

urlpatterns = [
	url(r'^registro/$', RegisterUser.as_view(), name = 'registro'),
	url(r'^login/$', LoginUser.as_view(), name = 'login'),
	url(r'^salir/$', LogoutUser.as_view(), name = 'salir'),
	url(r'^cambiar_password/', 'django.contrib.auth.views.password_change', {'template_name':'users/passw_change.html', 'post_change_redirect':'entradas_list'}, name = "cambiar_passwd"),
	url(r'^usuarios_index/', views.usuarios_index, name = 'usuarios_index'),
	url(r'^borrar_usuario/(?P<usuario_id>\w)', views.usuario_borrar, name='usuario_borrar'),
] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
Пример #8
0
from django.conf.urls import include, url
from django.contrib import admin

from passengers.views import ListCreatePassenger, GetUpdatePassenger
from trips.views import TripListCreateView, TripRetrieveDeleteView
from users.views import (RegisterUser, LoginUser, LogoutUser, GetUpdateUser,
                         VerifyUserEmail, ChangePassword, RequestPasswordReset,
                         ResetPassword, VerifyPhone)

urlpatterns = [
    url(
        r'^api/v1/',
        include([
            url(r'^user/register/?$', RegisterUser.as_view(), name='register'),
            url(r'^user/login/?$', LoginUser.as_view(), name='login'),
            url(r'^user/logout/?$', LogoutUser.as_view(), name='logout'),
            url(r'^user/change-password/?$',
                ChangePassword.as_view(),
                name='change_pass'),
            url(r'^user/request-password/?$',
                RequestPasswordReset.as_view(),
                name='request_pass'),
            url(r'^user/reset-password/?$',
                ResetPassword.as_view(),
                name='reset_pass'),
            url(r'^user/verify-email/?$',
                VerifyUserEmail.as_view(),
                name='verify_email'),
            url(r'^user/verify-phone/?$',
                VerifyPhone.as_view(),
                name='verify_phone'),
Пример #9
0
from django.urls import path

from users.views import (RegisterUser, verify_otp, generate_otp,
                         generate_authorization, update_password,
                         SearchAccount, PincodeSearch, GetEarnings, GetLeads,
                         GetClients, GetCart, GetPlaylist, UpdateUser,
                         GetUserDetails, CreateAppointment, GetContact,
                         AdvisorProfile, send_sms)

urlpatterns = [
    path('user/otp/generate', generate_otp),
    path('user/otp/verify', verify_otp),
    path('user/register', RegisterUser.as_view()),
    path('user/authorization/generate', generate_authorization),
    path('user/update/password', update_password),
    path('user/update', UpdateUser.as_view()),
    path('user/leads', GetLeads.as_view()),
    path('user/clients', GetClients.as_view()),
    path('user/cart', GetCart.as_view()),
    path('user/playlist', GetPlaylist.as_view()),
    path('user/earnings', GetEarnings.as_view()),
    path('user/contacts', GetContact.as_view()),
    path('user/<slug:pk>/details', GetUserDetails.as_view()),
    path('user/profile/<slug:account__username>', AdvisorProfile.as_view()),
    path('user/appointment/create', CreateAppointment.as_view()),
    path('users/account/search', SearchAccount.as_view()),
    path('users/send-sms', send_sms),
    path('pincode/search', PincodeSearch.as_view()),
]