Karry Wang  

  在virtualenv下安装的第三方库,例如south, requests等,如果想在django中使用,需要先将库添加到settings.py的INSTALLED_APPS中, 以south, requests为例,

 1 INSTALLED_APPS = (
 2     'django.contrib.auth',
 3     'django.contrib.contenttypes',
 4     'django.contrib.sessions',
 5     'django.contrib.sites',
 6     'django.contrib.messages',
 7     'django.contrib.staticfiles',
 8     # Uncomment the next line to enable the admin:
 9      'django.contrib.admin',
10     # Uncomment the next line to enable admin documentation:
11      'django.contrib.admindocs',
12      'south',
13      'requests',
14 )

之后运行./manage.py syncdb, 然后就可以import requests使用了。

 

 

posted on 2014-06-25 16:57  Karry Wang  阅读(677)  评论(0编辑  收藏  举报