在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使用了。