Last active
August 29, 2015 14:01
-
-
Save hanleybrand/604f96ccaf11fc846b88 to your computer and use it in GitHub Desktop.
Environment debugging for MDID3 - paste this to the bottom of your settings_local.py and run the server with `python manage.py run server`
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
import os | |
CL_DEBUG = True | |
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) | |
ROOIBOS_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__))) | |
# This will print a fair amount of information helpful for debugging an installation | |
# if CL_DEBUG = True at the beginning of this file | |
# see http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html | |
if CL_DEBUG: | |
print "__name__ =", __name__ | |
print "__file__ =", __file__ | |
print "os.getpid() =", os.getpid() | |
print "os.getcwd() =", os.getcwd() | |
print "os.curdir =", os.path.abspath(os.curdir) | |
#print "sys.path =" # , repr(sys.path) | |
#for forks in sys.path: | |
# print forks | |
#print "sys.modules.keys() =", repr(sys.modules.keys()) | |
print "sys.modules.has_key('rooibos') =", sys.modules.has_key('rooibos') | |
if sys.modules.has_key('rooibos'): | |
print "sys.modules['rooibos'].__name__ =", sys.modules['rooibos'].__name__ | |
print "sys.modules['rooibos'].__file__ =", sys.modules['rooibos'].__file__ | |
print "os.environ['DJANGO_SETTINGS_MODULE'] =", os.environ.get('DJANGO_SETTINGS_MODULE', None) | |
print '===============================\nDirectories\n===============================' | |
print 'project path: ', PROJECT_ROOT | |
print 'rooibos path: ', ROOIBOS_ROOT | |
print 'media root: ', MEDIA_ROOT | |
print 'scratch: ', SCRATCH_DIR | |
print 'auto-storage: ', AUTO_STORAGE_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because of the way django loads, this will repeat a few times in your terminal, but the last iteration is correct. If your base directory is /var/local/mdid/ then the output should look something like:
Uncomment the
for forks in sys.path:
to get lot more stuff (like all the python libraries available) in the console