initial configuration to support opbeat

This commit is contained in:
Burhan Khalid 2015-11-16 18:55:37 +03:00
parent 9c28c8e0df
commit 727281e99a
5 changed files with 30 additions and 1 deletions

View File

@ -45,6 +45,7 @@ Optional Integrations
* Integration with Maildump_ for local email testing * Integration with Maildump_ for local email testing
* Integration with Sentry_ for error logging * Integration with Sentry_ for error logging
* Integration with NewRelic_ for performance monitoring * Integration with NewRelic_ for performance monitoring
* Integration with Opbeat_ for performance monitoring
.. _alpha: http://blog.getbootstrap.com/2015/08/19/bootstrap-4-alpha/ .. _alpha: http://blog.getbootstrap.com/2015/08/19/bootstrap-4-alpha/
.. _Hitch: https://github.com/hitchtest/hitchtest .. _Hitch: https://github.com/hitchtest/hitchtest
@ -62,6 +63,7 @@ Optional Integrations
.. _Sentry: https://getsentry.com .. _Sentry: https://getsentry.com
.. _NewRelic: https://newrelic.com .. _NewRelic: https://newrelic.com
.. _docker-compose: https://www.github.com/docker/compose .. _docker-compose: https://www.github.com/docker/compose
.. _Opbeat: https://opbeat.com/
Constraints Constraints
@ -116,6 +118,7 @@ It prompts you for questions. Answer them::
use_maildump [n]: n use_maildump [n]: n
use_sentry [n]: y use_sentry [n]: y
use_newrelic [n]: y use_newrelic [n]: y
use_obpeat [n]: y
windows [n]: n windows [n]: n
use_python2 [n]: y use_python2 [n]: y

View File

@ -14,6 +14,7 @@
"use_maildump": "n", "use_maildump": "n",
"use_sentry": "n", "use_sentry": "n",
"use_newrelic": "n", "use_newrelic": "n",
"use_opbeat": "n",
"windows": "n", "windows": "n",
"use_python2": "n" "use_python2": "n"
} }

View File

@ -41,4 +41,7 @@ DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a
DJANGO_MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error DJANGO_MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error
DJANGO_MAILGUN_SERVER_NAME MAILGUN_SERVER_NAME n/a raises error DJANGO_MAILGUN_SERVER_NAME MAILGUN_SERVER_NAME n/a raises error
NEW_RELIC_LICENSE_KEY NEW_RELIC_LICENSE_KEY n/a raises error NEW_RELIC_LICENSE_KEY NEW_RELIC_LICENSE_KEY n/a raises error
DJANGO_OPBEAT_APP_ID OPBEAT['APP_ID'] n/a raises error
DJANGO_OPBEAT_SECRET_TOKEN OPBEAT['SECRET_TOKEN'] n/a raises error
DJANGO_OPBEAT_ORGANIZATION_ID OPBEAT['ORGANIZATION_ID'] n/a raises error
======================================= =========================== ============================================== ====================================================================== ======================================= =========================== ============================================== ======================================================================

View File

@ -9,6 +9,9 @@ Production Configurations
{% if cookiecutter.use_sentry == "y" %} {% if cookiecutter.use_sentry == "y" %}
- Use sentry for error logging - Use sentry for error logging
{% endif %} {% endif %}
{% if cookiecutter.use_opbeat == "y" %}
- Use opbeat for error reporting
{% endif %}
''' '''
from __future__ import absolute_import, unicode_literals from __future__ import absolute_import, unicode_literals
@ -18,6 +21,7 @@ from django.utils import six
import logging import logging
{% endif %} {% endif %}
from .common import * # noqa from .common import * # noqa
# SECRET CONFIGURATION # SECRET CONFIGURATION
@ -52,7 +56,19 @@ MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + \
MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + MIDDLEWARE_CLASSES MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + MIDDLEWARE_CLASSES
{%- endif %} {%- endif %}
{% if cookiecutter.use_opbeat == "y" -%}
# opbeat integration
# See https://opbeat.com/languages/django/
INSTALLED_APPS += ('opbeat.contrib.django',)
OPBEAT = {
'ORGANIZATION_ID': env('DJANGO_OPBEAT_ORGANIZATION_ID'),
'APP_ID': env('DJANGO_OPBEAT_APP_ID'),
'SECRET_TOKEN': env('DJANGO_OPBEAT_SECRET_TOKEN')
}
MIDDLEWARE_CLASSES += (
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
)
{%- endif %}
# set this to 60 seconds and then to 518400 when you can prove it works # set this to 60 seconds and then to 518400 when you can prove it works
SECURE_HSTS_SECONDS = 60 SECURE_HSTS_SECONDS = 60
SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool( SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool(

View File

@ -37,3 +37,9 @@ raven
# ----------------------------------------- # -----------------------------------------
newrelic newrelic
{%- endif %} {%- endif %}
{% if cookiecutter.use_opbeat == "y" -%}
# Opbeat agent for performance monitoring
# -----------------------------------------
opbeat
{%- endif %}