Created
January 28, 2014 02:49
-
-
Save joshkehn/8661501 to your computer and use it in GitHub Desktop.
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
def some_view (request): | |
# Could substitute `None` with some other default value | |
key = request.POST.get("key", None) | |
return render(request, "mytemplate.html", {"key": key}) | |
# In mytemplate.html you'll now have `key` available with whatever was submitted via the form. Note | |
# that there is NO validation here, you should probably be using a form to capture the input, | |
# validate it, and return it. https://docs.djangoproject.com/en/dev/ref/forms/api/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment