[英]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.