Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Internationalization
Django Internationalization -
Upgrades: Django Old to Django New
Upgrades: Django Old to Django New -
Simple Job Queues with django_rq
Simple Job Queues with django_rq -
Imaginary hosts The Onion for a video shoot
Imaginary hosts The Onion for a video shoot -
DjangoCon Performance Optimization Slides
DjangoCon Performance Optimization Slides -
Twelve-Factor Renaissance
Twelve-Factor Renaissance -
Debug Toolbar Primer
Debug Toolbar Primer -
My First Django Sprint
My First Django Sprint -
Getting Started Contributing to Django
Getting Started Contributing to Django -
Django and IPython Notebook
Django and IPython Notebook -
Postgres VIEW meet Django Model
[Postgres](http://www.postgresql.org) `VIEW`s are a nice way to store a subset of a table in a way that can itself be queried, or perhaps slightly or radically changing the shape of your table. It has a fairly simple syntax: {% highlight sql %} CREATE VIEW "foo" AS SELECT "bar", "baz", "qux" FROM "corge" WHERE "grault" IS NULL; {% endhighlight %} You may use any valid `SELECT` query as the source of a `VIEW`, including one that contains `UNION` or `UNION ALL`. You can use this form to create a view that takes two similarly formatted tables and combines them into one logical table. Note that for a `UNION` to work, the columns (and column types) must be identical between the two parts of the query. A `UNION` will do extra work to ensure all rows are unique: `UNION ALL` may perform better, especially if you know your rows will be unique (or you need duplicates). By default, a Postgres `VIEW` is dynamic, and read-only. With the use of the `CREATE MATERIALIZED VIEW` form, it's possible to have a cached copy stored on disk, which requires an `UPDATE MATERIALIZED VIEW "viewname"` in order to cause an update. It's also possible to create … -
Django & Rails - another year another comparison
It is the time of the year where I start talking about Django and Ruby on Rails. Since my last two posts I received many questions about this topic and the old posts are still read frequently and quoted. So let me bring you up to date what changed, what improved since the last post and which framework is the best choice. If you did not read my last two posts about this topic I suggest you read them now. I will make claims and statements in this post I already elaborated in them and without the context they can be quite controversial. To the disappointment of some of you: this is still not Django vs Rails - it is no discussion that will come to the conclusion that there is a holy grail of frameworks, totally destroying one of them with arguments why the other one is so superior. While Django is slowly moving towards migrations being part of the core functionality Ruby on Rails just added support for real foreign keys support. Django 1.7, which will bring you the joy of migrations, is currently not marked as stable, but release candidate two makes a good impression and it … -
Django & Rails - another year another comparison
Django & Rails - another year another comparison It is the time of the year where I start talking about Django and Ruby on Rails. Since my last two posts I received many questions about this topic and the old posts are still read frequently and quoted. So let me bring you up to date what changed, what improved since the last post and which framework is the best choice. If you did not read my last two posts about this topic I suggest you read them now. I will make claims and statements in this post I already elaborated in them and without the context they can be quite controversial. To the disappointment of some of you: this is still not Django vs Rails - it is no discussion that will come to the conclusion that there is a holy grail of frameworks, totally destroying one of them with arguments why the other one is so superior. While Django is slowly moving towards migrations being part of the core functionality Ruby on Rails just added support for real foreign keys support. Django 1.7, which will bring you the joy of migrations, is currently not marked as stable, but release … -
Creating a re-usable Django app - Part 1
Hi everyone and welcome back for this next tutorial of the Babbler series. This tutorial will cover 2 ways of creating a re-usable Django app. The first and simplest one is apps for flexible and personal re-use. The second one is a somewhat less simple way of doing it but which allows re-distribution of your application and that can be a very good thing too! For the first part of this tutorial we will be using the custom user model, built during the previous tutorial, as a starting point. The second part will be using the theme application built during the Using your own flavour of bootstrap with django tutorial. -
Avoiding SQL Antipatterns using Django (and Postgres)
The book [SQL Antipatterns](http://pragprog.com/book/bksqla/sql-antipatterns) is one of my favourite books. I took the opportunity to reread it on a trip to [Xerocon](https://www.xero.com/au/xerocon/sydney/) in Sydney, and as usual it enlightened me to thing I am probably doing in my database interactions. So, I'm going to look at these Antipatterns, and discuss how you can avoid them when using [Django](https://ww.django project.com). This post is intended to be read with each chapter of the book. I've used the section headings, but instead of the chapter headings, I've used the Antipattern headings. They are still in the same order, though. It seems the printed version of this book is on sale now: I'm tempted to buy a few extra copies for gifts. Ahem, cow-orkers. Logical Database Design Antipatterns ¶ Format Comma-Separated Lists ¶ This one is pretty simple: use a relation instead of a [Comma Separated field](https://docs.djangoproject.com/en/1.7/ref/models/fields/#commaseparatedintegerfield). In the cases described in the book, a [`ManyToManyField`](https://docs.djangoproject.com/en/1.7/ref/models/fields/#manytomanyfield) is in fact simpler than a Comma Separated field. Django gets a gold star here, both in ease of use, but also in documentation about relations. However, there may be times when a relation is overkill, and a real array is better. For instance, when storing data related … -
Django Templating Language - Part I
Hey guys! I know I haven't posted anything in a very long time. Exigent circumstances. Anyway, now I'm back with what may well be the most important skill in your entire Django toolkit. The templating language that Django ships makes writing pages that display multiple results mundanely easy.In this part I'll only introduce you to templates. We'll see how to render them in the next one.Variables:We all know what variables are and how important they are for programming. This is how variables are represented in Django:{{ variable_name }}It can also be written as {{variable_name}} but the former is more readable. Let's see how to 'declare' a variable in an HTML script:<h1>{{ heading }}</h1><form action = "/foo/" method = "post"> <input type = "text" name = "bar" placeholder = "{{ placeholder }}"></form>Notice the difference? {{ heading }} is without quotes and {{ placeholder }} is with. The basic concept is you write the name of the variable exactly as you would write normal text. While writing normal text, you would not put quotes between the <h1>...</h1> tags but would in the <input> tag.Right now if you just write this much code it'll print all raw data. There is no use … -
Chaussette and Circus as a new way to deploy your Django applications
Many Python web applications run on production with the help of gunicorn or uwsgi. There are however other solutions that may turn out to be even better than the currently popular solutions. One of alternatives is chaussette and circus. Chaussette is a WSGI server that can serve WSGI applications like your Django project. Circus is an application to control and monitor processes and sockets. It can manage chaussette, celery or other sockets and processes making it a manager of all project services. -
What's New With WhisperGifts
It's been a busy few months for WhisperGifts, my bridal gift registry service built with Django. This post rounds up a few recent additions and changes, including technical details for those who want to do something similar. Highlights include weather forecasting, REST APIs, and JavaScript bookmarklets. -
What's New With WhisperGifts
It's been a busy few months for WhisperGifts, my bridal gift registry service built with Django. This post rounds up a few recent additions and changes, including technical details for those who want to do something similar. Highlights include weather forecasting, REST APIs, and JavaScript bookmarklets. -
What's New With WhisperGifts
In the past couple of months I've done some fun and interesting stuff over at WhisperGifts, my side project that lets couples put their bridal gift registry online. It's all built with Django, so I thought I'd share a few neat things I've come across along the way. Bookmarket and image detection For a while I've had a bookmarklet to add any item to your registry, which basically took the page title, selected text (or meta description), and URL and pre-filled the Add Item form. Recently, I updated it to also find the largest image on the page, and add that as the default image for the item you selected. This makes it pretty quick to add an item from, for example, an Amazon page or a manufacturer's website. The code to do it was surprisingly simple. Apologies for the short variable names; this is taken directly from my bookmarklet code so brevity is a plus in that scenario. var ims=document.getElementsByTagName('img'); var imsMxD=0; var im=''; for(x=0;x<ims.length;x++){ var xDim=parseFloat(ims[x].width)*parseFloat(ims[x].height); if((xDim>imsMxD)&&(ims[x].src)){ imsMxD=xDim; im=ims[x].src; } } This will give me a variable, im, which contains the URL of the largest image on the page. I then pass this to the form to pre-populate … -
What's New With WhisperGifts
In the past couple of months I've done some fun and interesting stuff over at WhisperGifts, my side project that lets couples put their bridal gift registry online. It's all built with Django, so I thought I'd share a few neat things I've come across along the way. Bookmarket and … -
IP Street is hiring! Senior Developer (Python, Django)
Overview Founded in 2010, IP Street has built the world’s preeminent Intellectual Property(IP) analytics and visualization engine, in conjunction with a nationally recognized IP law firm. Our SaaS product helps corporations and financial analysts quickly and efficiently analyze IP information. We make IP data easy to get, use, and understand! As with any organization, we’ve continued to evaluate new ways to provide value to our clients. We’re evolving into a “SaaS+” model, which pairs our service with expert consultation to assist our clients in assessment and evaluation. Our focus remains on the financial and technology markets. Our technology stack is almost all open-source, with some nifty esoteric search technologies. Most of your work will be in Python and Django, in a Mac-based development environment, deploying to Linux. Other technologies include Postgres, Redis, and Solr. Our client-side code relies on Highcharts and Backbone. This is a “small b” big data firm. But since we’re a scrappy start-up, we don’t have a big firm’s resources. We compensate by hiring senior people who are self-directed, appreciate real-world development trade-offs, and have a can-do attitude. It’s OK to not know something if you’re eager and willing to learn it. We know that bad code … -
Django Extensions 1.3.11
We are happy to release: Django-Extensions Version 1.3.11 This brings the usual tons of fixes and improvements Get it at: https://pypi.python.org/pypi/django-extensions/1.3.11 Changes: Improvement: sqldiff, show differences for not managed tables Improvement: show_urls -f aligned, 3 spaces between columns Improvement: reset_db, support mysql options files in reset_db Fix: sqldiff, Fixed bug with --output_text option and notnull-differ text Fix: reset_db, Fix for PostgreSQL databases with dashes, dots, etc in the name Fix: dumpscript, AttributeError for datefields that are None Docs: Adding RUNSERVERPLUS_SERVER_ADDRESS_PORT to docs -
Related ManyToManyField in Django admin site
Hello everyone. There is something quite common people are trying to do in Django which is accessing a ManyToMany relationship from both ends in Django admin. Since this is something I am going to have to explain to someone tomorow, I thought I'd take the opportunity to write a short tutorial about it. -
Liquid Templates and Django Templates
Note to self: when I get the error: {% highlight rbcon %} /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/convertible.rb:81:in `do_layout': undefined method `name' for # (NoMethodError) from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/post.rb:189:in `render' from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:193:in `render' from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:192:in `each' from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:192:in `render' from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:40:in `_draft_process' from /Users/matt/Dropbox/Blog/_plugins/drafts.rb:15:in `process' from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/jekyll:250 from /usr/local/bin/jekyll:19:in `load' from /usr/local/bin/jekyll:19 {% endhighlight %} It's probably because I have used django template tags in the {% raw %}`{% (end)highlight %}`{% endraw %} blocks, and omitted the {% raw %}``{% (end)raw %}``{% endraw %} stuff.