尝试将Django国家/地区添加到Django [英] Trying to add Django Countries to Django

查看:74
本文介绍了尝试将Django国家/地区添加到Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是django的新手,我正在尝试安装django国家/地区,并且遇到了问题。我是从 http://pypi.python.org/pypi/django-countries/安装的1.0.1 。安装后,将其放入此文件夹。

I am a newbie to django and I am trying to install django countries and am haveing issues. I Installed from http://pypi.python.org/pypi/django-countries/1.0.1. When I installed, I put it into this folder.

/usr/local/lib/python2.7/dist-packages/django/contrib/django_countries

然后我将django_countries如下添加到已安装应用程序的列表中。

I then added django_countries to the the list of isntalled apps as follows.

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

当我执行以下操作时,出现以下错误

when I ran the below I get the below error

python manage.py syncdb
Error: No module named django_counties



的模块

那么...我做错了什么?我还要做什么?

So...what diod I do wrong? What else am I supped to do?

谢谢

推荐答案

如果此版本是从google下载的,看起来该应用程序位于名为国家/地区的子文件夹中。将此文件夹放在python dist-packages文件夹中,因此路径为/usr/local/lib/python2.7/dist-packages/countries,然后将国家/地区添加到已安装应用程序的列表中。有关更多详细信息,请参见此文档。 http://code.google .com / p / django-countries / source / browse / trunk / INSTALL.txt

If this version was downloaded from google, it looks like the app is in a subfolder called countries. Put this folder in your python dist-packages folder so the path is /usr/local/lib/python2.7/dist-packages/countries and then add countries to the list of installed apps. See this doc for more details http://code.google.com/p/django-countries/source/browse/trunk/INSTALL.txt

这篇关于尝试将Django国家/地区添加到Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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