Exemple #1
0
from django.conf.urls import url
from app.usuario.views import RegistroUsuario, RegistroList, RegistroUpdate, RegistroDelete, ValidarLogin
from django.contrib.auth.decorators import login_required

urlpatterns = [
    url(r'^registrar$', RegistroUsuario.as_view(), name="registrar"),
    url(r'^listar$',
        login_required(RegistroList.as_view()),
        name='usuario_listar'),
    url(r'^editar/(?P<pk>\d+)/$',
        login_required(RegistroUpdate.as_view()),
        name='usuario_editar'),
    url(r'^eliminar/(?P<pk>\d+)/$',
        login_required(RegistroDelete.as_view()),
        name='usuario_eliminar'),
    url(r'^validar$', ValidarLogin, name="usuario_validar"),
]
Exemple #2
0
from django.conf.urls import url

from app.usuario.views import RegistroUsuario

urlpatterns = [url(r'^registrar', RegistroUsuario.as_view(), name='registrar')]
Exemple #3
0
from django.conf.urls import url, include
from app.usuario.views import RegistroUsuario
from django.contrib.auth.decorators import permission_required
from app.usuario.views import UsuarioList, UsuarioUpdate, UsuarioDelete

urlpatterns = [
    url(r'^registrar$', (RegistroUsuario.as_view()), name='registrar'),
    url(r'^listar$', UsuarioList.as_view(), name='listar_usuario'),
    url(r'^editar/(?P<pk>\d+)/$',
        UsuarioUpdate.as_view(),
        name='editar_usuario'),
    url(r'^eliminar/(?P<pk>\d+)/$',
        UsuarioDelete.as_view(),
        name='eliminar_usuario'),
]
Exemple #4
0
from django.conf.urls import url, include
from app.usuario.views import RegistroUsuario, ListarUsuarios, listadousuarios, UserAPI
from django.contrib.auth.decorators import login_required

urlpatterns = [
    url(r'^registrar',
        login_required(RegistroUsuario.as_view()),
        name='registrar'),
    url(r'^api', UserAPI.as_view(), name="api"),
    url(r'^listado', listadousuarios, name="listado"),
]
"""novillo_mascotas URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 . import views
from app.usuario.views import RegistroUsuario

urlpatterns = [
    path('', views.index, name='usuarios'),
    path('registrar/', RegistroUsuario.as_view(), name='registrar')
]