niceyes 发表于 2021-9-27 16:10:24

rest_framework导不进来

PS D:\school\mysite\test_927> pip3 install djangorestframework
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: djangorestframework in d:\python\anaconda3\lib\site-packages (3.12.4)
Requirement already satisfied: django>=2.2 in d:\python\anaconda3\lib\site-packages (from djangorestframework) (3.2.7)
Requirement already satisfied: asgiref<4,>=3.3.2 in d:\python\anaconda3\lib\site-packages (from django>=2.2->djangorestframework) (3.4.1)
Requirement already satisfied: pytz in d:\python\anaconda3\lib\site-packages (from django>=2.2->djangorestframework) (2021.1)
Requirement already satisfied: sqlparse>=0.2.2 in d:\python\anaconda3\lib\site-packages (from django>=2.2->djangorestframework) (0.4.1)

已安装
app 中也设置了:
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'app_01',
]



from rest_framework.views import APIView   这行出错,导不进来

z5560636 发表于 2021-9-28 11:31:33

不需要添加到setting,安装好之后直接导入包就行。就是一个库,搞那么复杂干啥。
你把报错的信息弄来看看。
页: [1]
查看完整版本: rest_framework导不进来