def responsive_urls(): if (settings.DEBUG is True and settings.DEV_RESIZE_SERVER is True): return static(settings.MEDIA_URL, view=DevResizeServer.as_view(), document_root=settings.MEDIA_ROOT) else: return [url( r'^media/(?P<path>.*)$', ResponsiveView.as_view() )]
from django.conf.urls.static import url from .views_inicio.docente import DocenteVista, DocenteAgregar, DocenteEditar, DocenteEliminar from .views_inicio.apoderado import ApoderadoAgregar, ApoderadoActualizar from .views_inicio.estudiante import EstudianteVista, EstudianteAgregar, EstudianteEditar, EstudianteEliminar from .views_inicio.persona import PersonaBuscar from .views_inicio.inicio import Inicio urlpatterns = [ # Inicio - Home url(r'^$', Inicio.as_view(), name='inicio'), # Persona url(r'persona/buscar/(?P<dni>\d+)$', PersonaBuscar.as_view(), name='persona_buscar'), # Estudiante url(r'estudiante/$', EstudianteVista.as_view(), name='estudiante_vista'), url(r'estudiante/agregar/$', EstudianteAgregar.as_view(), name='estudiante_agregar'), url(r'estudiante/editar/(?P<pk>\d+)$', EstudianteEditar.as_view(), name='estudiante_editar'), url(r'estudiante/eliminar/(?P<pk>\d+)$', EstudianteEliminar.as_view(), name='estudiante_eliminar'), # Apoderado url(r'estudiante/(?P<estudiante>\d+)/agregar/apoderado/$',
from django.contrib import admin from django.urls import path from home import views from django.views.static import serve from django.conf.urls.static import url urlpatterns = [ path("", views.index, name='home'), path("aboutpage", views.aboutpage, name='aboutpage'), path("services", views.services, name='services'), path("contact", views.contact, name='contact'), path("login", views.login, name='login'), path("wallpapers", views.wallpapers, name='wallpapers'), path("log", views.blog, name='log'), path("wallpapers", views.wallpapers, name='wallpapers'), path("movies", views.movies, name='movies'), url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}), ]
1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, url 2. Add a URL to urlpatterns: url('blog/', include('blog.urls')) """ from . import views from django.conf.urls import include from django.conf import settings from django.conf.urls.static import static, url urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^textos/$', views.TextosListView.as_view(), name='textos'), url(r'^nuevotexto/$', views.TextoNuevoView, name='nuevotexto'), url(r'^autores/$', views.AutoresListView.as_view(), name='autores'), url(r'^nuevoautor/$', views.AutorNuevoView, name='nuevoautor'), url(r'^autores/$', views.AutoresListView.as_view(), name='autores'), url(r'^resultados/$', views.ResultadosView, name='resultados'), url(r'^resultadoaso/$', views.ResultadoasoView, name='resultadoaso'), url(r'^dashboard/$', views.DashboardView, name='dashboard'), url(r'^cargacsv/$', views.CargaCSVView, name='cargacsv'), url(r'^textodetalle/(?P<pk>\d+)/$', views.TextoDetailView.as_view(), name='textodetalle'), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.conf import settings from django.conf.urls.static import url, static from .views import ( PhotoListView, PhotoDetailView, ) urlpatterns = [ url(r'^$', PhotoListView.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', PhotoDetailView.as_view(), name='detail'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls.static import url, static from . import views urlpatterns = [ url(r'^$', views.post_list, name='post_list'), url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'), url(r'^post/new/$', views.post_new, name='post_new'), url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'), url(r'^post/(?P<pk>\d+)/delete/$', views.post_delete, name='post_delete'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)