Skip to content

Instantly share code, notes, and snippets.

@bellthoven
Created February 6, 2009 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bellthoven/59386 to your computer and use it in GitHub Desktop.
Save bellthoven/59386 to your computer and use it in GitHub Desktop.
from django.http import HttpResponse,HttpResponseRedirect
from django.shortcuts import render_to_response
from crongd.accounts.forms import LoginForm
def root(request):
if request.user.is_authenticated():
return HttpResponseRedirect('/account/profile')
else:
vars = {'user': request.user, 'loginForm': LoginForm()}
html = render_to_response('root.html',vars)
return HttpResponse(html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment