Skip to content

Instantly share code, notes, and snippets.

@jqlblue
Created December 18, 2013 06:38
Show Gist options
  • Save jqlblue/8018185 to your computer and use it in GitHub Desktop.
Save jqlblue/8018185 to your computer and use it in GitHub Desktop.
sentry config example
# This file is just Python, with a touch of Django which means you
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
# You can swap out the engine for MySQL easily by changing this value
# to ``django.db.backends.mysql`` or to PostgreSQL with
# ``django.db.backends.postgresql_psycopg2``
# If you change this, you'll also need to install the appropriate python
# package: psycopg2 (Postgres) or mysql-python
'ENGINE': 'django.db.backends.mysql',
'NAME': 'sentry_db',
'USER': 'db_user',
'PASSWORD': 'db_password',
'HOST': '127.0.0.1', # db host
'PORT': '3306', # db port
# If you're using Postgres, we recommend turning on autocommit
# 'OPTIONS': {
# 'autocommit': True,
# }
}
}
###########
## Authentication ##
###########
SENTRY_ALLOW_REGISTRATION = True
SENTRY_ALLOW_TEAM_CREATION = False
SENTRY_ALLOW_PUBLIC_PROJECTS = False
SENTRY_PUBLIC = False
SENTRY_ALLOW_PROJECT_CREATION = False
SENTRY_SAMPLE_DATA = True
# If you're expecting any kind of real traffic on Sentry, we highly recommend
# configuring the CACHES and Redis settings
###########
## CACHE ##
###########
# You'll need to install the required dependencies for Memcached:
# pip install python-memcached
#
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': ['127.0.0.1:11211'], #memcache_host:memcache_port
}
}
###########
## Queue ##
###########
# See http://sentry.readthedocs.org/en/latest/queue/index.html for more
# information on configuring your queue broker and workers. Sentry relies
# on a Python framework called Celery to manage queues.
# You can enable queueing of jobs by turning off the always eager setting:
CELERY_ALWAYS_EAGER = False
BROKER_URL = 'redis://:[email protected]:6379/0'
####################
## Update Buffers ##
####################
# Buffers (combined with queueing) act as an intermediate layer between the
# database and the storage API. They will greatly improve efficiency on large
# numbers of the same events being sent to the API in a short amount of time.
# (read: if you send any kind of real data to Sentry, you should enable buffers)
# You'll need to install the required dependencies for Redis buffers:
# pip install redis hiredis nydus
#
SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer'
SENTRY_REDIS_OPTIONS = {
'hosts': {
0: {
'host': '127.0.0.1',
'port': 6379,
'db': 1,
'password': 'auth_password',
'timeout': 1,
}
}
}
################
## Web Server ##
################
# You MUST configure the absolute URI root for Sentry:
SENTRY_URL_PREFIX = 'http://10.16.15.1'
# If you're using a reverse proxy, you should enable the X-Forwarded-Proto
# and X-Forwarded-Host headers, and uncomment the following settings
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# USE_X_FORWARDED_HOST = True
SENTRY_WEB_HOST = '127.0.0.1'
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
'workers': 3, # the number of gunicorn workers
'worker_class': 'gevent',
'limit_request_line': 0, # required for raven-js
'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'},
}
################
## Node Storage ##
################
SENTRY_NODESTORE = 'sentry.nodestore.django.DjangoNodeStorage'
SENTRY_NODESTORE_OPTIONS = {}
#################
## Udp Server ##
#################
# http://sentry.readthedocs.org/en/latest/config/index.html#config-udp-server
SENTRY_UDP_HOST = '10.16.15.1'
SENTRY_UDP_PORT = 9101
#################
## Mail Server ##
#################
# For more information check Django's documentation:
# https://docs.djangoproject.com/en/1.3/topics/email/?from=olddocs#e-mail-backends
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp_mail_server_host'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_HOST_USER = 'send user'
EMAIL_PORT = 25
EMAIL_USE_TLS = False
# The email address to send on behalf of
SERVER_EMAIL = 'send user email'
###########
## etc. ##
###########
# If this file ever becomes compromised, it's important to regenerate your SECRET_KEY
# Changing this value will result in all current sessions being invalidated
SECRET_KEY = 'xxxxxxxxxxxxgggggggggggggggggggg'
@hustcc
Copy link

hustcc commented Jan 15, 2016

我看到sentry的local目录有各种语言,但是怎么配置locale呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment