> urlpatterns = patterns('',
>     (r'/step-1.html', 'billpay.views.DoPayDetailForm'),
> )
>
> Wouldn't this call the dopaydetailform view if you went to  the page /
> step-1.html ?

At this stage, while you're still learning, I would AVOID making URL
mappings that "appear" to be HTML files, because you'll end up
confusing yourself.  (Django will let you do stuff like that later, if
you have some compelling *reason* for it).

But the way it works is the urlpatterns map a URL to a Python "views"
function, and this mapping has NOTHING to do with the name of your
template.

This would work equally well and be less confusing:
| # urls.py
| urlpatterns = patterns('',
|     (r'/step-1/$', 'billpay.views.DoPayDetailForm'),
| )

Visiting "http://yoursite/step-1/"; will call the DoPayDetailForm()
function in your billpay/views.py and pass it an HTTP Request
parameter.  Simple.

The TEMPLATE (which you named step-1.html) doesn't come into the
picture until that code returns an HTTP Response object.  The first
parameter of render_to_response() is the template name, which has
_nothing_ to do with the URL mapping.

You can map the URL "/step-1/" and name the template step-1.html if
you want, but that's merely a coincidence for your own convenience;
there's no ACTUAL direct relationship between those names.

I'm probably overemphasizing a simple point, but it seems like you
might've assumed there is some "connection" where there isn't one,
since you put that unusual ".html" into your URL mapping.

--~--~---------~--~----~------------~-------~--~----~
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