Exemplo n.º 1
0
from django.conf.urls import url
from django.conf.urls import include
from django.http import HttpResponse
from django.contrib import admin
from . import views
from alunos.models import Student, Teacher, Grade
from alunos.views import StudentList, TeacherList, StudentCreate, StudentUpdate, StudentDelete, TeacherCreate, TeacherUpdate, TeacherDelete, StudentAddUser
from django.contrib.auth.decorators import login_required, permission_required

urlpatterns = [
	url(r'^',include('django.contrib.auth.urls')),
        url(r'^students/all', login_required(StudentList.as_view()),name ='student-list'),
        url(r'^teachers/all', login_required(TeacherList.as_view()),name ='teacher-list'),
	#url(r'^alunos/', TemplateView.as_view(template_name="alunos.html")),
    url(r'students/adduser', login_required(views.StudentAddUser), name == 'add_student_user'),
    url(r'students/add/$', login_required(StudentCreate.as_view()), name='student_add'),
    url(r'students/(?P<pk>[0-9]+)/$', login_required(StudentUpdate.as_view()), name='student_update'),
    url(r'students/(?P<pk>[0-9]+)/delete/$', login_required(StudentDelete.as_view()), name='student_delete'),
    url(r'teachers/add/$', login_required(TeacherCreate.as_view()), name='teacher_add'),
    url(r'teachers/(?P<pk>[0-9]+)/$', login_required(TeacherUpdate.as_view()), name='teacher_update'),
    url(r'teachers/(?P<pk>[0-9]+)/delete/$', login_required(TeacherDelete.as_view()), name='teacher_delete'),
]
Exemplo n.º 2
0
from django.conf.urls import include
from django.http import HttpResponse
from django.contrib import admin
from . import views
from alunos.models import Student, Teacher, Grade
from alunos.views import (
    StudentList,
    TeacherList,
    StudentCreate,
    StudentUpdate,
    StudentDelete,
    TeacherCreate,
    TeacherUpdate,
    TeacherDelete,
    StudentAddUser,
)

urlpatterns = [
    url(r"^", include("django.contrib.auth.urls")),
    url(r"^students/all", StudentList.as_view(), name="student-list"),
    url(r"^teachers/all", TeacherList.as_view(), name="teacher-list"),
    # url(r'^alunos/', TemplateView.as_view(template_name="alunos.html")),
    url(r"students/adduser", views.StudentAddUser, name == "add_student_user"),
    url(r"students/add/$", StudentCreate.as_view(), name="student_add"),
    url(r"students/(?P<pk>[0-9]+)/$", StudentUpdate.as_view(), name="student_update"),
    url(r"students/(?P<pk>[0-9]+)/delete/$", StudentDelete.as_view(), name="student_delete"),
    url(r"teachers/add/$", TeacherCreate.as_view(), name="teacher_add"),
    url(r"teachers/(?P<pk>[0-9]+)/$", TeacherUpdate.as_view(), name="teacher_update"),
    url(r"teachers/(?P<pk>[0-9]+)/delete/$", TeacherDelete.as_view(), name="teacher_delete"),
]
Exemplo n.º 3
0
urlpatterns = [
#	url(r'^',StudentList.as_view(),name='main'),
#    url(r'^/base.css', "base.css", name='base.css'),
    url(r'^students/add/$', StudentCreate.as_view(), name='student_add'),
    url(r'^students/(?P<pk>[0-9]+)/$', StudentUpdate.as_view(), name='student_update'),
    url(r'^students/(?P<pk>[0-9]+)/delete/$', StudentDelete.as_view(), name='student_delete'),
	url(r'^orientadores/add/$', OrientadorCreate.as_view(), name='orientador_add'),
    url(r'^orientadores/(?P<pk>[0-9]+)/$', OrientadorUpdate.as_view(), name='orientador_update'),
    url(r'^students/(?P<pk>[0-9]+)/delete/$', OrientadorDelete.as_view(), name='orientador_delete'),
    url(r'^register/$',register_user ),
    #url(r'^captcha/', include('captcha.urls')),
    #url(r'^',include('django.contrib.auth.urls')),
    url(r'^login/$', auth_views.login),
    url(r'^password_change/$',auth_views.password_change,name='password_change'),
    url(r'^password_reset/$',auth_views.password_reset,name='password_reset'),
    url(r'^password_reset/done/$',auth_views.password_reset_done,name='password_reset_done'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',auth_views.password_reset_confirm,name='password_reset_confirm'),
#    url(r'^students/login/$', views.Login, name='login'),
    url(r'^logout/$', auth_views.logout,{'next_page':'homepage'}, name ='logout'),
	#url(r'^alunos/', TemplateView.as_view(template_name="alunos.html")),
#    url(r'students/adduser', views.StudentAddUser, name = 'add_student_user'),
    #url(r'^logoutlogin/', auth_views.logout_then_login{'login_url':'login'},name='logout-login')
    url(r'^admin/', include(admin.site.urls)),
    url(r'^students/$',StudentList.as_view(),name='student-list'),
    url(r'^orientadores/$',OrientadorList.as_view(),name='orientadores-list'),
#    url(r'^',include('django.contrib.auth.urls')),
    url(r'^home/$',HomePageView.as_view(),name='homepage'),
    url(r'^',HomePageView.as_view(),name='main'),
]# + staticfiles_urlpatterns() + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

Exemplo n.º 4
0
from django.conf.urls import url
from django.conf.urls import include
from django.http import HttpResponse
from django.contrib import admin
from . import views
from alunos.models import Student, Teacher, Grade
from alunos.views import StudentList, TeacherList, StudentCreate, StudentUpdate, StudentDelete, TeacherCreate, TeacherUpdate, TeacherDelete, StudentAddUser

urlpatterns = [
	url(r'^',include('django.contrib.auth.urls')),
        url(r'^students/all', StudentList.as_view(),name ='student-list'),	
        url(r'^teachers/all', TeacherList.as_view(),name ='teacher-list'),
	#url(r'^alunos/', TemplateView.as_view(template_name="alunos.html")),
    url(r'students/adduser', views.StudentAddUser, name == 'add_student_user'),
    url(r'students/add/$', StudentCreate.as_view(), name='student_add'),
    url(r'students/(?P<pk>[0-9]+)/$', StudentUpdate.as_view(), name='student_update'),
    url(r'students/(?P<pk>[0-9]+)/delete/$', StudentDelete.as_view(), name='student_delete'),
    url(r'teachers/add/$', TeacherCreate.as_view(), name='teacher_add'),
    url(r'teachers/(?P<pk>[0-9]+)/$', TeacherUpdate.as_view(), name='teacher_update'),
    url(r'teachers/(?P<pk>[0-9]+)/delete/$', TeacherDelete.as_view(), name='teacher_delete'),
]
Exemplo n.º 5
0
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. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.http import HttpResponse
from django.contrib import admin
from alunos.models import Student, Teacher
from alunos.views import StudentList, TeacherList, StudentCreate, StudentUpdate, StudentDelete, TeacherCreate, TeacherUpdate, TeacherDelete

urlpatterns = [
	url(r'^',include('django.contrib.auth.urls')),
        url(r'^students/', StudentList.as_view()),	
        url(r'^teachers/', TeacherList.as_view()),
	#url(r'^alunos/', TemplateView.as_view(template_name="alunos.html")),
    
    url(r'student/add/$', StudentCreate.as_view(), name='student_add'),
    url(r'student/(?P<pk>[0-9]+)/$', StudentUpdate.as_view(), name='student_update'),
    url(r'student/(?P<pk>[0-9]+)/delete/$', StudentDelete.as_view(), name='student_delete'),
    url(r'teacher/add/$', TeacherCreate.as_view(), name='teacher_add'),
    url(r'teacher/(?P<pk>[0-9]+)/$', TeacherUpdate.as_view(), name='teacher_update'),
    url(r'teacher/(?P<pk>[0-9]+)/delete/$', TeacherDelete.as_view(), name='teacher_delete'),
    url(r'^admin/', include(admin.site.urls)),
]