Package madrona :: Package common :: Module default_settings
[hide private]

Source Code for Module madrona.common.default_settings

  1  import os 
  2  os.environ["CELERY_LOADER"] = "django" 
  3   
  4  # !!!!!!!!!!!!!!!!!!!!!!! 
  5  # DONT FORGET TO DOCUMENT ANY NEW SETTINGS IN /docs/settings.rst 
  6  # !!!!!!!!!!!!!!!!!!!!!! 
  7   
  8  APP_NAME = 'Madrona' 
  9   
 10  LANGUAGE_CODE = 'en-us' 
 11  SITE_ID = 1 
 12  USE_I18N = False 
 13   
 14  GEOMETRY_DB_SRID = 3310 
 15  GEOMETRY_CLIENT_SRID = 4326 
 16  DISPLAY_LENGTH_UNITS = 'mi' # Choices can be found in django.contrib.gis.measure.Distance.UNITS  Most common will be mi, m, km, nm, ft 
 17  DISPLAY_AREA_UNITS = 'sq_mi' # Choices can be found in django.contrib.gis.measure.Area.UNITS  Most common will be sq_mi, sq_m, sq_km, sq_nm, sq_ft 
 18   
 19  GOOGLE_API_KEY = 'ABQIAAAAu2dobIiH7nisivwmaz2gDhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSLaQmJjJuOq03hTEjc-cNV8eegYg' 
 20   
 21  from madrona.common import assets 
 22   
 23  COMPRESS_CSS = { 
 24      'application': { 
 25          'source_filenames': assets.get_css_files(), 
 26          'output_filename': 'common/css/madrona.r?.css', 
 27          'extra_context': { 
 28              'media': 'all' 
 29          } 
 30      } 
 31  } 
 32   
 33  COMPRESS_JS = { 
 34      'application': { 
 35          'source_filenames': assets.get_js_files(), 
 36          'output_filename': 'madrona.r?.js' 
 37      }, 
 38      'tests': { 
 39          'source_filenames': assets.get_js_test_files(), 
 40          'output_filename': 'madrona_tests.r?.js' 
 41      } 
 42  } 
 43   
 44  COMPRESS_VERSION = True 
 45  COMPRESS_AUTO = True 
 46   
 47  GOOGLE_ANALYTICS_MODEL = True 
 48   
 49  MIDDLEWARE_CLASSES = ( 
 50      # GZip speeds up downloads by compressing on the fly 
 51      'django.middleware.gzip.GZipMiddleware', 
 52      'django.middleware.common.CommonMiddleware', 
 53      'madrona.common.middleware.IgnoreCsrfMiddleware',  
 54      'django.middleware.csrf.CsrfViewMiddleware', 
 55      'django.contrib.sessions.middleware.SessionMiddleware', 
 56      'django.contrib.messages.middleware.MessageMiddleware', 
 57      'django.contrib.auth.middleware.AuthenticationMiddleware', 
 58      # compatibility problems with django trunk?  
 59      # 'maintenancemode.middleware.MaintenanceModeMiddleware', 
 60      'django.middleware.transaction.TransactionMiddleware', 
 61      'madrona.openid.middleware.OpenIDMiddleware', 
 62  ) 
 63   
 64  INSTALLED_APPS = ( 
 65      'madrona.common', 
 66      'django.contrib.auth', 
 67      'django.contrib.admin', 
 68      'django.contrib.contenttypes', 
 69      'django.contrib.sessions', 
 70      'django.contrib.sites', 
 71      'django.contrib.gis', 
 72      'flatblocks', 
 73      'compress', 
 74      'madrona.shapes', 
 75      'madrona.google-analytics',  
 76      'madrona.layers', 
 77      'madrona.layer_manager', 
 78      'madrona.studyregion', 
 79      'madrona.simplefaq', 
 80      'madrona.help', 
 81      'madrona.staticmap', 
 82      'madrona.screencasts', 
 83      'madrona.news', 
 84      'madrona.manipulators', 
 85      'madrona.kmlapp', 
 86      'madrona.features', 
 87      'madrona.user_profile', 
 88      'madrona.unit_converter', 
 89      'madrona.openid', 
 90      'madrona.async', 
 91      'madrona.loadshp', 
 92      'madrona.bookmarks', 
 93      'registration', 
 94      'south', 
 95      'djcelery',  
 96      'djkombu', 
 97      ##### Optional Apps #### 
 98      #'madrona.heatmap',  
 99      #'madrona.analysistools', 
100      #'madrona.raster_stats', 
101      #'madrona.xyquery', 
102      #'madrona.group_management', 
103  ) 
104   
105  EXCLUDE_FROM_TESTS = [ 
106      'south',  
107      'registration', 
108      'flatblocks', 
109      'django.contrib.auth', 
110      'django.contrib.admin', 
111      'django.contrib.contenttypes', 
112      'django.contrib.sessions', 
113      'django.contrib.sites', 
114      'django.contrib.gis' 
115  ] 
116   
117  ACCOUNT_ACTIVATION_DAYS = 7 # New users have one week to activate account 
118  REGISTRATION_OPEN = True # Can users register themselves or not? 
119  GROUP_REQUEST_EMAIL = None # When user requests group membership, send email to this address (None = no email sent)  
120  GROUP_REGISTERED_BY_WEB = 'registered_by_web'  # Group name assigned to users who register using the web interface 
121   
122  MEDIA_ROOT = os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + '/../../media/') 
123   
124  # URLS 
125  MEDIA_URL = '/media/' 
126  LOGIN_URL = '/accounts/signin/' 
127  STATIC_URL = '/media/' 
128   
129  # KML SETTINGS 
130  KML_SIMPLIFY_TOLERANCE = 20 # meters 
131  KML_SIMPLIFY_TOLERANCE_DEGREES = 0.0002 # Very roughly ~ 20 meters 
132  KML_EXTRUDE_HEIGHT = 100 
133  KML_ALTITUDEMODE_DEFAULT = 'absolute' 
134   
135  # SHARING SETTINGS 
136  SHARING_TO_PUBLIC_GROUPS = ['Share with Public'] 
137  SHARING_TO_STAFF_GROUPS = ['Share with Staff'] 
138   
139  # TEMPLATE SETTINGS 
140  TEMPLATE_CONTEXT_PROCESSORS = ( 
141      "django.contrib.auth.context_processors.auth", 
142      "django.core.context_processors.debug", 
143      "django.core.context_processors.i18n", 
144      "django.core.context_processors.media", 
145      "django.contrib.messages.context_processors.messages", 
146      'django.core.context_processors.request', 
147      'madrona.openid.context_processors.authopenid', 
148  ) 
149  TEMPLATE_LOADERS = ( 
150      'django.template.loaders.filesystem.Loader', 
151      'django.template.loaders.app_directories.Loader', 
152  ) 
153   
154  ADMINS = ( 
155      # ('Your Name', 'your_email@domain.com'), 
156  ) 
157  MANAGERS = ADMINS 
158   
159  DEBUG = True 
160  TEMPLATE_DEBUG = DEBUG 
161   
162  #Screencast videos, images, and video-player locations 
163  SCREENCASTS = 'screencasts/' 
164  SCREENCAST_IMAGES = 'screencasts/images' 
165  VIDEO_PLAYER = MEDIA_URL + 'screencasts/video_player/player-viral.swf' 
166   
167  # This path is used by madrona.layers.views to handle requests initiated by a UserLayerList  
168  USER_DATA_ROOT = '/mnt/EBS_userdatalayers/display' 
169   
170  SKIP_SOUTH_TESTS = True 
171  SOUTH_TESTS_MIGRATE = False 
172   
173  #Celery and djkombu settings (for server-side asynchronous process handling) 
174  CARROT_BACKEND = "django" 
175  CELERY_RESULT_BACKEND = "database" 
176  CELERY_TRACK_STARTED = True 
177  BROKER_BACKEND = "djkombu.transport.DatabaseTransport" 
178  # Make sure to add any modules containing tasks 
179  #CELERY_IMPORT = ('myapp.tasks',) 
180  import djcelery 
181  djcelery.setup_loader() 
182   
183  #The following is used to determine whether the async app (and celery) should be used  
184  ASYNC_IS_DISABLED = False 
185   
186  AWS_USE_S3_MEDIA = False  # Set true IF you want to use S3 to serve static media.  
187                            # If true, need to set AWS_ACCESS_KEY, AWS_SECRET_KEY and AWS_MEDIA_BUCKET and MEDIA_URL 
188   
189  OPENID_ENABLED = False 
190   
191  LOG_FILE = None # write log to stdout 
192   
193  PRIVATE_KML_ROOT = '/mnt/EBS_superoverlays/display' 
194   
195  DATABASES = { 
196      'default': { 
197          'ENGINE': 'django.contrib.gis.db.backends.postgis', 
198          'NAME': 'example', 
199          'USER': 'postgres', 
200       } 
201  } 
202   
203  # UNIX username which owns the wsgi process. 
204  # Used to set ownership of MEDIA_ROOT  
205  # None implies MEDIA_ROOT is owned by whoever runs the install_media command 
206  WSGI_USER = None 
207   
208  CACHES = { 
209      'default': { 
210          #'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 
211          #'LOCATION': '/tmp/django-cache', 
212          'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 
213      } 
214  } 
215   
216  HELP_EMAIL = 'help@madrona.org' 
217   
218  STATICMAP_AUTOZOOM = True 
219   
220  TITLES = { 
221      'self': 'View', 
222  } 
223   
224  # Do you want bookmarks to show up in the kmleditor (True) or just the tool panel (False)? 
225  BOOKMARK_FEATURE = False 
226  BOOKMARK_ANON_USERNAME = "anonymous_bookmark_user" 
227  from datetime import timedelta 
228  BOOKMARK_ANON_LIMIT = (100, timedelta(minutes=30)) # Limit to 100 anon bookmarks per IP every 30 minutes 
229   
230  ENFORCE_SUPPORTED_BROWSER = True 
231   
232  STARSPAN_BIN = 'starspan' 
233  STARSPAN_REMOVE_TMP = True 
234   
235  POSTGIS_TEMPLATE = 'template1' 
236   
237  LAUNCH_PAGE = False  
238  from django.core.urlresolvers import reverse_lazy 
239  LOGIN_REDIRECT_URL = reverse_lazy('map') 
240   
241  GEOJSON_DOWNLOAD = True  # force headers to treat like an attachment 
242  GEOJSON_SRID = None  # None -> use GEOMETRY_DB_SRID 
243