I'm looking to write a small web app to utilise a dataset I already have stored in a MongoDB collection. I've been writing more Python than other languages lately and would like to broaden my repertoire and write a Python web app.
It seems however that most if not all of the current popular Python web development frameworks favour MySQL and others with no mention given to MongoDB.
I am aware that there are more than likely plugins written to allow Mongo be used with existing frameworks but so far have found little as to documentation that compares and contrasts them.
I was wondering what in people's experience is the Python web development framework with the best MongoDB support?
Many thanks in advance,
Patrick
I have not tried MongoKit although it has been around for a while and retains a good reputation. I personally prefer MongoEngine and feel very comfortable with it (maybe because I like its nice homepage and good documentation). There is also a very good opensource project named Mumblr which demonstrates a Django-MongoEngine-MongoDB combination, which I think a very good starter for any project. I'm developing a CMS for my own company using this app.
I've used MongoKit with Pylons before and it worked out good.
You might want to refer to this post though: MongoDB ORM for Python?
There is no stable support for mongodb using django framework. I tried using mongoengine, but unlike models, provided for admin in django framework, there is no support for mongoengine.
Correct if I am wrong.
Flask is the best framework to use with MongoDB. It has a mongodb library called flask-pymongo
Make sure you run the following commands before starting your project.
$ pip3 install Flask
$ pip3 install Flask-PyMongo
Related
I am the student of final year can you suggest me some Python web projects?
I want to learn python and build my final year project in Python but I've no idea how to work with python so please guide me and answer my following questions please
Should i choose a framework or go with core python to develop web?
Which is the native DB for Python web? e.g MySQL is native DB for PHP.
Which Web framework of Python should choose and why?
You could try to use >>> import MySQLdb
Then connect to the database with
conn=MySQLdb.connect(host='localhost',user='root',passwd='')
then create a cursor for the connection >>>cursor = conn.cursor()
I am not that familiar with Python but this is what i would try. Glad to help if i did.
I have heard that Python is easier to learn and is very efficient to web developing. I would go with Core Python for web developing.
IMO you should choose a framework to work with. There are plenty to do Web Projects. Probably Django is one of the most popular ones. You have other choices like Flask or Falcon. You can work with any database, as for Django de default one is sqlite3, but is easy to change for others like postgres or MySQL.
This are some links you might find useful
https://www.djangoproject.com/start/
http://flask.pocoo.org/
https://falconframework.org/
Hope this helps.
I've created a basic mongoengine app using the pyramid_mongodb scaffold...however I'd like to include mongoengine. I'm wondering what I should actually keep from the scaffolds code.
Not a answer regarding the scaffold. I wouldn't recommend using the scaffold since it's not really usable for root_factory and so on, the subscribers isn't really needed too.
I wrote an addon for pyramid. It's called pyramid_mongo.
Documentation:
http://packages.python.org/pyramid_mongo/
Github:
https://github.com/llacroix/pyramid_mongo
I saw your question today and felt it could be a good addon to the plugin.
I just pushed it to github so you need to clone it from there for now, installing using pip will load the old version without support for mongoengine.
In other words in your config, do everything like in the docs and add something like:
mongo.mongoengine=true
It will attach mongo from the config to mongoengine. All other api will work with or without mongoengine and mongoengine should work. It just added it today, it doesn't support multiple connections and multiple dbs. I can also add support for multiple dbs too. But I feel mongoengine may do some things on his own that could conflict with my plugin like authorization.
Once I write tests, I'll push it to python packages and it will be possible to install from pip or easy_install. For now, pull it from github
I am new to Django and Appengine. I found that Django 1.2 version is supported by Google Appengine. Does it mean that Django 1.2 comes with the installation of Google Appengine SDK?
Or should we install djangoappengine
Any pointers, experiences and tutorials on running Django on Appengine is appreciated.
Thanks in advance.
I think djangoappengine would be a good start. It seems like an active project. Please also note that Google offers SQL backend as of October 2011 so whether you need SQL or NoSQL, you should be able to use Django for it.
General note: If you are new to both Django and GAE, you probably should start with learning Django on your local computer running a development server that comes with it. Once you get familiar with how Django works in general you can dig into GAE etc.
You can try django-nonrel, we use it professionally and it works well on App Engine.
You may just want to start with this tutorial as it is the official and recommended way for Django project on app engine.
Note that previously there some hacks and patches, but at the moment those are deprecated and above tutorial should be just enough to get you started.
Can somebody guide me to develop a django app with SimpleDB(Amazon's Database) as its database. I couldnt find any tutorials on searching. Can somebody help me by explaining the process involved in integrating Django with SimplDB for creating a small application. Or if somebody have any tutorials for it, please share it with me. Any help would be appreciated.
There is now experimental support using django-norel with the django-simpledb backend.
It doesn't look like there's any way to use Django's ORM with SimpleDB at the moment, unless you want to write all the code yourself. I'd suggest interfacing with SimpleDB using normal Python code (which would get called by your views or however you wish to do it).
To do this, use boto. It's mature, stable and well-documented -- I used it quite successfully in a Django project I recently undertook.
I need to add wiki to my Tornado webapp. i'm new to python so i would like it not too intimidating to be learned and integrated and can use my existing authentication system, hence the lightweight. it would be better if can use mongodb backend.
I already take a look at moin-moin and it seems too complex(?). any other alternative?
Have a look at Hatta. Overwrite WikiRequest.get_author() method to plug your authentication system. But it uses mercurial repository to store the data.
Skeletonz is a very nice lightweight Python cms that might be worth a look...