运行manage.py migration,但在graphite.db中没有创建与accout相关的表 [英] Run manage.py migrate but no accout related tables created in graphite.db

查看:128
本文介绍了运行manage.py migration,但在graphite.db中没有创建与accout相关的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu Server 16.04 LTS上安装石墨0.9.15. 在配置步骤中

I'm installing graphite 0.9.15 on Ubuntu Server 16.04 LTS. During configuration step

cd/opt/graphite/webapp/graphite sudo cp local_settings.py.example local_settings.py

cd /opt/graphite/webapp/graphite sudo cp local_settings.py.example local_settings.py

然后使用官方安装说明中的命令:

Then using the command in the official installation instruction:

sudo PYTHONPATH =/opt/graphite/webapp/python manage.py migration --settings = local_settings

sudo PYTHONPATH=/opt/graphite/webapp/ python manage.py migrate --settings=local_settings

提供信息

要执行的操作:
应用所有迁移:(无)
运行迁移:
没有要应用的迁移.

Operations to perform:
Apply all migrations: (none)
Running migrations:
No migrations to apply.

然后我去检查了graphite.db

Then I went to check the graphite.db

sqlite3石墨.db
从sqlite_master中选择名称WHERE type ='table';

sqlite3 graphite.db
SELECT name FROM sqlite_master WHERE type='table';

仅创建了两个表django_migrations和sqlite_sequence,没有与帐户相关的表.在apache错误日志中,/opt/graphite/storage/log/webapp/error.log,OperationalError:没有这样的表:auth_user.这是因为缺少这些帐户表.

Only two tables created, django_migrations and sqlite_sequence, no account relevant tables. And inside apache error log, /opt/graphite/storage/log/webapp/error.log, OperationalError: no such talbe: auth_user. It's because of missing those account tables.

一些信息: ubuntu 16.04 LTS
python2.7.11
django 1.9.6
django-tagging 0.4.3
耳语,碳,石墨0.9.15

Some info: ubuntu 16.04 LTS
python2.7.11
django 1.9.6
django-tagging 0.4.3
whisper, carbon, graphite 0.9.15

请问谁知道原因以及如何解决?非常感谢!

Please who know the reason and how to solve this? Thanks a lot!

推荐答案

实际上,我的问题是,每次运行"sudo python manage.py migration"时,每次只创建部分表,并且几个表名以account_,dashboard_,事件,总是想念.
终于找到了原因,不要使用我在官方文档中提到的命令.它不适用于Django 1.9及更高版本.石墨官方文件已经很长时间没有更新了.

Actually my issue is that when I run "sudo python manage.py migrate" each time only partial tables are created and several tables name starts with account_, dashboard_, events, always miss.
Finally found the reason, don't use that command I used and which mentioned in official doc. It does not work on Django 1.9 and above. And graphite official document have not been updated for long time ....

您需要的是

sudo PYTHONPATH =/opt/graphite/webapp django-admin.py migration --settings = graphite.settings --run-syncdb

sudo PYTHONPATH=/opt/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb

这篇关于运行manage.py migration,但在graphite.db中没有创建与accout相关的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆