本文介绍了Django-easy-pjax不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用。
我有这个基础代码:
I use from django-easy-pjax. I have this base code:
ubase.html
ubase.html
<script type="text/javascript" src="{% static "/static/js/jquery-1.9.1.min.js" %}"></script>
<script src="{% static "/static/js/jquery.pjax.js" %}"></script>
{% block side%}
It is {% now "c" %}
sdfdsfdsf
<a href="/uu/">uu</a>
<a href="/uu1/">uu1</a>
<br/><br/><br/><br/><br/><br/>
{%endblock side%}
{%block main%}
sdfdfsdfdsfdsfdfdsf
{%endblock main%}
entry_index.html
entry_index.html
{% extends "ubase.html"|pjax:request %}
{%block main%}
1
{%endblock main%}
entry_index2.html
entry_index2.html
{% extends "ubase.html"|pjax:request %}
{%block main%}
2
{%endblock main%}
我的意见:
def entry_index1( request ):
return render_to_response('entry_index1.html', {}, context_instance = RequestContext(request))
def entry_index( request ):
return render_to_response('entry_index.html', {}, context_instance = RequestContext(request))
和我的url
url(r'^uu/$', search_views.entry_index),
url(r'^uu1/$', search_views.entry_index1),
但是当我使用点击uu链接或uu1链接时间更改和pjax不工作真的像这样
Make sure you have django.core.context_processors.request
added to TEMPLATE_CONTEXT_PROCESSORS
and pjax templates to answer for PJAX request, in your case pjax_ubase.html
. Take a look at the source code of the template tag: https://github.com/nigma/django-easy-pjax/blob/master/easy_pjax/templatetags/pjax_tags.py
这篇关于Django-easy-pjax不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!