community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1787186 - in /comdev/nearby_people: local_settings.py.example manage.py run.cgi run.wsgi run_wsgi.py settings.py
Date Thu, 16 Mar 2017 13:39:35 GMT
Author: nick
Date: Thu Mar 16 13:39:35 2017
New Revision: 1787186

URL: http://svn.apache.org/viewvc?rev=1787186&view=rev
Log:
Sync config with currently targetted version, and remove parts no longer required

Added:
    comdev/nearby_people/run_wsgi.py
      - copied, changed from r1787185, comdev/nearby_people/run.wsgi
Removed:
    comdev/nearby_people/run.wsgi
Modified:
    comdev/nearby_people/local_settings.py.example
    comdev/nearby_people/manage.py
    comdev/nearby_people/run.cgi
    comdev/nearby_people/settings.py

Modified: comdev/nearby_people/local_settings.py.example
URL: http://svn.apache.org/viewvc/comdev/nearby_people/local_settings.py.example?rev=1787186&r1=1787185&r2=1787186&view=diff
==============================================================================
--- comdev/nearby_people/local_settings.py.example (original)
+++ comdev/nearby_people/local_settings.py.example Thu Mar 16 13:39:35 2017
@@ -44,11 +44,7 @@ MANAGERS = ADMINS
 #EMAIL_HOST = "localhost"
 
 # Database settings
-# (This can be left blank for now - we're not database backed)
-#
-DATABASE_ENGINE = ''           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3'
or 'oracle'.
-DATABASE_NAME = ''             # Or path to database file if using sqlite3.
-DATABASE_USER = ''             # Not used with sqlite3.
-DATABASE_PASSWORD = ''         # Not used with sqlite3.
-DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
+# (This can be left largely blank for now - we're not database backed)
+DATABASES = {
+    'default': { 'ENGINE': '' }
+}

Modified: comdev/nearby_people/manage.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/manage.py?rev=1787186&r1=1787185&r2=1787186&view=diff
==============================================================================
--- comdev/nearby_people/manage.py (original)
+++ comdev/nearby_people/manage.py Thu Mar 16 13:39:35 2017
@@ -1,28 +1,10 @@
 #!/usr/bin/env python
-# ====================================================================
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ====================================================================
-
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing
%r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your
settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError
somehow.)\n" % __file__)
-    sys.exit(1)
+import os
+import sys
 
 if __name__ == "__main__":
-    execute_manager(settings)
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nearby_people.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)

Modified: comdev/nearby_people/run.cgi
URL: http://svn.apache.org/viewvc/comdev/nearby_people/run.cgi?rev=1787186&r1=1787185&r2=1787186&view=diff
==============================================================================
--- comdev/nearby_people/run.cgi (original)
+++ comdev/nearby_people/run.cgi Thu Mar 16 13:39:35 2017
@@ -94,5 +94,5 @@ def run_with_cgi(application):
 # Change this to the directory above your site code.
 sys.path.append("/home/mycode")
 # Change mysite to the name of your site package
-os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
+os.environ['DJANGO_SETTINGS_MODULE'] = 'nearby_people.settings'
 run_with_cgi(django.core.handlers.wsgi.WSGIHandler())

Copied: comdev/nearby_people/run_wsgi.py (from r1787185, comdev/nearby_people/run.wsgi)
URL: http://svn.apache.org/viewvc/comdev/nearby_people/run_wsgi.py?p2=comdev/nearby_people/run_wsgi.py&p1=comdev/nearby_people/run.wsgi&r1=1787185&r2=1787186&rev=1787186&view=diff
==============================================================================
--- comdev/nearby_people/run.wsgi (original)
+++ comdev/nearby_people/run_wsgi.py Thu Mar 16 13:39:35 2017
@@ -1,14 +1,34 @@
+"""
+WSGI config for nearby_people project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+"""
+
 import sys, os
 
 # The path needs to contain the installed directory (i.e. the directory with
 #  this file in it), the parent of the installed directory, wherever your
 #  Django install is, plus the system path
-# This line is just an example
 sys.path = [ '/var/python_apps/', '/var/python_apps/nearby_people/', '/var/python_apps/django-1.0',
'/var/python/lib/python2.4' ] + sys.path
 
 # Tell the Django WSGI handler which settings file to bootstap from
 os.environ["DJANGO_SETTINGS_MODULE"] = "nearby_people.settings"
 
-# Off we go!
-import django.core.handlers.wsgi
-application = django.core.handlers.wsgi.WSGIHandler()
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)

Modified: comdev/nearby_people/settings.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/settings.py?rev=1787186&r1=1787185&r2=1787186&view=diff
==============================================================================
--- comdev/nearby_people/settings.py (original)
+++ comdev/nearby_people/settings.py Thu Mar 16 13:39:35 2017
@@ -23,25 +23,34 @@ OUR_ROOT = os.path.realpath(os.path.dirn
 sys.path = [os.path.join(OUR_ROOT, 'lib')] + sys.path
 
 # Normal settings from here
+
+# Django settings for nearby_people project.
 DEBUG = False
 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = ()
 MANAGERS = ADMINS
 
-DATABASE_ENGINE = ''           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3'
or 'oracle'.
-DATABASE_NAME = ''             # Or path to database file if using sqlite3.
-DATABASE_USER = ''             # Not used with sqlite3.
-DATABASE_PASSWORD = ''         # Not used with sqlite3.
-DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
+DATABASES = {
+#    'default': {
+#        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3'
or 'oracle'.
+#        'NAME': '',                      # Or path to database file if using sqlite3.
+#        'USER': '',                      # Not used with sqlite3.
+#        'PASSWORD': '',                  # 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.
+#    }
+}
+
+# Hosts/domain names that are valid for this site; required if DEBUG is False
+# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
+ALLOWED_HOSTS = []
 
 # Local time zone for this installation. Choices can be found here:
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 # although not all choices may be available on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
+# In a Windows environment this must be set to your system time zone.
+TIME_ZONE = 'UTC'
 
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html
@@ -53,38 +62,75 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale.
+USE_L10N = True
+
+# If you set this to False, Django will not use timezone-aware datetimes.
+USE_TZ = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
 MEDIA_ROOT = ''
 
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
 MEDIA_URL = ''
 
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = '/static/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+    # 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.
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+    'django.contrib.staticfiles.finders.FileSystemFinder',
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
 
 # Make this unique, and don't share it with anybody.
-SECRET_KEY = 'urxyidshwg$k-*j63h$=2215u24l4crufkx0719w$t$$8di&(o'
+SECRET_KEY = '0ze^&a8rs=tux!xdz6#&y693v%11&!$$&*5q^y_(3y)qe)qqv7'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-#     'django.template.loaders.eggs.load_template_source',
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
 )
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
+
+    # We are currently stateless
+    #'django.contrib.sessions.middleware.SessionMiddleware',
+    #'django.middleware.csrf.CsrfViewMiddleware',
+    #'django.contrib.auth.middleware.AuthenticationMiddleware',
+    #'django.contrib.messages.middleware.MessageMiddleware',
+
+    # Uncomment the next line for simple clickjacking protection:
+    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 )
 
 ROOT_URLCONF = 'nearby_people.urls'
 
+# Python dotted path to the WSGI application used by Django's runserver.
+WSGI_APPLICATION = 'nearby_people.run_wsgi.application'
+
 TEMPLATE_DIRS = (
     os.path.join(OUR_ROOT, 'templates'),
 )
@@ -94,9 +140,45 @@ INSTALLED_APPS = (
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
-	'nearby_people.nearby',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    # Uncomment the next line to enable the admin:
+    # 'django.contrib.admin',
+    # Uncomment the next line to enable admin documentation:
+    # 'django.contrib.admindocs',
+    'nearby_people.nearby',
 )
 
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error when DEBUG=False.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+    'version': 1,
+    'disable_existing_loggers': False,
+    'filters': {
+        'require_debug_false': {
+            '()': 'django.utils.log.RequireDebugFalse'
+        }
+    },
+    'handlers': {
+        'mail_admins': {
+            'level': 'ERROR',
+            'filters': ['require_debug_false'],
+            'class': 'django.utils.log.AdminEmailHandler'
+        }
+    },
+    'loggers': {
+        'django.request': {
+            'handlers': ['mail_admins'],
+            'level': 'ERROR',
+            'propagate': True,
+        },
+    }
+}
+
+# Allow our local overrides to settings
 try:
     from local_settings import *
 except ImportError:



Mime
View raw message