Hello Kyle,

I have no clue of what's happening at your Home object request but you have two urls sharing the same name. You can allow the two urls in the same pattern like this:

url(r'^(index\.html/)?$', views.index, name='index'),

Here, the group (index\.html/) can be found once or not at all thanks to the '?'.

Best Regards,
M

Le 14/11/2014 05:33, RLF_UNIQUE a écrit :
Did some more testing, seems like it's completely skipping the views.py,
and going straight to loading index.html, any way to force it to
dynamically load?

On Thursday, November 13, 2014 9:37:27 PM UTC-6, RLF_UNIQUE wrote:
Hello,

I'm having this weird situation where if you go to my website like this
www.mywebsite.com
vs like this
www.mywebsite.com/index.html

I'm getting different values.

*urls.py*
urlpatterns += patterns('',
       url(r'^index.html$',               views.index,
name='index'),
       url(r'^$',                              views.index,
name='index'),
)

*view.py*
def index(request):
    home_list = Home.objects.all()[:1]
context = {'home_list': home_list}
    return render_to_response('index.html', context)

*index.html*
{% extends 'base.html' %}
{% block content %}
   test
       {% for home in home_list %}
       {{home.description|safe}}
       {% endfor %}
   {% endblock %}

when I just go to mysite.com, I only get "test", whereas when I go to
mysite.com/index.html, I get "test" as well as the home variable.

It almost seems like something isn't loading in the proper order?

Thanks
Kyle


--
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+unsubscr...@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/546591FC.5060002%40yahoo.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to