|
1 import os |
|
2 |
|
3 from django.utils.translation import ugettext_lazy as _ |
|
4 |
|
5 from openstack_dashboard import exceptions |
|
6 |
|
7 DEBUG = False |
|
8 TEMPLATE_DEBUG = DEBUG |
|
9 |
|
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 # If Horizon is being served through SSL, then uncomment the following two |
|
18 # settings to better secure the cookies from security exploits |
|
19 CSRF_COOKIE_SECURE = True |
|
20 SESSION_COOKIE_SECURE = True |
|
21 |
|
22 # Default configuration uses /horizon as the application root. Configure auth |
|
23 # redirects here accordingly. |
|
24 LOGIN_URL = '/horizon/auth/login/' |
|
25 LOGOUT_URL = '/horizon/auth/logout/' |
|
26 LOGIN_REDIRECT_URL = '/horizon' |
|
27 |
|
28 # Set STATIC_ROOT directly. |
|
29 STATIC_ROOT = "/var/lib/openstack_dashboard/static" |
|
30 |
|
31 # Enable Solaris theme |
|
32 TEMPLATE_DIRS = ('/var/lib/openstack_dashboard/static/solaris/theme', ) |
|
33 |
|
34 # Default OpenStack Dashboard configuration. |
|
35 HORIZON_CONFIG = { |
|
36 'dashboards': ('project', 'admin', 'settings',), |
|
37 'default_dashboard': 'project', |
|
38 'user_home': 'openstack_dashboard.views.get_user_home', |
|
39 'ajax_queue_limit': 10, |
|
40 'auto_fade_alerts': { |
|
41 'delay': 3000, |
|
42 'fade_duration': 1500, |
|
43 'types': ['alert-success', 'alert-info'] |
|
44 }, |
|
45 'help_url': "http://docs.openstack.org", |
|
46 'exceptions': {'recoverable': exceptions.RECOVERABLE, |
|
47 'not_found': exceptions.NOT_FOUND, |
|
48 'unauthorized': exceptions.UNAUTHORIZED}, |
|
49 } |
|
50 |
|
51 # Specify a regular expression to validate user passwords. |
|
52 # HORIZON_CONFIG["password_validator"] = { |
|
53 # "regex": '.*', |
|
54 # "help_text": _("Your password does not meet the requirements.") |
|
55 # } |
|
56 |
|
57 # Disable simplified floating IP address management for deployments with |
|
58 # multiple floating IP pools or complex network requirements. |
|
59 # HORIZON_CONFIG["simple_ip_management"] = False |
|
60 |
|
61 # Turn off browser autocompletion for the login form if so desired. |
|
62 # HORIZON_CONFIG["password_autocomplete"] = "off" |
|
63 |
|
64 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) |
|
65 |
|
66 # Set custom secret key: |
|
67 # You can either set it to a specific value or you can let horizion generate a |
|
68 # default secret key that is unique on this machine, e.i. regardless of the |
|
69 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there |
|
70 # may be situations where you would want to set this explicitly, e.g. when |
|
71 # multiple dashboard instances are distributed on different machines (usually |
|
72 # behind a load-balancer). Either you have to make sure that a session gets all |
|
73 # requests routed to the same dashboard instance or you set the same SECRET_KEY |
|
74 # for all of them. |
|
75 from horizon.utils import secret_key |
|
76 SECRET_KEY = secret_key.generate_key() |
|
77 |
|
78 # We recommend you use memcached for development; otherwise after every reload |
|
79 # of the django development server, you will have to login again. To use |
|
80 # memcached set CACHES to something like |
|
81 # CACHES = { |
|
82 # 'default': { |
|
83 # 'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache', |
|
84 # 'LOCATION' : '127.0.0.1:11211', |
|
85 # } |
|
86 #} |
|
87 |
|
88 CACHES = { |
|
89 'default': { |
|
90 'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache' |
|
91 } |
|
92 } |
|
93 |
|
94 # Send email to the console by default |
|
95 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
|
96 # Or send them to /dev/null |
|
97 #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' |
|
98 |
|
99 # Configure these for your outgoing email host |
|
100 # EMAIL_HOST = 'smtp.my-company.com' |
|
101 # EMAIL_PORT = 25 |
|
102 # EMAIL_HOST_USER = 'djangomail' |
|
103 # EMAIL_HOST_PASSWORD = 'top-secret!' |
|
104 |
|
105 # For multiple regions uncomment this configuration, and add (endpoint, title). |
|
106 # AVAILABLE_REGIONS = [ |
|
107 # ('http://cluster1.example.com:5000/v2.0', 'cluster1'), |
|
108 # ('http://cluster2.example.com:5000/v2.0', 'cluster2'), |
|
109 # ] |
|
110 |
|
111 OPENSTACK_HOST = "127.0.0.1" |
|
112 OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST |
|
113 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" |
|
114 |
|
115 # Disable SSL certificate checks (useful for self-signed certificates): |
|
116 # OPENSTACK_SSL_NO_VERIFY = True |
|
117 |
|
118 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the |
|
119 # capabilities of the auth backend for Keystone. |
|
120 # If Keystone has been configured to use LDAP as the auth backend then set |
|
121 # can_edit_user to False and name to 'ldap'. |
|
122 # |
|
123 # TODO(tres): Remove these once Keystone has an API to identify auth backend. |
|
124 OPENSTACK_KEYSTONE_BACKEND = { |
|
125 'name': 'native', |
|
126 'can_edit_user': True, |
|
127 'can_edit_project': True |
|
128 } |
|
129 |
|
130 OPENSTACK_HYPERVISOR_FEATURES = { |
|
131 'can_set_mount_point': True, |
|
132 |
|
133 # NOTE: as of Grizzly this is not yet supported in Nova so enabling this |
|
134 # setting will not do anything useful |
|
135 'can_encrypt_volumes': False |
|
136 } |
|
137 |
|
138 # The OPENSTACK_QUANTUM_NETWORK settings can be used to enable optional |
|
139 # services provided by quantum. Currently only the load balancer service |
|
140 # is available. |
|
141 OPENSTACK_QUANTUM_NETWORK = { |
|
142 'enable_lb': False |
|
143 } |
|
144 |
|
145 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints |
|
146 # in the Keystone service catalog. Use this setting when Horizon is running |
|
147 # external to the OpenStack environment. The default is 'internalURL'. |
|
148 #OPENSTACK_ENDPOINT_TYPE = "publicURL" |
|
149 |
|
150 # The number of objects (Swift containers/objects or images) to display |
|
151 # on a single page before providing a paging element (a "more" link) |
|
152 # to paginate results. |
|
153 API_RESULT_LIMIT = 1000 |
|
154 API_RESULT_PAGE_SIZE = 20 |
|
155 |
|
156 # The timezone of the server. This should correspond with the timezone |
|
157 # of your entire OpenStack installation, and hopefully be in UTC. |
|
158 TIME_ZONE = "UTC" |
|
159 |
|
160 LOGGING = { |
|
161 'version': 1, |
|
162 # When set to True this will disable all logging except |
|
163 # for loggers specified in this configuration dictionary. Note that |
|
164 # if nothing is specified here and disable_existing_loggers is True, |
|
165 # django.db.backends will still log unless it is disabled explicitly. |
|
166 'disable_existing_loggers': False, |
|
167 'handlers': { |
|
168 'null': { |
|
169 'level': 'DEBUG', |
|
170 'class': 'django.utils.log.NullHandler', |
|
171 }, |
|
172 'console': { |
|
173 # Set the level to "DEBUG" for verbose output logging. |
|
174 'level': 'INFO', |
|
175 'class': 'logging.StreamHandler', |
|
176 }, |
|
177 }, |
|
178 'loggers': { |
|
179 # Logging from django.db.backends is VERY verbose, send to null |
|
180 # by default. |
|
181 'django.db.backends': { |
|
182 'handlers': ['null'], |
|
183 'propagate': False, |
|
184 }, |
|
185 'requests': { |
|
186 'handlers': ['null'], |
|
187 'propagate': False, |
|
188 }, |
|
189 'horizon': { |
|
190 'handlers': ['console'], |
|
191 'propagate': False, |
|
192 }, |
|
193 'openstack_dashboard': { |
|
194 'handlers': ['console'], |
|
195 'propagate': False, |
|
196 }, |
|
197 'novaclient': { |
|
198 'handlers': ['console'], |
|
199 'propagate': False, |
|
200 }, |
|
201 'keystoneclient': { |
|
202 'handlers': ['console'], |
|
203 'propagate': False, |
|
204 }, |
|
205 'glanceclient': { |
|
206 'handlers': ['console'], |
|
207 'propagate': False, |
|
208 }, |
|
209 'nose.plugins.manager': { |
|
210 'handlers': ['console'], |
|
211 'propagate': False, |
|
212 } |
|
213 } |
|
214 } |