Saner layout of templates.
[xnet] / xnet / settings / base.py
index 99e7fc7..c197cab 100644 (file)
@@ -8,8 +8,12 @@ ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 
 def read_pass(name):
     fname = os.path.join(ROOT_DIR, 'private', name)
-    with open(fname, 'r') as f:
-        return f.readline().strip()
+    try:
+        with open(fname, 'r') as f:
+            return f.readline().strip()
+    except (OSError, IOError) as e:
+        print("Unable to read %s: %s" % (fname, e))
+        return ''
 
 ADMINS = (
     # ('Your Name', 'your_email@example.com'),
@@ -87,7 +91,7 @@ STATIC_URL = '/static/'
 
 # Additional locations of static files
 STATICFILES_DIRS = (
-    os.path.join(ROOT_DIR, 'static'),
+    os.path.join(ROOT_DIR, 'static'),
     # Put strings here, like "/home/html/static" or "C:/www/django/static".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.