Your SlideShare is downloading. ×
  • Like
Django with Mongo using Mongoengine
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Django with Mongo using Mongoengine

  • 9,486 views
Published

Presentation for #donetskpy meetup on February 18th, 2012.

Presentation for #donetskpy meetup on February 18th, 2012.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
9,486
On SlideShare
0
From Embeds
0
Number of Embeds
8

Actions

Shares
Downloads
57
Comments
0
Likes
5

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Django with Mongo using Mongoengine Artem Dudarev#donetskpy, #cncdnua, February 2012
  • 2. Other ways to use Mongo with DjangoWhich Python API should be used with Mongo DB andDjango? • PyMongo-- • Mongoengine-- • Django MongoDB Engine • MongoDB backend for Django-nonrel
  • 3. Django
  • 4. DjangoThe Web framework for perfectionists with deadlines.Using Django • Disqus • Many newspapers: Washington Post, Guardian, Lawrence.com.In Donetsk • Steelkiwi • MLSDev
  • 5. MongoMongo (from "humongous") is a scalable,high-performance, open source NoSQL database.Using Mongo • Foursquare • CatchIn Donetsk •?
  • 6. MongoengineMongoEngine is a Document-Object Mapper (think ORM,but for document databases) for working with MongoDBfrom Python.
  • 7. Mongoengine examplefrom mongoengine import (Document, EmbeddedDocument, ListField, StringField, IntField)class Metadata(EmbeddedDocument): tags = ListField(StringField()) revisions = ListField(IntField())class WikiPage(Document): title = StringField(required=True) text = StringField() metadata = EmbeddedDocumentField(Metadata)
  • 8. Mongoengine example (cont.)>>> page.title = “Hello, World!”>>> for page in WikiPage.objects:>>> print page.title
  • 9. — Игорь Афонов, #cncdnua #32
  • 10. «Делайте велосипеды, но то так, что бы хотелось на них ездить.» — Игорь Давыденко, #kyivpy #5
  • 11. Tumblr • http://wearethe99percent.tumblr.com/ • http://dearphotograph.com/ • http://stockingisthenewplanking.com/ • http://dudarev.tumblr.com/
  • 12. Tumblr (cont.)http://mashable.com/2011/11/14/tumblr-infographic/ • 35M tumblogs • 45% photos • Top 5 tags: GIF, LOL, Fashion, Art, Vintage • 218% growth (from June to June) • $800M valuation
  • 13. Mumblr • Harry Marr - developer of Mongoengine • Mumblr - Tumblr cloneStarting with Python (virtualenv, pip)git clone https://github.com/hmarr/django-mumblr.git mumblrcd mumblrvirtualenv .source bin/activatepip install -r requirements.txtcd example
  • 14. Mumblr (starting Mongo)http://www.mongodb.org/display/DOCS/Quickstart+Unixcurl http://downloads.mongodb.org/linux...tgz > mongo.tgztar xzf mongo.tgzsudo chown `id -u` /data/dbsudo chown `id -u` /data/db/*./mongodb-linux-i686-2.0.2/bin/mongod./mongodb-linux-i686-2.0.2/bin/mongouse mumblr-exampledb.dropDatabase()
  • 15. Mumblr (adding user)ls mumblr/management/commands/python manage.py addusepython manage.py runserver
  • 16. Points • Django is an excellent framework for not too complicated sites • MongoDB is #1 NoSQL database - try it • Djangists may find Mongoengine convenient • Do reinvent the wheel • Make it easy for others to start using it
  • 17. CreditsLogos • Django • Mongo • MongoengineComics • How to Write a CV • The Hard Life Of A NoSQL Coderrst2pdf • rst2pdf • style by Alexis Métaireau was partially used