On Wed, 2008-05-14 at 16:54 +0800, @@ wrote:
>
>
> On 5/14/08, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
>
> Why don't you just replace the second line in your root
> URLconf with
> this then?
>
> (r'^$', 'app.views.index'),
> ^ ^ quotes here!
>
> thanks, this is what i am using right now.
> the reason i want use a callable view function here is i can add
> decorator(like login_required) here, and make sure the view does
> exist(in case the wrong view name was typed).
>
Well, you can't have it both ways. Either you import app, or you use the
string notation.
You could create another URLconf module of course, but I don't know why
anyone would want to do that. It's much easier to just import the
app.views module (but maybe you have good reasons to not import the
module here?)
include('app.just_my_index_view.py') instead of include('app.urls')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---