I’ve been working on angular.js using yeoman for the last couple of weeks. One thing I really liked about it is the live reload functionality. Essentially, any changes made in the DOM or CSS gets updated immediately. It’s a really really powerful feature for web developers. It’s also one of those features you never knew you needed until you’ve used it.
I got so addicted to it, I went hunting around for an app that is able to do the same for my django projects. Enter LiveReload which is quite possibly the best invention since sliced bread. The setup is super trivial. Add my django project to the folder list, install a chrome extension and I’m done. Now, all changes in the DOM or CSS gets updated immediately when I’m working on Django. Best SGD $12 bucks spent on an app ever.
If your prompt ever looks like this:
Python 2.7.3 (default, Oct 22 2012, 06:12:32)
Type "copyright", "credits" or "license" for more information.
IPython 0.13 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
[0;34mIn [[1;34m1[0;34m]: [0m
To fix, simply run: easy_install -a readline
Add HTML5 data attributes directly to the button like this:
self.helper.layout = Layout(
Submit('add', 'Add', css_class="btn-primary"),
Button('cancel', 'Cancel', css_class="btn-danger",
instead of this:
HTML('<input type="button" name="cancel" value="Cancel" \
This is mostly an on-site specific guide
- Use the redirects app to manage url changes Django documentation
- Use post save signals to handle slug/url changes in your models Link
- Use sitemap The sitemap framework
- Use slugfield Model field reference
- Use cached template loaders to reduce page load times The Django template language: For Python programmers
- Use a css/js compressor to reduce page load times django_compressor
- Use django-robots to manage your robots file django-robots
- If you’re rolling an e-commerce site, don’t reinvent the wheel, just go with The Best Django CMS. It’s the best code and seo friendly cms framework for django
- Manage object level meta data with django-seo
- Not django specific but submit your site to google webmasters Webmasters – Google. For bing: Bing – Webmaster Tools
- Not django specific again but load your page using Make the Web Faster and make all the recommended changes
- Crawl your site content to find broken links using Xenu or Integrity for Mac
- To generate image sitemaps, use Django Image Sitemaps
You’re installing GeoDjango and you meet this error “django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND “geos” while trying to runserver (or any other command) in your project. Check the following in order of severity:
Have you included this in your .bash_profile (or equivalent)
Where 91 is the version of postgres you’re using.
If that doesn’t work, I would try reinstalling all the packages listed here: https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#macports
Make sure you’re getting the right versions for each package and that postgis is installing to the right postgres!
I just wrote a blog post explaining how I generate a 3 column layout PDF output in Django at the Odeon blog.