简体   繁体   English

如何解决应用程序的 29 个未应用的迁移:admin、api、auth、authtoken、contenttypes、sessions、social_django

[英]How can I solve the 29 unapplied migration(s) for app(s): admin, api, auth, authtoken, contenttypes, sessions, social_django

I was setting up Doccano on my desktop to perform sequence labeling tasks.我正在我的桌面上设置 Doccano 来执行序列标记任务。 I followed the instructions from a website on how to setup Doccano.我按照网站上有关如何设置 Doccano 的说明进行操作。 Everything was working fine until I got to the last code below where I experienced migration errors.一切正常,直到我到达下面的最后一个代码,在那里我遇到了迁移错误。

$ git clone https://github.com/chakki-works/doccano.git
$ cd doccano
$ pip install -r requirements.txt
$ cd app
$ python manage.py createsuperuser 

This is the error below after running the last code above on git bash这是在 git bash 上运行上面的最后一个代码后出现的错误

You have 29 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, api, auth, authtoken, contenttypes, sessions, social_django.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_user

File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user

The error says to Run 'python manage.py migrate.错误说运行'python manage.py migrate。 When I ran the code in my terminal I got an [Errno 2] No such file or directory.当我在终端中运行代码时,我得到一个 [Errno 2] 没有这样的文件或目录。 Please see below.请参阅下文。 Thanks for your help.谢谢你的帮助。

C:\Users\okekec>python manage.py migrate
python: can't open file 'manage.py': [Errno 2] No such file or directory

This is a Django project, so you are required to manually migrate the required models for the 29 apps that it's referring to.这是一个 Django 项目,因此您需要为其所指的 29 个应用程序手动迁移所需的模型。

It seems to me as though you are running this outside the directory that you've cloned在我看来,好像您是在克隆的目录之外运行它

C:\\Users\\okekec> C:\\用户\\okekec>

should be应该

C:\\Users\\okekec\\doccano> C:\\用户\\okekec\\doccano>

There, it should have the manage.py file, ie the file should be in the current directory.在那里,它应该有manage.py文件,即该文件应该在当前目录中。 This should then allow you to perform the migrations.这应该允许您执行迁移。

Go to the folder where manage.py is and run the command there.转到 manage.py 所在的文件夹并在那里运行命令。

cd /okekec/doccano/app

ls

It should be able to see manage.py file.它应该能够看到 manage.py 文件。

Then python manage.py migrate然后python manage.py migrate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您有 3 个未应用的迁移。 在您为应用程序应用迁移之前,您的项目可能无法正常工作:admin、auth - You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth 没有名为“social_django”的模块,但安装了“social-auth-app-django” - No module named 'social_django' but 'social-auth-app-django' is installed Django REST Framework:禁用所有内置模式的迁移,即,(身份验证内容类型。管理员等) - Django REST Framework: Disable migration of all built in schemas, i.e., (auth. contenttypes. admin., etc.) 如何使用social-auth-app-django刷新令牌? - How can I refresh the token with social-auth-app-django? Django 迁移没有迁移 authtoken 和会话 - Django migration didn't migrate authtoken and sessions 如何解决python-social-auth错误? - How can I solve python-social-auth Bug? 如何访问使用django的社交身份验证生成的令牌? - How do I access the token generated using django's social auth? 为什么我不能使用Django管理应用程序的资源 - why i can't use django admin app's resource 如何使用python-social-auth在Django APP上注销Facebook本身? - How can I logout facebook itself on Django APP with python-social-auth? 如何使用Django Social Auth连接Twitter? - How can I use Django Social Auth to connect with Twitter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM