On Fri, 2007-03-30 at 03:01 -0700, Helge wrote:
> Hi,
> 
> I have a function in my views.py that expects POST data from a form.
> As long as this function is called correctly, i. e. from within the
> form, everything works fine. But if I call this function directly by
> typing it in the URL, I'm getting an error page complaining about
> missing data (which is correct and okay for me, but may possibly seem
> a bit strange for an end user).
> 
> I wonder if there is a standard way in Django to prevent URLs from
> being called directly.

That's not really the way the web works -- you can't reliably tell the
difference between called from your form and called directly until you
start looking at the data.

The view function should check if the required data is present and, if
not, return an appropriate error page. You could even check that it is
called as a POST and return an error if they don't do that, too.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to