返回

python-heroku没有这样的表:试图运行create superuser时出现auth_user错误

发布时间:2022-04-24 13:45:08 381
# node.js

我正在尝试创建带有Heroku的django应用程序,但是我被这个错误卡住了。我看到一些关于heroku不能使用sqllite的信息,所以我一直在尝试更新到postgres,但不确定为什么这里没有反映出来。

sqlite3.操作错误:没有这样的表:auth_user

heroku run python3 manage.py createsuperuser

 ›   Warning: heroku update available from 7.41.0 to 7.60.1.
Running python3 manage.py createsuperuser on ⬢ generic-heroku-app... up, run.5883 (Free)
On development database

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/app/.heroku/python/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_user

来自settings.py的数据库

import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=600)
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '**',
        'USER': '**',
        'PASSWORD': '**',
        'HOST': '127.0.0.1',
        'PORT': '5432',
    }
}

编辑:这个帖子显示了一些可靠的信息,但我似乎仍然无法使用这些信息。我不确定我会错在哪里&引用;“没有这样的表格”;django syncdb通过后Heroku出错

任何帮助都将不胜感激!

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(1)
按点赞数排序
用户头像