Tôi đang cố gắng thiết lập chế độ chỉnh sửa DJango trong máy tính cửa sổ và tôi gặp phải lỗi sau khi tôi chạy mã,Định cấu hình Django-rest
Thực hiện các bước.
- Downloaded còn lại-framework & tiện ích khác từ github
Sử dụng easy_install Tôi đã cài đặt tất cả các gói.
Đây là msg xác nhận,
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
Tạo một firstwebservice dự án mới mà tạo ra tất cả các file.
Chỉnh sửa tập tin settings.py và bao gồm phần còn lại django như đưa ra dưới đây,
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', )
Ran dự án
Error:-No module named rest_framework...
gỡ cài đặt dễ dàng, cài đặt lại với pip. trung thực dễ dàng mang lại cho tôi rất nhiều vấn đề. –