![]() ![]() Title = request.POST'title' content = request.POST'content' I won’t go into details here, but feel free to explore the source code included in Download.Īssuming everything is installed and running well, create a new Django project and the necessary components as shown in Listing 13.Īre you sure you want to delete this post?įrom django.shortcuts import render_to_responseįrom django.template import RequestContext The cascading style sheets (CSS) definitions go in a separate static file. ![]() The Django views have three methods: index, update, and delete. Blongo displays any blog entries entered upon page load and allows updating and deleting of any entries -in other words, all the standard CRUD operations. If you want to recreate my exact settings, I used Ubuntu Linux with FireFox. You’ll use Python 2.7, Django 1.3, MongoDB 1.8.2, MongoEngine 0.4, and Hypertext Markup Language (HTML) 5. Now you’ll create a simple blog called Blongo. ![]() Notice that to access the unique object ID, you use "id" rather than "_id". Similar to Django’s ORM, to query for all the documents in the collection you call (). In this example, you use two field types: StringField and IntField. The Employee object inherits from mongoengine.Document.
0 Comments
Leave a Reply. |