You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I install Flask-WhooshAlchemy and config according to your QuickStart,
but when I use docker to deploy my app, run it and visit my route,it raise the error:
File "/usr/local/lib/python2.7/site-packages/whoosh/filedb/filestore.py", line 552, in rename_file
raise NameError("File %r exists" % newname)
NameError: File '_MAIN_0.toc' exists
My code:
app/Init.py:
import flask_whooshalchemy as whooshalchemy
def create_app(config_name=None, main=True):
if config_name is None:
config_name = 'default'
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
db.init_app(app)
moment.init_app(app)
toolbar.init_app(app)
login_manager.init_app(app)
from .models import BlogPost
whooshalchemy.whoosh_index(app, BlogPost)
return app
app = create_app(config_name = 'default')
app/models.py:
class BlogPost(db.Model):
__tablename__ = 'blogpost'
__searchable__ = ['title', 'content']
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String)
content = app.db.Column(db.Text)
config.py
class Config:
WHOOSH_BASE = os.path.join(basedir,"whoosh_index")
The text was updated successfully, but these errors were encountered:
Hello, I install Flask-WhooshAlchemy and config according to your QuickStart,
but when I use docker to deploy my app, run it and visit my route,it raise the error:
My code:
app/Init.py:
app/models.py:
config.py
The text was updated successfully, but these errors were encountered: