| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 1 | import os | 
|  | 2 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 3 | from django.utils.translation import ugettext_lazy as _ | 
|  | 4 |  | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 5 | DEBUG = True | 
|  | 6 | TEMPLATE_DEBUG = DEBUG | 
|  | 7 | PROD = False | 
|  | 8 | USE_SSL = False | 
|  | 9 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 10 | # Set SSL proxy settings: | 
|  | 11 | # For Django 1.4+ pass this header from the proxy after terminating the SSL, | 
|  | 12 | # and don't forget to strip it from the client's request. | 
|  | 13 | # For more information see: | 
|  | 14 | # https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header | 
|  | 15 | # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') | 
|  | 16 |  | 
|  | 17 | # Specify a regular expression to validate user passwords. | 
|  | 18 | # HORIZON_CONFIG = { | 
|  | 19 | #     "password_validator": { | 
|  | 20 | #         "regex": '.*', | 
|  | 21 | #         "help_text": _("Your password does not meet the requirements.") | 
|  | 22 | #     }, | 
|  | 23 | #    'help_url': "http://docs.openstack.org" | 
|  | 24 | # } | 
|  | 25 |  | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 26 | LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) | 
| Jake Dahn | a3492ed | 2011-09-15 22:42:43 -0700 | [diff] [blame] | 27 |  | 
|  | 28 | # FIXME: We need to change this to mysql, instead of sqlite. | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 29 | DATABASES = { | 
|  | 30 | 'default': { | 
|  | 31 | 'ENGINE': 'django.db.backends.sqlite3', | 
|  | 32 | 'NAME': os.path.join(LOCAL_PATH, 'dashboard_openstack.sqlite3'), | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 33 | 'TEST_NAME': os.path.join(LOCAL_PATH, 'test.sqlite3'), | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 34 | }, | 
|  | 35 | } | 
|  | 36 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 37 | # Set custom secret key: | 
|  | 38 | # You can either set it to a specific value or you can let horizion generate a | 
|  | 39 | # default secret key that is unique on this machine, e.i. regardless of the | 
|  | 40 | # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there | 
|  | 41 | # may be situations where you would want to set this explicitly, e.g. when | 
|  | 42 | # multiple dashboard instances are distributed on different machines (usually | 
|  | 43 | # behind a load-balancer). Either you have to make sure that a session gets all | 
|  | 44 | # requests routed to the same dashboard instance or you set the same SECRET_KEY | 
|  | 45 | # for all of them. | 
| Sascha Peilicke | 3453630 | 2012-06-21 16:09:27 +0200 | [diff] [blame] | 46 | from horizon.utils import secret_key | 
|  | 47 | SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store')) | 
|  | 48 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 49 | # We recommend you use memcached for development; otherwise after every reload | 
|  | 50 | # of the django development server, you will have to login again. To use | 
|  | 51 | # memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/' | 
|  | 52 | CACHE_BACKEND = 'dummy://' | 
|  | 53 | SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' | 
|  | 54 |  | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 55 | # Send email to the console by default | 
|  | 56 | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | 
|  | 57 | # Or send them to /dev/null | 
|  | 58 | #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' | 
|  | 59 |  | 
|  | 60 | # django-mailer uses a different settings attribute | 
|  | 61 | MAILER_EMAIL_BACKEND = EMAIL_BACKEND | 
|  | 62 |  | 
|  | 63 | # Configure these for your outgoing email host | 
|  | 64 | # EMAIL_HOST = 'smtp.my-company.com' | 
|  | 65 | # EMAIL_PORT = 25 | 
|  | 66 | # EMAIL_HOST_USER = 'djangomail' | 
|  | 67 | # EMAIL_HOST_PASSWORD = 'top-secret!' | 
|  | 68 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 69 | # For multiple regions uncomment this configuration, and add (endpoint, title). | 
|  | 70 | # AVAILABLE_REGIONS = [ | 
|  | 71 | #     ('http://cluster1.example.com:5000/v2.0', 'cluster1'), | 
|  | 72 | #     ('http://cluster2.example.com:5000/v2.0', 'cluster2'), | 
|  | 73 | # ] | 
|  | 74 |  | 
|  | 75 | OPENSTACK_HOST = "127.0.0.1" | 
|  | 76 | OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST | 
|  | 77 | OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" | 
|  | 78 |  | 
|  | 79 | # Disable SSL certificate checks (useful for self-signed certificates): | 
|  | 80 | # OPENSTACK_SSL_NO_VERIFY = True | 
|  | 81 |  | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 82 | HORIZON_CONFIG = { | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 83 | 'dashboards': ('project', 'admin', 'settings',), | 
|  | 84 | 'default_dashboard': 'project', | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 85 | } | 
|  | 86 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 87 | # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the | 
|  | 88 | # capabilities of the auth backend for Keystone. | 
|  | 89 | # If Keystone has been configured to use LDAP as the auth backend then set | 
|  | 90 | # can_edit_user to False and name to 'ldap'. | 
|  | 91 | # | 
| jakedahn | 770cec7 | 2012-03-12 14:07:51 -0700 | [diff] [blame] | 92 | # TODO(tres): Remove these once Keystone has an API to identify auth backend. | 
|  | 93 | OPENSTACK_KEYSTONE_BACKEND = { | 
|  | 94 | 'name': 'native', | 
|  | 95 | 'can_edit_user': True | 
|  | 96 | } | 
|  | 97 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 98 | OPENSTACK_HYPERVISOR_FEATURES = { | 
|  | 99 | 'can_set_mount_point': True | 
|  | 100 | } | 
|  | 101 |  | 
|  | 102 | # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints | 
|  | 103 | # in the Keystone service catalog. Use this setting when Horizon is running | 
|  | 104 | # external to the OpenStack environment. The default is 'internalURL'. | 
|  | 105 | #OPENSTACK_ENDPOINT_TYPE = "publicURL" | 
|  | 106 |  | 
|  | 107 | # The number of objects (Swift containers/objects or images) to display | 
|  | 108 | # on a single page before providing a paging element (a "more" link) | 
|  | 109 | # to paginate results. | 
|  | 110 | API_RESULT_LIMIT = 1000 | 
|  | 111 | API_RESULT_PAGE_SIZE = 20 | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 112 |  | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 113 | SWIFT_PAGINATE_LIMIT = 100 | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 114 |  | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 115 | # The timezone of the server. This should correspond with the timezone | 
|  | 116 | # of your entire OpenStack installation, and hopefully be in UTC. | 
|  | 117 | TIME_ZONE = "UTC" | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 118 |  | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 119 | #LOGGING = { | 
|  | 120 | #        'version': 1, | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 121 | #        # When set to True this will disable all logging except | 
|  | 122 | #        # for loggers specified in this configuration dictionary. Note that | 
|  | 123 | #        # if nothing is specified here and disable_existing_loggers is True, | 
|  | 124 | #        # django.db.backends will still log unless it is disabled explicitly. | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 125 | #        'disable_existing_loggers': False, | 
|  | 126 | #        'handlers': { | 
|  | 127 | #            'null': { | 
|  | 128 | #                'level': 'DEBUG', | 
|  | 129 | #                'class': 'django.utils.log.NullHandler', | 
|  | 130 | #                }, | 
|  | 131 | #            'console': { | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 132 | #                # Set the level to "DEBUG" for verbose output logging. | 
|  | 133 | #                'level': 'INFO', | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 134 | #                'class': 'logging.StreamHandler', | 
|  | 135 | #                }, | 
|  | 136 | #            }, | 
|  | 137 | #        'loggers': { | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 138 | #            # Logging from django.db.backends is VERY verbose, send to null | 
|  | 139 | #            # by default. | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 140 | #            'django.db.backends': { | 
|  | 141 | #                'handlers': ['null'], | 
|  | 142 | #                'propagate': False, | 
|  | 143 | #                }, | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 144 | #            'horizon': { | 
|  | 145 | #                'handlers': ['console'], | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 146 | #                'propagate': False, | 
|  | 147 | #            }, | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 148 | #            'openstack_dashboard': { | 
|  | 149 | #                'handlers': ['console'], | 
|  | 150 | #                'propagate': False, | 
|  | 151 | #            }, | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 152 | #            'novaclient': { | 
|  | 153 | #                'handlers': ['console'], | 
|  | 154 | #                'propagate': False, | 
|  | 155 | #            }, | 
|  | 156 | #            'keystoneclient': { | 
|  | 157 | #                'handlers': ['console'], | 
|  | 158 | #                'propagate': False, | 
|  | 159 | #            }, | 
| Dean Troyer | 1b23d7c | 2012-10-04 13:52:22 -0500 | [diff] [blame] | 160 | #            'glanceclient': { | 
|  | 161 | #                'handlers': ['console'], | 
|  | 162 | #                'propagate': False, | 
|  | 163 | #            }, | 
| Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 164 | #            'nose.plugins.manager': { | 
|  | 165 | #                'handlers': ['console'], | 
|  | 166 | #                'propagate': False, | 
|  | 167 | #            } | 
| Jake Dahn | 9337b33 | 2011-09-15 21:46:20 -0700 | [diff] [blame] | 168 | #        } | 
|  | 169 | #} |