문제

Tried to get on with Dajaxice, set simple project and then got this:

No module named 'Dajaxice'

Traceback highlights 2 cases below:

C:\study\django\dajax_geton\dajax_geton\urls.py in <module>
from dajaxice.core import dajaxice_autodiscover, dajaxice_config

C:\Python33\lib\site-packages\dajaxice\core\__init__.py in <module>
from Dajaxice import Dajaxice, dajaxice_autodiscover

Well, I feel kind a strange when the error could been caused by some bug in Dajaxice module.

urls.py

from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
dajaxice_autodiscover()
from views import view_index

urlpatterns = patterns('',
url(r'index/$', view_index),
url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
)
urlpatterns += staticfiles_urlpatterns()  

chenges in settings.py

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'dajaxice',)

STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'dajaxice.finders.DajaxiceFinder',)

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages')

Maybe I'm doing something stupid, which causes the error? Or, maybe, provide me some link with simple working project with dajaxice? Thanks in advance.

도움이 되었습니까?

해결책

Dajaxice does not yet support Python 3.

There is a pull request #112 with a patch that fixes the ImportError. However, there may be other issues running Dajaxice with Python 3, so I would use Python 2.7 for now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top