Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated some settings for the new server.

  • Loading branch information...
commit 0e6e0419f931f38c9e62e9e16fc4988861d5edea 1 parent f4cd879
Jacob Kaplan-Moss authored October 12, 2010

Showing 1 changed file with 30 additions and 24 deletions. Show diff stats Hide diff stats

  1. 54  django_website/settings/www.py
54  django_website/settings/www.py
... ...
@@ -1,5 +1,6 @@
1 1
 # Settings for www.djangoproject.com
2 2
 
  3
+import os
3 4
 import platform
4 5
 from unipath import FSPath as Path
5 6
 
@@ -7,37 +8,40 @@
7 8
 BASE = Path(__file__).absolute().ancestor(2)
8 9
 
9 10
 # Far too clever trick to know if we're running on the deployment server.
10  
-DEVELOPMENT_MODE = (platform.node() != "djangoproject")
  11
+PRODUCTION = ('DJANGOPROJECT_DEBUG' not in os.environ) and ("djangoproject" in platform.node())
11 12
 
12  
-ADMINS = (('Adrian Holovaty','holovaty@gmail.com'), ('Jacob Kaplan-Moss', 'jacob@jacobian.org'))
  13
+ADMINS = (('Adrian Holovaty','holovaty@gmail.com'),('Jacob Kaplan-Moss', 'jacob@jacobian.org'))
  14
+MANAGERS = (('Jacob Kaplan-Moss','jacob@jacobian.org'),)
13 15
 TIME_ZONE = 'America/Chicago'
14  
-
15 16
 SERVER_EMAIL = 'root@djangoproject.com'
16  
-MANAGERS = (('Jacob Kaplan-Moss','jacob@jacobian.org'),)
17 17
 
18  
-DATABASE_ENGINE = 'postgresql_psycopg2'
19  
-DATABASE_NAME = 'djangoproject'
  18
+DATABASES = {
  19
+    'default': {
  20
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
  21
+        'NAME': 'djangoproject',
  22
+        'USER': 'djangoproject'
  23
+    }
  24
+}
  25
+
  26
+USE_I18N = False
  27
+USE_L10N = False
  28
+
20 29
 TEMPLATE_DIRS = [BASE.child('templates')]
  30
+MEDIA_ROOT = BASE.parent.child('media')
21 31
 
22  
-if DEVELOPMENT_MODE:
  32
+if PRODUCTION:
  33
+    DEBUG = False
  34
+    PREPEND_WWW = True
  35
+    CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
  36
+    MEDIA_URL = "http://www.djangoproject.com.com/m/"
  37
+    ADMIN_MEDIA_PREFIX = "http://www.djangoproject.com.com/m/admin/"
  38
+else:
23 39
     DEBUG = True
24 40
     PREPEND_WWW = False
25 41
     CACHE_BACKEND = "dummy:///"
26  
-    DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"
27  
-    MEDIA_ROOT = BASE.parent.child('media')
28 42
     MEDIA_URL = "/media/"
29 43
     ADMIN_MEDIA_PREFIX = '/admin_media/'
30 44
     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
31  
-else:
32  
-    DEBUG = False
33  
-    PREPEND_WWW = True
34  
-    DATABASE_USER = 'apache'
35  
-    CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
36  
-    TEMPLATE_DIRS = ['/home/djangoproject.com/django_website/templates']
37  
-    DJANGO_SVN_ROOT = "file:///home/svn/django/django/"
38  
-    MEDIA_ROOT = "/home/html/djangoproject.com/m/"
39  
-    MEDIA_URL = "http://www.djangoproject.com.com/m/"
40  
-    ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/'
41 45
 
42 46
 SITE_ID = 1
43 47
 ROOT_URLCONF = 'django_website.urls.www'
@@ -58,10 +62,6 @@
58 62
     'registration',
59 63
 )
60 64
 
61  
-# setting for documentation root path
62  
-DJANGO_DOCUMENT_ROOT_PATH = "/home/html/djangoproject.com/docs/"
63  
-DJANGO_TESTS_PATH = "/home/html/djangoproject.com/tests/"
64  
-
65 65
 CACHE_MIDDLEWARE_SECONDS = 60 * 5 # 5 minutes
66 66
 CACHE_MIDDLEWARE_KEY_PREFIX = 'djangoproject'
67 67
 CACHE_MIDDLEWARE_GZIP = True
@@ -87,7 +87,6 @@
87 87
     "django.core.context_processors.media",
88 88
 ]
89 89
 
90  
-USE_I18N = False
91 90
 
92 91
 DEFAULT_FROM_EMAIL = "noreply@djangoproject.com"
93 92
 
@@ -96,3 +95,10 @@
96 95
 
97 96
 # comment_utils settings
98 97
 AKISMET_API_KEY = "c892e4962244"
  98
+
  99
+# setting for documentation root path
  100
+DJANGO_DOCUMENT_ROOT_PATH = "/home/html/djangoproject.com/docs/"
  101
+DJANGO_TESTS_PATH = "/home/html/djangoproject.com/tests/"
  102
+
  103
+# XXX What's this for?
  104
+DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"

0 notes on commit 0e6e041

Please sign in to comment.
Something went wrong with that request. Please try again.