Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which python web framework(django or django-norel or pyramid) to use when MongoDB is used as a database

I am using MongoDB as my primary(and only till now) database and because of google and the links it provided me i am confused between Django or Pyramid.

I am comfortable with python but never done web development in python(i have done in PHP). Now because i will be using Mongo so i wont use Django ORM will that take away the ease of development people associate with Django?

I am new to Django(just a few hours) so i am not sure what parts of the framework the ORM affects.

Or should i go with the django fork django-norel with django mongodb engine (they are not actively maintained though) or should i use Pyramid because i plan to use jinja2 as my template layer so that makes 2 parts of django useless to me.

After removing these batteries from django does it still remain true that it a framework for people with deadlines?

Advice?

like image 860
lovesh Avatar asked Nov 01 '12 22:11

lovesh


3 Answers

Try it all (Django, Pyramid, Flask), read the docs, and you done. If you will select Django, you will not use some parts of it (orm, formlib), and that is all.

ALso see this video: https://www.10gen.com/presentations/mongosf-2011/mongodb-with-python-pylons-pyramid

like image 177
bismigalis Avatar answered Oct 14 '22 19:10

bismigalis


A year or two ago I was also deciding between django and pyramid w/ mongodb to build a high performance web application. I ultimately chose Pyramid :

Pros:

  • Pyramid is very light weight for a full stack framework. There is a minmal amount of 'magic' going on under the hood. I was able to wrap my head around all the pieces.
  • It is not as opinionated as Django. You can plug and play whatever templating engines or databases you need relatively easily.
  • I was impressed by the performance benchmarks between Pyramid over other full stack frameworks.
  • The Pylons/Pyramid culture of 100% code coverage and "only pay for what you eat" was appealing to my own development style.

Cons:

  • The community is growing, but still not as mature as Django
  • There's a lot of documentation, but it's not as robust as some of the Django docs out there
  • The lack of 'magic' and beginner friendly documentation make for a steeper learning curve.

As for using an ORM with MongoDB; I recommend you try building without one at first. After trying a few mongodb ORMs, I've ended up going back to plain pymongo with Colander or Validictory for validation. Pymongo is already very ORM-like, fast, and flexible. I felt the extra layers of abstraction took away from that flexibility, and caused me to write more code than was needed.

like image 11
Brian Cajes Avatar answered Nov 15 '22 07:11

Brian Cajes


I'm going to suggest an alternative that has not been mentioned: Flask. Flask has a really great (albeit smaller than Django) community and there are a lot of extensions available for common web-app extensions, in the extensions directory.

There are several MongoDB extensions for Flask, which help to integrate MongoDB into the framework, but I would also highly recommend the mongoengine ORM. One of the people working on mongoengine has release an extension for Flask integration, Flask-MongoEngine.

like image 9
Edwardr Avatar answered Nov 15 '22 09:11

Edwardr