Changes between Version 10 and Version 11 of NewbieMistakes


Ignore:
Timestamp:
Oct 15, 2005, 7:46:43 AM (19 years ago)
Author:
hugo
Comment:

added hint on missing / in form actions

Legend:

Unmodified
Added
Removed
Modified
  • NewbieMistakes

    v10 v11  
    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.
     4
     5== POST to views loses POST data ==
     6
     7==== Symptom ====
     8
     9You are having a form that does a POST to some view and the view doesn't get the POST data from the form.
     10
     11==== Probable cause ====
     12
     13You might missing the / at the end of the form action. If that is the case, the CommonMiddleware redirects
     14to the exact name of the view - and that allways includes a trailing /. Because it does so by using the
     15standard HTTP redirection through Location header, it can't pass on the POST data - and that's why it get's lost.
     16
     17==== Solution ====
     18
     19Allways make sure that your form actions end with / like this:
     20
     21{{{
     22<form action="/registration/login/" method="POST">
     23<input name="username">
     24<input name="password" type="password">
     25</form>
     26}}}
     27
    428
    529== URLconf include() misbehaving ==
Back to Top