This may just be 5:00 AM stupid but:

I have an assortment of html files generated by a WYSIWYG editor (no
django markup).

I merge these into the polls tutorial and can display the index page
at http://127.0.0.1:8000/polls/ , apparently correctly

using views.py:

def index(request):
    latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
    t = loader.get_template('polls/index.html')
    c = Context({
        'latest_poll_list': latest_poll_list,
    })
    return HttpResponse(t.render(c))

and urls.py:

    (r'^polls/$', 'Mysite.polls.views.index'),


Wishing to display the other pages, I..
add to urls.py:

    (r'^polls/(?P<name>.+)$', 'Mysite.polls.views.static'),

add to views.py:

def static(request, name):
    return render_to_response('polls/%s' % name ,{'id': 1})


Now http://127.0.0.1:8000/polls/about.html displays the about page,
but badly
and now http://127.0.0.1:8000/polls/  displays the index page
similarly badly.
If  I rename 'static' in EITHER views.py OR urls.py then
http://127.0.0.1:8000/polls/ displays correctly again

???


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

Reply via email to