Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Generic Views: CRUD
Note: I’ve not yet updated this to reflect the new model syntax. For the time being you can take a look at the new model syntax for tasks here. There are lots of gems buried in Django that are slowly coming to light. Generic views and specifically the CRUD (create, update, delete) generic views are extremely powerful but underdocumented. This brief tutorial will show you how to make use of CRUD generic views in your Django application. One of my first encounters with Rails was the simple todo list tutorial which managed to relate lots of useful information by creating a simple yet useful application. While I will do my best to point out interesting and useful things along the way, it is probably best that you be familiar with the official Django tutorials. Now would also probably be a good time to mention that this tutorial works for me using MySQL and revision 524. Django is under constant development, so things may change. I’ll do my best to keep up with changes. Getting Started As with all Django projects, the best place to start is to start with django-admin.py startproject todo. Make sure that the directory you created your … -
Django and Rails
Sam Newman just posted a comparison of Django and Rails which is extremely balanced and fair, and a very good read. I’ve obviously got a few bits of feedback, so here goes: Background As a framework Rails has been around for little over a year, whereas as a framework in its own right django has only been public for around two months. Actually, Django’s been in use internally for over two years, although we only got the buy-in from management to release it as open-source two months ago. -
Reboot
Well, now. I hear that there’s this thing all the cool kids are doing. Something about a web stick, or a web tree or something… Web Log, that’s it. (Hear that? It’s me running after the bandwagon as fast as my lazy ass can take me.) Of course, this whole site is now powered by Django — including some neat little tricks I’ll try to share later on. -
Rob Curley Blew My Mind
A few days back I listened to this IMA Keynote by Rob Curley on IT Conversations. It blew my mind. I started out looking for some insight in to the team behind Django, The Lawrence Journal-World, lawrence.com, and so on. I got a whole lot more than I had bargained for. If you’re involved in old media, new media, any media, or just want a glimpse of the future (I hope), please have a listen. It will be very interesting to see what happens in the next few months as Django takes flight, Rob heads to Naples (with technical backup from Eric) and Adrian telecommutes to The Washington Post -
Django Markup Template Tags
Changeset 467 contains template tags for renderingTextile (using PyTextile), Markdown (using python-markdown), and ReStructured Text (using docutils). You can find usage examples and some basic tests in markup.py. You need to make sure that you have the correct modules installed to do the heavy lifting, but the tags are extremely easy to use: {{ textile_content|textile }} {{ markdown_content|markdown }} {{ rest_content|restructuredtext }} -
Django: Tutorial 4 and RSS
Today Adrian posted Django Tutorial 4 which covers form processing and generic views. Everyone dive in! In other news, if you’re looking to generate RSS using Django “the easy way,” look no further than this #django log and associated pastebin. As always, svn up if you haven’t in the last few hours. Update: The pastebin dissapeared, so here’s a transcribed version of what was in there. Typos are mine and not Adrian’s of course. -
HTTP Headers and Django
Andrew Brehaut has a hot tip about HTTP headers and Django: HttpResponse objects contain a headers dictionary, that you can easily add and remove headers from using dictionary notation You can read more about it and see usage examples in his post. -
Migrating Your App to Django
A few days ago I mentioned Changeset 384 which included a new command, django-admin.py inspectdb <dbname>. It has also been tweaked and improved since it was initially committed. The other day I tried it out on a simple database structure, but I decided to throw a more complex example at it. I decided to take the final depot application from the excellent Agile Web Development with Rails book. Beta books rule by the way. I executed the SQL in rails-code/depot_final/db/create.sql from the the code tarball to set up the database structure. I then created a new project with django-admin startproject and edited settings/main.py to tell Django how to log in to my mysql database. After exporting the correct DJANGO_SETTINGS_MODULE I ran django-admin.py inspectdb depot_rails which gave me the following model: # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Add primary_key=True to one field in each model. # Feel free to rename the models, but don't rename # db_table values or field names. # # Also note: You'll have to insert the output of # 'django-admin.py sqlinitialdata [appname]' # into your database. … -
Django middleware
In the django project settings there is a key called MIDDLEWARE_CLASSES which is a tuple of strings implementing the middleware methods. Django base handler (TBD explain what this class does) reads this setting and initializes three of its own attributes: _request_middleware, _view_middleware and _response_middleware. It goes through the list of middleware classes instantiates each of [...] -
django decorators
Django framework has used some design patterns. There is a directory called decorator which currently has two decorators: (decorator is just a method which dynamically adds additional functionality to original method depending on the situation) funcA = login_required(funcA) This replaces the funcA with a function which checks if the user is logged in and calls [...] -
Getting to know the django web framework
I was just about to abandon python and join the ruby camp to be able to use the wonderful rails framework for web application development. (They do have very good documentation and impressive video demo which you should check out!) But then came the announcement of Django. I really like the python language and feel [...] -
Django: Another "Rails" Web Framework
The Rails hype continues: Django for Python is the most recently announced of what is becoming a long line of web frameworks inspired by Ruby on Rails. Others that have popped up include MonoRail for .NET & Mono, Subway for Python, Trails for Java, Catalyst and Maypole for Perl. In the context of all these rails derivatives, this article on "Could Rails have been built without Ruby?" is an interesting read. [source] For PHP we have also cake and biscuit. -
Django: Another "Rails" Web Framework
The Rails hype continues: Django for Python is the most recently announced of what is becoming a long line of web frameworks inspired by Ruby on Rails. Others that have popped up include MonoRail for .NET & Mono, Subway for Python, Trails for Java, Catalyst and Maypole for Perl. In the context of all these rails derivatives, this article on "Could Rails have been built without Ruby?" is an interesting read. [source] For PHP we have also cake and biscuit. -
Search Results
This content won’t be rendered. See https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae. -
Subscribe to my newsletter
Want to get email when I write new blog posts? Sign up here to get an email every week with a summary of my latest posts. I’ll also occasionally include a few shorter thoughts or links that don’t fit as well here on the blog. -
Ways I'm available to help
Summary: want help? Email me: jacob@<this domain>. I’ve been lucky and privileged enough to have had a long and successful career. I’m now in a position to use my accumulated knowledge, network, and experience to help others, and I’d like to do so. This is a list of ways I think I can help; if you see something here that’d be useful to you, please email me. This isn’t an exhaustive list, but it is representative.