Commits

Albert O'Connor committed 6d32218

Modernize the production local settings.

Comments (0)

Files changed (1)

activate/local_settings.production.py

-
 import os
 PATH = os.path.abspath(os.path.dirname(__file__))
 
 def relative(path):
     return os.path.abspath(os.path.join(PATH, path))
 
-DEBUG = True # Until other thigns work...
+DEBUG = False
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = False
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = False
 
 MEDIA_ROOT = relative('media')
 
-MEDIA_URL = "/media/"
+MEDIA_URL = "https://s3.amazonaws.com/wl-activate/"
 
 STATIC_ROOT = relative('static')
 
-STATIC_URL = '/'
+STATIC_URL = 'https://s3.amazonaws.com/wl-activate/'
 
-ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'activate',                      # Or path to database file if using sqlite3.
-        'USER': 'activate_user',                      # Not used with sqlite3.
-        'PASSWORD': 'notsecure',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-    }
-}
+ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/"
 
 TEMPLATE_DIRS = (
-    relative('templates'),
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
+    relative("templates")
 )
 
-EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
-EMAIL_FILE_PATH = '/storage/mail'
+DEVELOPMENT = False
+
+DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'
+STATICFILES_STORAGE = 'storages.backends.s3.S3Storage'
+#DEFAULT_FILE_STORAGE = "storages.backends.s3boto.S3BotoStorage" # Doesn't work with latest BOTO?
+
+AWS_STORAGE_BUCKET_NAME = "wl-activate"
+
+from S3 import CallingFormat
+AWS_CALLING_FORMAT = CallingFormat.PATH
 
 try:
     from secure_settings import *
 except ImportError:
-    pass
+    pass
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.