Commit 7905e2c8 authored by Administrator's avatar Administrator

home example with authenticate

parent 7fcf8281
......@@ -2,6 +2,8 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin
from gargantext_web.views import home
admin.autodiscover()
urlpatterns = patterns('',
......@@ -9,7 +11,9 @@ urlpatterns = patterns('',
# url(r'^$', 'gargantext_web.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^login/', include(admin.site.urls)),
url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS
url(r'^$', home),
)
from django.conf import settings
......
from django.shortcuts import redirect
from django.shortcuts import render
import datetime
from django.http import Http404, HttpResponse
from django.template.loader import get_template
from django.template import Context
def home(request):
if not request.user.is_authenticated():
return redirect('/login/?next=%s' % request.path)
now = datetime.datetime.now()
html = "<html><body>Il est %s.</body></html>" % now
return HttpResponse(html)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment