MongoEngine / flask-mongoengine

MongoEngine flask extension with WTF model forms support
Other
840 stars 256 forks source link

example app not running #12

Closed yosemitebandit closed 12 years ago

yosemitebandit commented 12 years ago

accessing the sample app results in the following trace:

(fm)hideo  flask-mongoengine git:(master) python example/simpleapp.py 
 * Running on http://0.0.0.0:4000/
 * Restarting with reloader
Traceback (most recent call last):
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/flask_debugtoolbar/__init__.py", line 101, in dispatch_request
    return view_func(**req.view_args)
  File "/home/matt/fm/flask-mongoengine/example/simpleapp.py", line 50, in index
    Todo(title="Simple todo A", text="12345678910").save()  # Insert
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/mongoengine/document.py", line 199, in save
    object_id = collection.save(doc, safe=safe, **write_options)
  File "/home/matt/conf/virtualenvs/fm/lib/python2.7/site-packages/pymongo/collection.py", line 241, in save
    return self.insert(to_save, manipulate, safe, check_keys, **kwargs)
TypeError: _insert() takes at most 4 arguments (5 given)
anemitz commented 12 years ago

I just pulled the latest repo and was able to start the app.

(venv)12:11:36 anemitz@Anthonys-MacBook-Pro flask-mongoengine % python example/simpleapp.py 
 * Running on http://0.0.0.0:4000/
 * Restarting with reloader

Are you using a virtualenv? If so, have you tried upgrading your installed packages with pip install -r requirements.txt -U?

yosemitebandit commented 12 years ago

Sorry, it starts fine but accessing http://localhost:4000 gives the above trace. I am in a virtualenv, yes.

I'll keep looking around..

anemitz commented 12 years ago

This seems to have fixed the issue for me, let me know if that works for you.

apiguy commented 11 years ago

Any idea when this fix will make it into pypi?