Changes between Version 20 and Version 21 of NewbieMistakes


Ignore:
Timestamp:
Jun 7, 2006, 10:49:20 PM (20 years ago)
Author:
Adrian Holovaty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewbieMistakes

    v20 v21  
    1 = NewbieMistakes =
     1= Newbie mistakes =
    22
    33Please feel free to share the things that tripped you up when you started with Django. We'll try to improve Django's error handling to catch such mistakes in the future.
    … …  
    77==== Symptom ====
    88
    9 You are having a form that does a POST to some view and the view doesn't get the POST data from the form.
     9You've got a form that does a POST to some view, and the view doesn't get the POST data from the form.
    1010
    1111==== Probable cause ====
    1212
    13 You might missing the / at the end of the form action. If that is the case, the CommonMiddleware redirects
    14 to the exact name of the view - and that always includes a trailing /. Because it does so by using the
    15 standard HTTP redirection through Location header, it can't pass on the POST data - and that's why it gets lost.
     13You might be missing the / at the end of the form {{{action}}}. If that's the case, the {{{CommonMiddleware}}} (check your {{{MIDDLEWARE_CLASSES}}} redirects to the exact name of the view - and that always includes a trailing slash. Because it does so by using the standard HTTP redirection through Location header, it can't pass on the POST data - and that's why it gets lost.
    1614
    1715==== Solution ====
    1816
    19 Allways make sure that your form actions end with / like this:
     17Always make sure that your form actions end with a slash, like this:
    2018
    2119{{{
    … …  
    2523</form>
    2624}}}
     25
     26Note that Django now attempts to catch this problem, as of [3109].
    2727
    2828
Back to Top