This file contains 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
#!/bin/bash | |
# extract all postgres databases from a sql file created by pg_dumpall | |
# this script outputs one .sql file for each database in the original .sql file | |
# unless you pass the name of a database in the dump | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2 | |
exit 1 | |
fi |
This file contains 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 django.contrib.auth.models import User, SiteProfileNotAvailable | |
from django.core.exceptions import ImproperlyConfigured | |
from django.db import models | |
from django.db.models.signals import post_init | |
from django.dispatch.dispatcher import receiver | |
@receiver(post_init, sender=User) | |
def user_post_init(sender, instance, **kwargs): | |
def get_profile(): |
This file contains 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
# Sharing Django Users and Sessions Across Projects | |
By Dustin Farris on 22 Feb 2012 | |
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 and | |
middleware system that Django comes with out of the box. | |
## Introduction |