草庐IT

cms-migration

全部标签

python - 如何在 flask-migrate 迁移中自动导入模块

我的flask项目在其某些模型定义中使用了sqlalchemy_utils,这会导致迁移错误,例如:NameError:globalname'sqlalchemy_utils'isnotdefined由于这个包没有被导入到迁移文件中。我想让flask-migrate/alembic自动生成将这个包导入迁移文件的行,我该如何实现?我查看了alembic.ini和migrations/env.py-但我不清楚什么是正确的方法/如果可能的话。 最佳答案 最直接的方法是修改模板以包含该导入。script.py.mako:...fromale

python - flask-migrate 不检测模型

我正在阅读(和观看)有关Flask-Migrate的信息:https://realpython.com/blog/python/flask-by-example-part-2-postgres-sqlalchemy-and-alembic/在这里https://www.youtube.com/watch?v=YJibNSI-iaE#t=21并完成本教程中的所有操作:我启动了一个本地postgres服务器(使用Postgres.App,它在postgresql://localhost:5432启动了服务器)根据所述教程更新配置更新了app.py,创建了models.py等。安装Flask

python - 属性错误 : 'Graph' object has no attribute 'cypher' in migration of data from Postgress to Neo4j(Graph Database)

我正在手动将数据从postgres迁移到图形数据库。我写了下面的脚本:importpsycopg2frompy2neoimportauthenticate,Graphauthenticate("localhost:7474","neo4j","password")n4j_graph=Graph("http://localhost:7474/db/data/")try:conn=psycopg2.connect("dbname='db_name'user='user'password='password'")except:print"goodbye"cur=conn.cursor()tr

python - 找不到符号 : _BIO_new_CMS

我是mac的新手,我不明白为什么我的scrapy似乎不再起作用了。我怀疑openssl在我的elcapitan中无效。我试过:pipinstallcryptographypipinstallpyOpenSSLbrewinstallopenssl我仍然收到以下错误。有什么办法可以解决这个问题吗?$pythonPython2.7.10(v2.7.10:15c95b7d81dc,May232015,09:33:12)[GCC4.2.1(AppleInc.build5666)(dot3)]ondarwinType"help","copyright","credits"or"license"fo

python - 南 : Unknown command 'migrate'

我变得无情了$pythonmanage.pymigrateUnknowncommand:'migrate'Type'manage.pyhelp'forusage.我将代码从github拉到一台新电脑上。此代码已经过测试,可以在其他计算机上运行。除了我无法运行迁移之外,整个代码运行良好!安装我的虚拟环境并运行pipinstall-rrequirements.txt。它安装一切,包括南方。我可以通过运行来检查$pythonmanage.pyshell>>>importsouth>>>south.__version__'0.7.3'但是,当我运行manage.pyhelp时,migrate和

javascript - Django-cms 安装,但下拉菜单和其他 JS 不起作用 - 修复的想法?

我已将Django-CMS安装到现有网站上,虽然它没有抛出错误,但它无法正常工作。特别是,当我使用“/?edit”时,给定页面上的标题出现,但没有任何下拉菜单起作用,而且很少(可能没有)JavaScript起作用。其他方面:我在本地安装的Django上完成了此操作,其中包含大量开发组件(例如,SQLite和通过django教程提供的服务器)我在WebFactional上使用MySQL和apache服务器进行安装,结果相同安装基本上是此处描述的过程:http://docs.django-cms.org/en/support-3.0.x/how_to/install.html数据库安装成功

python - Django:python manage.py migrate 什么都不做

我刚开始学习Django,当我尝试应用我的迁移时,第一个问题出现了。我启动服务器,输入pythonmanage.pymigrate什么也没有发生。没有错误,没有崩溃,只是没有响应。Performingsystemchecks...Systemcheckidentifiednoissues(0silenced).Youhave13unappliedmigration(s).Yourprojectmaynotworkproperlyuntilyouapplythemigrationsforapp(s):admin,auth,contenttypes,sessions.Run'pythonm

python - 无法使用 Flask-Migrate (Alembic) 迁移或升级数据库

我一直在使用Flask-Migrate(Alembic)来更新我的数据库。我更新了我的models.py文件,但我犯了一个错误。我运行了一个迁移并去升级数据库,但是我得到了这个错误:sqlalchemy.exc.IntegrityError:(_mysql_exceptions.IntegrityError)(1215,'Cannotaddforeignkeyconstraint')[SQL:u'\nCREATETABLEtopics(\n\tidINTEGERNOTNULLAUTO_INCREMENT,\n\t`subjectID`INTEGER,\n\ttopicVARCHAR(1

python - 基于 web2py 构建的成熟 CMS 和博客有哪些?

在寻找用于开发Web应用程序和门户的技术时,我最近涉足了Ruby和Python(从非系统管理员的角度……即,转向Web应用程序开发)并立即爱上了Python。从那以后,我只想花时间研究基于python的技术(笑)。我迫切需要建立一个博客,它也可以作为公司网站使用,所以我开始寻找可能的python解决方案。我研究了所有主要的框架,喜欢企业版的zope/plone,所以我最终会在plone中做很多事情。但是,我还需要一种“即时”类型的框架,我可以非常快速地推出它并用于测试网络日志中的一些概念。考虑到优秀的Python项目的数量,这应该很容易吧?..好吧,错了。那真的很艰难,最后我永远无法弄

python - Django Heroku 错误 "Your models have changes that are not yet reflected in a migration"

我最近向我的应用程序(UserProfile)添加了一个模型,当我将更改推送到Heroku时,我想我不小心运行了herokurunpythonmanage.pymakemigrations。现在,当我尝试运行herokurunpythonmanage.pymigrate时,出现以下错误(leaguemaster)benjamins-mbp-2:leaguemasterBen$herokurunpythonmanage.pymigrateRunning`pythonmanage.pymigrate`attachedtoterminal...up,run.1357Operationstop