# HG changeset patch # User Nishanth Amuluru # Date 1294379376 -19800 # Node ID 4dfcc826b241c54a69ed4272a9edda1f1edb4815 # Parent 1ce8241a9628ca98861ac0273df02b35026e14c7 Created a view for viewing profile diff -r 1ce8241a9628 -r 4dfcc826b241 profile/views.py --- a/profile/views.py Fri Jan 07 11:11:53 2011 +0530 +++ b/profile/views.py Fri Jan 07 11:19:36 2011 +0530 @@ -1,1 +1,15 @@ -# Create your views here. +from django.shortcuts import render_to_response, redirect + +from django.contrib.auth.decorators import login_required + +@login_required +def view_profile(request): + + user = request.user + + profile = user.get_profile() + + context = {"user": user, + "profile": profile, + } + return render_to_response("/profile/view.html", context) diff -r 1ce8241a9628 -r 4dfcc826b241 urls.py --- a/urls.py Fri Jan 07 11:11:53 2011 +0530 +++ b/urls.py Fri Jan 07 11:19:36 2011 +0530 @@ -22,6 +22,6 @@ url(r'^accounts/register/$', register, {'form_class': CustomRegistrationForm}, name='registration_register'), - + (r'^accounts/profile/', include('pytask.profile.urls')), (r'^accounts/', include('registration.urls')), )