Tuesday, August 25, 2015

Re: Using ModelForms

So the form should have action = '/stats/submit/' ? If I do this, whenever I click submit, it brings me back to the submission page, telling me that I didn't submit a file even if I did.

On Tuesday, August 25, 2015 at 11:05:59 AM UTC-7, Hugo Osvaldo Barrera wrote:
 
On Tue, Aug 25, 2015, at 14:16, Hugo Kitano wrote:
Noted.  "/stat/s" is an index page.  Here is what my urls.py looks like.  Also, by using print statements, I've realized that the request.method is always GET, not POST, which makes it so no model instance is ever saved.  What does this GET request refer to specifically?
 
Thanks
 
 
 
 

 
Your form posts to /stats/, but /stats/ does not map to your view method `submit`. You need to post data to the view that's processing it, so fix t form or the urls.py.
 
On Monday, August 24, 2015 at 3:29:40 PM UTC-7, Hugo Osvaldo Barrera wrote:
 
On Mon, Aug 24, 2015, at 16:41, Hugo Kitano wrote:
I'm actually now pretty certain that my html file is what's causing it to not work
 

 
Including your message as an inline image rather than simple text will reduce the amount of people that can actually read your message (and complicate following the thread).
 
Does "/stats/" point to the above mentioned view ("submit")? What does your urls.py look like? Did you try putting a "print" (or anything alike) into the view function to really make sure it's the one being called?
 
--
Hugo Osvaldo Barrera
 

Email had 1 attachment:

  • Auto Generated Inline Image 1
      12k (image/png)
 
--
Hugo Osvaldo Barrera
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5cd4b875-2f32-4dca-8a4b-231695fec586%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment