25 articles tagged Django
-
Sharing Django Users and Sessions Across Projects
This document describes how to share users created using Django’s auth system with other Django projects. It is not a hack; it simply makes use of the database router …
-
Two Subdomains, One Django
I want to serve two sub-domains from the same Django project—not unheard of, see the countless multi-lingual sites out there. My goal, however, is specifically to share the whole project …
-
django-tinymce: dictionary not found for language 'en'
I had a Django issue with django-tinymce throwing errors on the spell checker. Digging through the traceback revealed this error:
RuntimeError: dictionary not found for language 'en'
That’s weird …
-
Django, jQuery, and Infinite Scroll
As the “next page” button becomes a thing of the past, we look for new ways to provide streaming information. Enter infinite scroll. Implementing infinite scroll in Django is easy …
-
Django Media: Cleaning Up Your Mess
Sometimes it’s too easy to fire and forget when it comes to setting up FileFields in Django. Over time, a lot of media can become stale as objects are …
-
Exporting `auth` Fixtures
I’ve discovered, rather painfully, that setting up auth fixtures for testing requires a little care. Problems result when South migrations interfere with fixture permissions.
The best way to dump …
-
ImportError: cannot import name indexes
I’m certainly not the first person to hit this caveat with django-haystack, as this error has been reported for over a year now. However, I had trouble finding a …
-
Goodbye TinyMCE, Hello Markdown
I’ve been a faithful TinyMCE user for years, but my blogging needs are growing and changing, and TinyMCE just isn’t a fit anymore.
My primary complaint has been …
-
Why Build a Blog with Django?
This question comes up a lot, both in flame wars and in rational discussion. Why would you take time to build a blog application with Django when there are engines …
-
Dustinfarris.com Source on GitHub
My website is at a point where I feel comfortable making the source code public. As of today, it is available as a public repository on GitHub.
I’ve taken …
-
Django and Jade
This week I made an important addition to my tool kit. In the past I’ve focused primarily on ways to streamline backend development using tools like django_compressor, Sentry, and …
-
Cache Timeout Default in Django
I had to break a bad habit where I always specify explicit cache timeout settings when building custom template tags. For example, I might have a news feed for the …
-
Facebook Meta-tags using Django and Jade
I’ve found the Facebook doesn’t do the best job of inferring general information from my blog articles on its own. Fortunately, the folks at FB provide a name-spaced …
-
Django + Typography = django-typogrify
Something I’ve put off dealing with (until today) is typography. As a little bit of history: the typewriter forced us to sacrifice certain printed media standards because of its …
-
Django Model Managers via Related
It is fairly common practice to use a custom model manager when you have a certain field(s) that you know you will be filtering by a lot. I found …
-
Testing Management Commands
I think to be a good Django citizen it would be appropriate to write tests ensuring that standard management commands work with your application. I thought of this after dealing …
-
Rails "through" vs Django "ManyToMany"
Ok, Rails & company have a lot of great points—I love RSpec—but I’ve noticed a few areas where Rails can improve. Here, namely, I see a big difference in handling …
-
RESTful Django
I’ve been taking a lot of time lately to determine a best practice way of incorporating a RESTful approach to Django views. My goal is to come up with …
-
Setting up a Django Server with Gentoo
This is part 3 in a 3 part series I’ve written on setting up a Django production site on Gentoo. In the first 2 parts I went over basic …
-
Django: A New Way to Write Tests
Taking a lot of inspiration from Ruby’s RSpec, I’ve established a new way to write my tests when doing TDD in Django. Using django-nose, factoryboy, and a few …
-
"subject" Decorator for Django Tests
The Python elite will probably turn their noses up at me, but I just conjured an even better looking way to write my tests.
Using my utilities.py file I …
-
Decorating Django Tests
Just a quick note: when decorating Django tests you have to take care to name your return function using the same “test_” format otherwise an unmodified TestRunner will not discover …
-
Using Google to Send Mail in Django
If you have a Gmail account (or a Google Apps account), you can use it to send mail on your behalf just like any other email client. Remember to use …
-
HTML5 Navigation in Django
Creating a snappy user experience can be easily obtained by implementing HTML5 navigation. Not only does it take less time to render only the needed Django templates, the browser has …
-
Testing in Django
Writing tests and test-driven development has become all the rage lately; but before declaring assertions left and right, it’s important to consider where, why, and how you will write …