From f4d9347dd1bfa201257943275fdf385f1a481ebc Mon Sep 17 00:00:00 2001 From: "Nikita P. Shupeyko" Date: Sun, 3 Sep 2017 11:49:10 +0300 Subject: [PATCH] Rename use_sentry_for_error_reporting to use_sentry --- README.rst | 2 +- cookiecutter.json | 2 +- docs/project-generation-options.rst | 2 +- {{cookiecutter.project_slug}}/README.rst | 2 +- .../config/settings/production.py | 12 ++++++------ {{cookiecutter.project_slug}}/config/wsgi.py | 4 ++-- {{cookiecutter.project_slug}}/env.example | 2 +- .../requirements/production.txt | 2 +- .../{{cookiecutter.project_slug}}/taskapp/celery.py | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index 2b239f784..fd52cf7a4 100644 --- a/README.rst +++ b/README.rst @@ -157,7 +157,7 @@ Answer the prompts with your own desired options_. For example:: use_whitenoise [y]: n use_celery [n]: y use_mailhog [n]: n - use_sentry_for_error_reporting [y]: y + use_sentry [y]: y use_opbeat [n]: y use_pycharm [n]: y windows [n]: n diff --git a/cookiecutter.json b/cookiecutter.json index 8addeeada..48cd99f2c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -10,7 +10,7 @@ "use_whitenoise": "y", "use_celery": "n", "use_mailhog": "n", - "use_sentry_for_error_reporting": "y", + "use_sentry": "y", "use_opbeat": "n", "use_pycharm": "n", "windows": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 5a0cffe65..4f548e97d 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -42,7 +42,7 @@ use_mailhog [n] executable for your operating system, see the 'Developing Locally' docs for instructions. -use_sentry_for_error_reporting [n] +use_sentry [n] Whether to use Sentry_ to log errors from your project. use_opbeat [n] diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 924e238dd..30113c2ca 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -102,7 +102,7 @@ To view messages that are sent by your application, open your browser and go to The email server will exit when you exit the Grunt task on the CLI with Ctrl+C. {% endif %} {% endif %} -{% if cookiecutter.use_sentry_for_error_reporting == "y" %} +{% if cookiecutter.use_sentry == "y" %} Sentry ^^^^^^ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index bf031d351..6df3d5c4c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -6,7 +6,7 @@ Production Configurations - Use Amazon's S3 for storing {% if cookiecutter.use_whitenoise == 'n' -%}static files and {% endif %}uploaded media - Use mailgun to send emails - Use Redis for cache -{% if cookiecutter.use_sentry_for_error_reporting == 'y' %} +{% if cookiecutter.use_sentry == 'y' %} - Use sentry for error logging {% endif %} {% if cookiecutter.use_opbeat == 'y' %} @@ -14,7 +14,7 @@ Production Configurations {% endif %} """ -{% if cookiecutter.use_sentry_for_error_reporting == 'y' %} +{% if cookiecutter.use_sentry == 'y' %} import logging {% endif %} @@ -31,7 +31,7 @@ SECRET_KEY = env('DJANGO_SECRET_KEY') # properly on Heroku. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') -{%- if cookiecutter.use_sentry_for_error_reporting == 'y' %} +{%- if cookiecutter.use_sentry == 'y' %} # raven sentry client # See https://docs.sentry.io/clients/python/integrations/django/ INSTALLED_APPS += ['raven.contrib.django.raven_compat', ] @@ -42,7 +42,7 @@ INSTALLED_APPS += ['raven.contrib.django.raven_compat', ] WHITENOISE_MIDDLEWARE = ['whitenoise.middleware.WhiteNoiseMiddleware', ] MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE {% endif %} -{%- if cookiecutter.use_sentry_for_error_reporting == 'y' -%} +{%- if cookiecutter.use_sentry == 'y' -%} RAVEN_MIDDLEWARE = ['raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware'] MIDDLEWARE = RAVEN_MIDDLEWARE + MIDDLEWARE {% endif %} @@ -213,7 +213,7 @@ CACHES = { } } -{% if cookiecutter.use_sentry_for_error_reporting == 'y' %} +{% if cookiecutter.use_sentry == 'y' %} # Sentry Configuration SENTRY_DSN = env('DJANGO_SENTRY_DSN') SENTRY_CLIENT = env('DJANGO_SENTRY_CLIENT', default='raven.contrib.django.raven_compat.DjangoClient') @@ -269,7 +269,7 @@ RAVEN_CONFIG = { 'CELERY_LOGLEVEL': env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO), 'DSN': SENTRY_DSN } -{% elif cookiecutter.use_sentry_for_error_reporting == 'n' %} +{% elif cookiecutter.use_sentry == 'n' %} # LOGGING CONFIGURATION # ------------------------------------------------------------------------------ # See: https://docs.djangoproject.com/en/dev/ref/settings/#logging diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 601d27c64..0ff7053d4 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -23,7 +23,7 @@ from django.core.wsgi import get_wsgi_application app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '') sys.path.append(os.path.join(app_path, '{{ cookiecutter.project_slug }}')) -{% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} +{% if cookiecutter.use_sentry == 'y' -%} if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production': from raven.contrib.django.raven_compat.middleware.wsgi import Sentry {%- endif %} @@ -38,7 +38,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. application = get_wsgi_application() -{% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} +{% if cookiecutter.use_sentry == 'y' -%} if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production': application = Sentry(application) {%- endif %} diff --git a/{{cookiecutter.project_slug}}/env.example b/{{cookiecutter.project_slug}}/env.example index cbde76499..db7b9cb3b 100644 --- a/{{cookiecutter.project_slug}}/env.example +++ b/{{cookiecutter.project_slug}}/env.example @@ -28,7 +28,7 @@ DJANGO_SECURE_SSL_REDIRECT=False # django-allauth DJANGO_ACCOUNT_ALLOW_REGISTRATION=True -{% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} +{% if cookiecutter.use_sentry == 'y' -%} # Sentry DJANGO_SENTRY_DSN= {% endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index b9f09ca75..833952995 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -26,7 +26,7 @@ Collectfast==0.5.2 # ------------------------------------------------------- django-anymail==0.11.1 -{% if cookiecutter.use_sentry_for_error_reporting == "y" -%} +{% if cookiecutter.use_sentry == "y" -%} # Raven is the Sentry client # -------------------------- raven==6.1.0 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py index 72513ed38..e842fadcf 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py @@ -24,7 +24,7 @@ class CeleryConfig(AppConfig): installed_apps = [app_config.name for app_config in apps.get_app_configs()] app.autodiscover_tasks(lambda: installed_apps, force=True) - {% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} + {% if cookiecutter.use_sentry == 'y' -%} if hasattr(settings, 'RAVEN_CONFIG'): # Celery signal registration {% if cookiecutter.use_pycharm == 'y' -%}