首页 > 解决方案 > 在 heroku 上创建超级用户时,我收到错误 ModuleNotFoundError: No module named 'rest_framework'

问题描述

我已经使用 python 和 python3 安装了 djangorestframework。此错误仅在使用时出现

heroku 运行 python manage.py createsuperuser

我也试过 heroku run python3 manage.py createsuperuser

设置.py:

INSTALLED_APPS = [
    'rest_framework',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework.authtoken',
    'core',
]

标签: pythondjangoheroku

解决方案


推荐阅读