【发布时间】:2013-01-24 11:27:12
【问题描述】:
我尝试在 Windows 机器中设置 DJango restframework,运行代码时出现以下错误,
步骤完成。
- 从 github 下载了 rest-framework 和其他实用程序
-
使用 easy_install 我安装了所有软件包。
这是确认信息,
C:\Python27\Scripts>easy_install django-rest 搜索 django-rest 最佳匹配:django-rest 0.0.1 处理 django_rest-0.0.1-py2.7.egg django-rest 0.0.1 已经是easy-install.pth中的活动版本
使用 c:\python27\lib\site-packages\django_rest-0.0.1-py2.7.egg django-rest 的处理依赖完成处理 django-rest 的依赖项
创建了一个新项目 firstwebservice,它创建了所有文件。
-
编辑 settings.py 文件并包含 django rest,如下所示,
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', # Uncomment the next line to enable the admin: # 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) -
运行项目
Error:-No module named rest_framework...
【问题讨论】:
-
用easy卸载,用pip重新安装。诚实容易给了我很多问题。
标签: django django-rest-framework