This commit is contained in:
Daniel Roy Greenfeld 2015-11-17 16:58:40 -08:00
commit aad3284f58
8 changed files with 66 additions and 8 deletions

View File

@ -6,6 +6,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- initial configuration to support opbeat (@burhan)
## [2015-11-16]
### Changed
- Cleanup of main README (@burhan)
## [2015-11-15]
### Added
- Added `UserFactory` for users.User tests (@ad-m)
## [2015-11-12]
### Changed
- Update version of django-allauth (@yunti)

View File

@ -32,14 +32,21 @@ Features
* Grunt build for compass and livereload
* Basic e-mail configurations for sending emails via Mailgun_
* Media storage using Amazon S3
* Serve static files from Amazon S3 or Whitenoise_ (optional)
* Pre configured Celery_ (optional)
* Integration with Maildump_ for local email testing (optional)
* Integration with Sentry_ for error logging (optional)
* Integration with NewRelic_ for performance monitoring (optional)
* Docker support using docker-compose_ for dev and prod
* Docker support using docker-compose_ for development and production
* Procfile_ for deploying to Heroku
Optional Integrations
---------------------
*These features can be enabled during initial project setup.*
* Serve static files from Amazon S3 or Whitenoise_
* Configuration for Celery_
* Integration with Maildump_ for local email testing
* Integration with Sentry_ for error logging
* Integration with NewRelic_ for performance monitoring
* Integration with Opbeat_ for performance monitoring
.. _alpha: http://blog.getbootstrap.com/2015/08/19/bootstrap-4-alpha/
.. _Hitch: https://github.com/hitchtest/hitchtest
.. _Bootstrap: https://github.com/twbs/bootstrap
@ -56,6 +63,7 @@ Features
.. _Sentry: https://getsentry.com
.. _NewRelic: https://newrelic.com
.. _docker-compose: https://www.github.com/docker/compose
.. _Opbeat: https://opbeat.com/
Constraints
@ -110,6 +118,7 @@ It prompts you for questions. Answer them::
use_maildump [n]: n
use_sentry [n]: y
use_newrelic [n]: y
use_obpeat [n]: y
windows [n]: n
use_python2 [n]: y

View File

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

View File

@ -24,7 +24,7 @@ DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a
DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "your_project_name <noreply@your_domain_name>"
DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "your_project_name <noreply@your_domain_name>"
DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[your_project_name] "
DJANGO_ALLOWED_HOSTS ALLOWED_HOSTS ['*'] ['your_project_name}']
DJANGO_ALLOWED_HOSTS ALLOWED_HOSTS ['*'] ['your_domain_name']
======================================= =========================== ============================================== ======================================================================
The following table lists settings and their defaults for third-party applications, which may or may be part of your project:
@ -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_SERVER_NAME MAILGUN_SERVER_NAME 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" %}
- Use sentry for error logging
{% endif %}
{% if cookiecutter.use_opbeat == "y" %}
- Use opbeat for error reporting
{% endif %}
'''
from __future__ import absolute_import, unicode_literals
@ -52,7 +55,19 @@ MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + \
MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + MIDDLEWARE_CLASSES
{%- 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',
) + MIDDLEWARE_CLASSES
{%- endif %}
# set this to 60 seconds and then to 518400 when you can prove it works
SECURE_HSTS_SECONDS = 60
SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool(

View File

@ -18,3 +18,8 @@ DJANGO_SENTRY_DSN=
{% if cookiecutter.use_newrelic == 'y' -%}
NEW_RELIC_LICENSE_KEY
{% endif %}
{% if cookiecutter.use_opbeat == 'y' -%}
DJANGO_OPBEAT_ORGANIZATION_ID
DJANGO_OPBEAT_APP_ID
DJANGO_OPBEAT_SECRET_TOKEN
{% endif %}

View File

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

View File

@ -0,0 +1,11 @@
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PostGenerationMethodCall('set_password', 'password')
class Meta:
model = 'users.User'
django_get_or_create = ('username', )