Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (51 sloc) 1.582 kB
# ~/.pythonrc
from __future__ import with_statement
# enable syntax completion
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pythonhist")
def save_history(historyPath=historyPath):
import readline
readline.write_history_file(historyPath)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
atexit.register(save_history)
readline.parse_and_bind("tab: complete")
del atexit, readline, rlcompleter, save_history, historyPath
# Django auto-setup
import warnings
try:
from django.core.management import setup_environ
import settings
setup_environ(settings)
print('imported django settings')
try:
exec_strs = ["from %s.models import *" % apps for apps in settings.INSTALLED_APPS ]
exec_strs.extend(['import %s.views' % app for app in settings.INSTALLED_APPS])
exec_strs.extend(['import %s as %s' % (app, app.split('.')[-1]) for app in settings.INSTALLED_APPS])
for x in exec_strs:
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
exec(x)
except:
pass
print('imported django apps and models')
except:
pass
except:
pass
# import useful libraries
import sys, os, re
# Mess with the prompts
sys.ps1 = '\033[92m>>> \033[0m'
sys.ps2 = '\033[90m .\033[0m'
Jump to Line
Something went wrong with that request. Please try again.