This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is the get the address with hitting the enter button without submitting | |
$(function() { | |
$("#id_address") | |
.geocomplete() | |
.bind("geocode:result", function(event, result){ | |
$.log(result.formatted_address); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import * | |
from fabric.contrib.files import sed | |
from fabric.operations import run | |
def update_testing(): | |
dep_path = "/home/user/webapps/testing_site/mysite" | |
parent = "origin" | |
branch = "master" | |
run("cd %s; git pull %s %s" % (dep_path, parent, branch)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://docs.djangoproject.com/en/1.4/topics/auth/#the-login-required-decorator | |
from django.contrib.auth.decorators import login_required | |
@login_required | |
def my_view(request): | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Dump all flatpages into a json file | |
$ python manage.py dumpdata flatpages --indent=2 > /folder/to/flatpage/app/backup.json | |
> Add the backup file to the latest git commit | |
$ git add /folder/to/flatpage/app/backup.json | |
$ git commit -m "Flatpage sql dump for production" | |
$ git push | |
> On the production server | |
$ git pull |