Merge Request #51

Merged
softwarepublico/colab!51
Created by Sergio Oliveira

Fix settings

Assignee: None
Milestone: None

Merged by Sergio Oliveira

Source branch has been removed
Commits (3)
1 participants
colab/management/initconfig.py
... ... @@ -3,128 +3,133 @@ from django.utils.crypto import get_random_string
3 3  
4 4  
5 5 CONFIG_TEMPLATE = """
6   -
7 6 ## Set to false in production
8   -DEBUG: true
9   -TEMPLATE_DEBUG: true
  7 +DEBUG = True
  8 +TEMPLATE_DEBUG = True
10 9  
11 10 ## System admins
12   -ADMINS: &admin
13   - -
14   - - John Foo
15   - - john@example.com
16   - -
17   - - Mary Bar
18   - - mary@example.com
  11 +ADMINS = [['John Foo', 'john@example.com'], ['Mary Bar', 'mary@example.com']]
19 12  
20   -MANAGERS: *admin
  13 +MANAGERS = ADMINS
21 14  
22   -COLAB_FROM_ADDRESS: '"Colab" <noreply@example.com>'
23   -SERVER_EMAIL: '"Colab" <noreply@example.com>'
  15 +COLAB_FROM_ADDRESS = '"Colab" <noreply@example.com>'
  16 +SERVER_EMAIL = '"Colab" <noreply@example.com>'
24 17  
25   -EMAIL_HOST: localhost
26   -EMAIL_PORT: 25
27   -EMAIL_SUBJECT_PREFIX: '[colab]'
  18 +EMAIL_HOST = 'localhost'
  19 +EMAIL_PORT = 25
  20 +EMAIL_SUBJECT_PREFIX = '[colab]'
28 21  
29   -SECRET_KEY: '{secret_key}'
  22 +SECRET_KEY = '{secret_key}'
30 23  
31 24 # Must use it without trailing slash
32   -SITE_URL: 'http://localhost:8000'
33   -BROWSERID_AUDIENCES:
34   - - http://localhost:8000
35   -# - http://example.com
36   -# - https://example.org
37   -# - http://example.net
38   -
39   -ALLOWED_HOSTS:
40   - - localhost
41   -# - example.com
42   -# - example.org
43   -# - example.net
  25 +SITE_URL = 'http://localhost:8000'
  26 +BROWSERID_AUDIENCES = [
  27 + 'http://localhost:8000',
  28 +# 'http://example.com',
  29 +# 'https://example.org',
  30 +# 'http://example.net',
  31 +]
  32 +
  33 +ALLOWED_HOSTS = [
  34 + 'localhost',
  35 +# 'example.com',
  36 +# 'example.org',
  37 +# 'example.net',
  38 +]
44 39  
45 40 ### Uncomment to enable Broswer ID protocol for authentication
46   -# BROWSERID_ENABLED: True
  41 +# BROWSERID_ENABLED = True
47 42  
48 43 ### Uncomment to enable social networks fields profile
49   -# SOCIAL_NETWORK_ENABLED: True
  44 +# SOCIAL_NETWORK_ENABLED = True
50 45  
51 46 ### Uncomment to enable Converse.js
52   -# CONVERSEJS_ENABLED: True
  47 +# CONVERSEJS_ENABLED = True
53 48  
54 49 ### Uncomment to enable auto-registration
55   -# CONVERSEJS_AUTO_REGISTER: 'xmpp.example.com'
  50 +# CONVERSEJS_AUTO_REGISTER = 'xmpp.example.com'
56 51  
57 52 ## Database settings
58   -DATABASES:
59   - default:
60   - ENGINE: django.db.backends.postgresql_psycopg2
61   - HOST: localhost
62   - NAME: colab
63   - USER: colab
64   - PASSWORD: colab
  53 +DATABASES = {{
  54 + 'default': {{
  55 + 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  56 + 'HOST': 'localhost',
  57 + 'NAME': 'colab',
  58 + 'USER': 'colab',
  59 + 'PASSWORD': 'colab',
  60 + }}
  61 +}}
65 62  
66 63 ## Disable indexing
67   -ROBOTS_NOINDEX: false
  64 +ROBOTS_NOINDEX = False
68 65  
69 66 ### Log errors to Sentry instance
70   -# RAVEN_DSN: 'http://public:secret@example.com/1'
71   -
72   -COLAB_TEMPLATES:
73   -
74   -COLAB_STATICS:
75   -
76   -# FEEDZILLA_SITE_TITLE: 'Planet Colab'
77   -# FEEDZILLA_SITE_DESCRIPTION: 'Colab blog aggregator'
78   -# FEEDZILLA_PAGE_SIZE: 10
79   -
80   -### Colab proxied apps
81   -# COLAB_APPS:
82   -# colab.plugins.gitlab:
83   -# upstream: 'http://www.fga.unb.br/'
84   -# menu:
85   -# title: 'Code'
86   -# links:
87   -# Public Projects: '/gitlab/public/projects'
88   -# auth_links:
89   -# Profile: 'gitlab/profile'
90   -# New Project: 'gitlab/projects/new'
91   -# Projects: 'gitlab/dashboard/projects'
92   -# Groups: 'gitlab/pprofile/groups'
93   -# Issues: 'gitlab/dashboard/issues'
94   -# Merge Requests: 'gitlab/merge_requests'
95   -# dpaste:
96   -# dependencies:
97   -# - 'mptt'
98   -# urls:
99   -# include: 'dpaste.urls.dpaste'
100   -# prefix: '^paste/'
101   -# namespace: 'dpaste'
102   -# menu:
103   -# title: 'Dpaste'
104   -# links:
105   -# Public Projects: '/paste'
106   -# auth_links:
107   -# Profile: '/projects'
108   -# New Project: '/projects/new'
109   -# feedzilla:
110   -# dependencies:
111   -# - 'common'
112   -# urls:
113   -# include: 'feedzilla.urls'
114   -# prefix: '^planet/'
115   -# namespace: 'planet'
116   -# templates:
117   -# context_processors:
118   -# - 'colab.planet.context_processors.feedzilla'
119   -# menu:
120   -# title: 'Planet'
121   -# links:
122   -# Index: '/planet'
123   -# auth_links:
124   -# {}
125   -
126   -
127   -
  67 +# RAVEN_DSN = 'http://public:secret@example.com/1'
  68 +
  69 +LOGGING = {{
  70 + 'version': 1,
  71 +
  72 + 'handlers': {{
  73 + 'null': {{
  74 + 'level': 'DEBUG',
  75 + 'class': 'logging.NullHandler',
  76 + }},
  77 + }},
  78 +
  79 + 'loggers': {{
  80 + 'colab.mailman': {{
  81 + 'handlers': ['null'],
  82 + 'propagate': False,
  83 + }},
  84 + 'haystack': {{
  85 + 'handlers': ['null'],
  86 + 'propagate': False,
  87 + }},
  88 + 'pysolr': {{
  89 + 'handlers': ['null'],
  90 + 'propagate': False,
  91 + }},
  92 + }},
  93 +}}
  94 +
  95 +
  96 +## Gitlab plugin - Put this in plugins.d/gitlab.py to actiate ##
  97 +# from django.utils.translation import ugettext_lazy as _
  98 +# from colab.plugins.utils.menu import colab_url_factory
  99 +#
  100 +# name = 'colab.plugins.gitlab'
  101 +# verbose_name = 'Gitlab Proxy'
  102 +#
  103 +# upstream = 'localhost'
  104 +# #middlewares = []
  105 +#
  106 +# urls = {{
  107 +# 'include': 'colab.plugins.gitlab.urls',
  108 +# 'namespace': 'gitlab',
  109 +# 'prefix': 'gitlab',
  110 +# }}
  111 +#
  112 +# menu_title = _('Code')
  113 +#
  114 +# url = colab_url_factory('gitlab')
  115 +#
  116 +# menu_urls = (
  117 +# url(display=_('Public Projects'), viewname='gitlab',
  118 +# kwargs={{'path': '/public/projects'}}, auth=False),
  119 +# url(display=_('Profile'), viewname='gitlab',
  120 +# kwargs={{'path': '/profile'}}, auth=True),
  121 +# url(display=_('New Project'), viewname='gitlab',
  122 +# kwargs={{'path': '/projects/new'}}, auth=True),
  123 +# url(display=_('Projects'), viewname='gitlab',
  124 +# kwargs={{'path': '/dashboard/projects'}}, auth=True),
  125 +# url(display=_('Groups'), viewname='gitlab',
  126 +# kwargs={{'path': '/profile/groups'}}, auth=True),
  127 +# url(display=_('Issues'), viewname='gitlab',
  128 +# kwargs={{'path': '/dashboard/issues'}}, auth=True),
  129 +# url(display=_('Merge Requests'), viewname='gitlab',
  130 +# kwargs={{'path': '/merge_requests'}}, auth=True),
  131 +#
  132 +# )
128 133 """
129 134  
130 135  
... ...
colab/settings.py
... ... @@ -279,7 +279,7 @@ CONVERSEJS_SHOW_ONLY_ONLINE_USERS = True
279 279 # Tastypie settings
280 280 TASTYPIE_DEFAULT_FORMATS = ['json', ]
281 281  
282   -from .utils.conf import load_colab_apps
  282 +from .utils.conf import load_colab_apps, load_py_settings
283 283  
284 284 if locals().get('RAVEN_DSN', False):
285 285 RAVEN_CONFIG = {
... ... @@ -291,6 +291,7 @@ BROWSERID_ENABLED = locals().get(&#39;BROWSERID_ENABLED&#39;) or False
291 291 SOCIAL_NETWORK_ENABLED = locals().get('SOCIAL_NETWORK_ENABLED') or False
292 292  
293 293 locals().update(load_colab_apps())
  294 +locals().update(load_py_settings())
294 295  
295 296 COLAB_APPS = locals().get('COLAB_APPS') or {}
296 297 PROXIED_APPS = {}
... ...
vagrant/provision.sh
... ... @@ -27,8 +27,8 @@ for dir in /vagrant/colab /vagrant; do
27 27 done
28 28 pip install -e $basedir
29 29  
30   -if [ ! -s /etc/colab/settings.yaml ]; then
31   - colab-init-config > /etc/colab/settings.yaml
  30 +if [ ! -s /etc/colab/settings.py ]; then
  31 + colab-init-config > /etc/colab/settings.py
32 32 fi
33 33  
34 34 colab-admin migrate
... ...