pythonzm / Ops

基于centos6+python3.6+django2+ansible2.4+celery4.2 运维管理系统,目前实现功能:用户和用户组管理、资产管理、集成ansible2.4、简易堡垒机(主机分配支持rdp以及vnc、用户分配、文件上传下载、配置禁用命令清单、操作录像回放功能)、CI/CD(支持git仓库和svn仓库)、数据库管理(一部分)、celery任务编排、知识库及文件共享
716 stars 320 forks source link

表缺失问题 #84

Closed zzjackaa closed 4 years ago

zzjackaa commented 4 years ago

大佬 ,登陆界面后显示 Table 'ops.ops_assets' doesn't exist表缺失 但是我在数据库中并未发现此表 +-------------------------------------+ | Tables_in_ops | +-------------------------------------+ | auth_group | | auth_group_permissions | | auth_permission | | django_admin_log | | django_celery_beat_crontabschedule | | django_celery_beat_intervalschedule | | django_celery_beat_periodictask | | django_celery_beat_periodictasks | | django_celery_beat_solarschedule | | django_celery_results_taskresult | | django_content_type | | django_migrations | | django_session | | ops_user | | ops_user_groups | | ops_user_plan | | ops_user_user_permissions | | ops_users_log | +-------------------------------------+ 能不能麻烦提供下改表结构

zzjackaa commented 4 years ago

[root@master Ops-master]# python manage.py makemigrations users assets dbmanager fort plan projs task wiki You are trying to add the field 'add_time' with 'auto_now_add=True' to userplan without a default; the database needs something to populate existing rows.

1) Provide a one-off default now (will be set on all existing rows) 2) Quit, and let me add a default in models.py Select an option: 2 [root@master Ops-master]# python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, django_celery_beat, django_celery_results, sessions, users 貌似是并没有加载想要的app 我尝试通过只迁移一个app但是 apply中永远就只有 admin, auth, contenttypes, django_celery_beat, django_celery_results, sessions, users这些

pythonzm commented 4 years ago

把库删了重建吧,然后把users目录下migrations里的内容删除,只保留init.py,然后再执行python manage.py makemigrations users assets dbmanager fort plan projs task wiki

zzjackaa commented 4 years ago

感谢大佬 起来了 但是进入界面发现一个template模板 缺少 docker_list的value

zzjackaa commented 4 years ago

In template /data/Ops-master/templates/base.html, error at line 225

zzjackaa commented 4 years ago

起来了,这个html没有写完我就注释了.再次感谢大佬