Last active
August 29, 2015 14:04
-
-
Save andreyshuster/f540f1866aa7b9c7e166 to your computer and use it in GitHub Desktop.
django form handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@render_to('contact.html') | |
def contact(request): | |
form = ContactForm(request.POST or None) | |
if form.is_valid(): | |
# обрабатываем данные. Например, делаем form.save() | |
# ... | |
return redirect('url_name', param1=value) | |
return {'form': form} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment