导入Dajaxice“没有名为”Dajaxice“的模块”时出错

2024-06-28 19:17:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我仔细检查了三次,并正确地遵循了这个教程:

http://django-dajaxice.readthedocs.org/en/latest/installation.html

我正在使用Windows并安装了Dajaxice。我可以输入Django api并导入dajaxice,没有任何错误:

>>> import dajaxice
>>>

但是,我得到了一个错误

no module named Dajaxice

尝试从dajaxice.core导入任何内容时。这是我的网址.py引发问题:

^{pr2}$

我在这里不知所措。我已经阅读了关于这个主题的每一个堆栈溢出的答案,尝试了几次教程,甚至尝试过重新安装Dajaxice(以及Dajax)。为什么我可以导入dajaxice,但在from dajaxice.core import foo上没有错误?在

以下是相关部分设置.py公司名称:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'project_view',
    'dajaxice',
)

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.tz",
    "django.core.context_processors.request",
    'django.contrib.messages.context_processors.messages')

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.eggs.Loader',
)

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

我需要为静态根添加什么吗?那是空的。在


Tags: thedjangocoreauthadmin错误contexttemplate