Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // view
- def profile(request):
- profile = RegistrationProfile.objects.filter(user=request.user)[0]
- if request.method == 'POST':
- form = ProfileForm(request.POST,instance=profile)
- if form.is_valid():
- form.save()
- profileForm = ProfileForm(instance=profile)
- return render_to_response('accounts/profile.html',
- { 'profileForm':profileForm},
- context_instance=RequestContext(request))
- //model contains
- photo = models.ImageField(upload_to='profile')
- // media
- MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'core/web')
- PROJECT_ROOT = os.path.dirname(__file__)
Add Comment
Please, Sign In to add comment