Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ------------------------------------------------------
- # ---------------------- views.py ----------------------
- # ------------------------------------------------------
- # -*- coding: utf-8 -*-
- from django.contrib.auth.decorators import login_required
- from django.shortcuts import render_to_response
- from django.template import Context, RequestContext
- @login_required
- def index(request):
- diccionario = {'login_logo':'banner_muestra.png',
- 'logo_description':'Banner de Muestra',
- 'username':'usuario',
- 'legend_footer':'Powered by Django-RecordStore'}
- return render_to_response('pos/index.html', diccionario)
- # ACÁ ES DONDE HABÍA CREADO UN MÉTODO PARA LOGIN, IGUAL QUE index() PERO LLAMADO login_form()
- # ------------------------------------------------------
- # ---------------------- urls.py -----------------------
- # ------------------------------------------------------
- # -*- coding: utf-8 -*-
- from django.conf import settings
- from django.conf.urls.defaults import *
- from django.contrib import admin
- admin.autodiscover()
- urlpatterns = patterns('',
- (r'.*logout/$', 'django.contrib.auth.views.logout_then_login'),
- (r'^admin/', include(admin.site.urls)),
- (r'^/?$', 'pos.views.index'),
- (r'pos/?$', 'pos.views.index'),
- # ESTE LO DEJÉ ASÍ AHORA, PARA QUE ME FUNCIONE
- (r'.*accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'registration/login.html'}),
- (r'.*accounts/profile/$', 'pos.views.index'),
- )
- # en produccion.
- if not settings.PRODUCCION:
- urlpatterns += patterns('django.views',
- (r'site_media/(.*)$', 'static.serve', {'document_root': settings.MEDIA_ROOT}),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement