Run manage.py migrate but no accout related tables created in graphite.db

无人久伴 提交于 2019-12-12 02:33:01

问题


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

Then using the command in the official installation instruction:

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

Gave information

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

Then I went to check the graphite.db

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

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.

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!


回答1:


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 ....


What you need is

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




回答2:


You have to include graphite in the INSTALLED_APPS in the Django settings.py file.



来源:https://stackoverflow.com/questions/37426835/run-manage-py-migrate-but-no-accout-related-tables-created-in-graphite-db

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!