Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
from django.core.cache import cache | |
from django.core.urlresolvers import reverse | |
from django.http import HttpRequest | |
from django.utils.cache import get_cache_key | |
def expire_page_cache(view, args=None): | |
""" | |
Removes cache created by cache_page functionality. | |
Parameters are used as they are in reverse() | |
""" |
#!/bin/bash | |
# Git post checkout hook. | |
# Reminds you of South migration changes when switching branches. | |
# Can be useful when you are when you are testing out a branch from | |
# someone else that requires migrations. | |
# Put the file in .git/hooks/post-checkout | |
PREVIOUS_HEAD=$1 | |
NEW_HEAD=$2 |
$ git checkout master | |
Already on 'master' | |
$ django-admin.py migrate | |
Error: Cannot migrate in a dirty state | |
$ git commit -am "Added migration to remove blog entry's pub_month and pub_day fields." | |
$ django-admin.py tag_migration add_column_to_foo # tags a migration identifier using git-tag | |
$ django-admin.py migrate | |
last known sha: c39168d21bb27754737a1036a50f57687cf6ae56 | |
new migrations found between c39168..HEAD: |
# | |
# by default, django 404 and 500 pages dont pass context to templates. | |
# as you almost *always* need context variables in your custom | |
# 404/500 templates, you might need MEDIA_URL for example | |
# | |
# you need to create a custom view for errors and register it in your urls.py | |
# | |
# in urls.py add : | |
# | |
# handler500 = handler404 = views.server_error |