Reputation: 167
I am deploying my Flask application in Heroku server.
from flask import Flask, render_template, url_for, request, session, redirect
from flask.ext.pymongo import PyMongo
import bcrypt
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'demo'
app.config['MONGO_URI'] = 'mongodb://xxxx:[email protected]:xxxxx/demo'
mongo = PyMongo(app)
My Flask Application runs well in my local machine. But while deploying, I receive an application Error with logs "
2017-02-17T19:55:08.948578+00:00 app[web.1]: File "/app/login_example.py", line 2, in <module>
2017-02-17T19:55:08.948578+00:00 app[web.1]: from flask.ext.pymongo import PyMongo
2017-02-17T19:55:08.948578+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/exthook.py", line 110, in load_module
2017-02-17T19:55:08.948579+00:00 app[web.1]: raise ImportError('No module named %s' % fullname)
2017-02-17T19:55:08.948579+00:00 app[web.1]: ImportError: No module named flask.ext.pymongo
I already instralled the pymongo. I follow the tutorial which comes with PyMongo (Two letters are in Capitals). Can you please give me how I can solve this error. Thanks.
Upvotes: 0
Views: 2422
Reputation: 48
Is it because flask.ext.pymongo
is deprecated? I got a deprecation warning on my flask app that is using pymongo. That might get rid of your import error. What I do is from flask_pymongo import PyMongo
Upvotes: 2