進口在HTML模塊:沒有名爲 'Dajaxice'
<script src="/media/js/jquery-2.0.2.js"></script>
<script src="jquery.dajax.core.js"></script>
<script type="text/javascript">
function oneri()
{
Dajaxice.rezervationApp.oneri(Dajax.process)
}
</script>
我用:
在ajax.pyfrom django.template.loader import render_to_string
from dajaxice.decorators import dajaxice_register
from django.shortcuts import render
from rezervationApp.models import RoomType, Room, Market, Profile, Reservation
@dajaxice_register
def oneri(request, word):
dajax = Dajax()
p = Profile.objects.get(firstname__contains=word)
dajax.assign('#advice','innerHTML', p)
return dajax.json()
完全錯誤
<div class="span6"> <a href="#adviceModal" class="btn" role="button" onClick="oneri()" data-toggle="modal">Öneri Al</a></div>
:
ImportError at/
No module named 'Dajaxice'
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.5.1
Exception Type: ImportError
Exception Value:
No module named 'Dajaxice'
Exception Location: C:\Python33\lib\site-packages\dajaxice\core\__init__.py in <module>, line 3
但是,總是相同的錯誤。 我將其他文件配置爲dajax教程。 你有什麼想法嗎?
我的應用程序託管在heroku上,有沒有辦法修改__init__.py?或者還有其他解決方法嗎? –