我試圖在Windows機器上設置DJango restframework,並在運行代碼時出現以下錯誤:配置Django-rest
已完成的步驟。
- 下載其餘的框架&從GitHub
其他公用設施使用的easy_install我安裝了所有的軟件包。
這裏是確認味精,
C:\Python27\Scripts>easy_install django-rest Searching for django-rest Best match: django-rest 0.0.1 Processing django_rest-0.0.1-py2.7.egg django-rest 0.0.1 is already the active version in easy-install.pth
Using c:\python27\lib\site-packages\django_rest-0.0.1-py2.7.egg Processing dependencies for django-rest Finished processing dependencies for django-rest
創建其創建的所有文件的新項目firstwebservice。
編輯settings.py文件和下面給出包括Django的休息,
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...
卸載方便,用pip重新安裝。誠實輕鬆給了我很多問題。 – 2013-02-08 16:35:30