Django - Strange behavior using static files

二次信任 提交于 2019-12-02 11:59:51

I don't know whether this will fix the issue, but your url patterns look a little confused. Each urlpatterns object should only have one prefix string as its first argument. You have 'haystack.views' and then later ''.

You are passing callable objects instead of strings in your url patterns, so using the empty string '' for your prefix is fine.

urlpatterns = patterns(
    '',                   
    url(r'^resultados/$', FacetedSearchView(template='emp1001br/pgresultados.html', searchqueryset=sqs, form_class=FacetedSearchForm), name='haystack_search'),                 
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), # To support static files
    url(r'^$', main_page),
    (r'^iframe/$', i_frame),
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!