django外部应用程序安装“错误:没有名为nested-inlines的模块" [英] django external app installation "Error: No module named nested-inlines"

查看:31
本文介绍了django外部应用程序安装“错误:没有名为nested-inlines的模块"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是从django开始,尝试使用外部应用.我已经下载并安装了该应用程序:

I'm just starting out with django trying to use an external app. I've downloaded the app and installed it:

sudo setup.py install
...
Adding django-nested-inlines 0.1 to easy-install.pth file

Installed /Applications/djangostack-1.4.7-0/python/lib/python2.7/site-packages/django_nested_inlines-0.1-py2.7.egg

我还遵循了应用程序教程,并将该应用程序包含在设置文件中:

I also followed the app tutorial and included the app in the settings file:

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:
     'nested_inlines',
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'polls',
) 

但是当我尝试再次运行服务器时,我得到了:

But when I try to run the server again I get:

bash-3.2$ python manage.py runserver
Error: No module named nested-inlines

这是怎么了?

我没有使用pip进行安装,而是下载了它.django是在Mac OS上使用 Bitnami 安装的.

I didn't install using pip rather downloaded it. django is installed using Bitnami under Mac OS.

推荐答案

这是一个猜测,但是该应用程序可能在您的PYTHONPATH上不可用.您可能需要告诉Django在其中查找要使用的应用程序.可能需要执行以下操作,以便settings.py可以将应用程序导入django项目.

This is a guess, but that app is probably not available on your PYTHONPATH. You may need to tell Django to look in there to find applications you want to use. Something like the following might work to make it so that your settings.py can import the app for your django project.

settings.py

settings.py

import sys
sys.path.append("/Applications/djangostack-1.4.7-0/python/lib/python2.7/site-packages/")

## After which you can include it in your installed apps:

INSTALLED_APPS = (
'nested_inlines',
'other apps',
'etc',
)

这篇关于django外部应用程序安装“错误:没有名为nested-inlines的模块"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆