resolved merge conflicts

This commit is contained in:
Jannis Gebauer 2016-05-22 20:18:08 +02:00
commit 24d75ebe45
6 changed files with 44 additions and 7 deletions

View File

@ -41,7 +41,14 @@ You can now run the usual Django ``migrate`` and ``runserver`` commands::
django-allauth sends an email to verify users (and superusers) after signup and login (if they are still not verified). To send email you need to `configure your email backend`_ django-allauth sends an email to verify users (and superusers) after signup and login (if they are still not verified). To send email you need to `configure your email backend`_
.. _configure your email backend: http://docs.djangoproject.com/en/1.9/topics/email/#smtp-backend .. _configure your email backend: http://docs.djangoproject.com/en/1.9/topics/email/#smtp-backend
{% if cookiecutter.use_docker == 'y' %}
In development you can (optionally) use MailHog_ for email testing. MailHog is added as docker-container. To use MailHog::
1. Make sure, that ``mailhog`` docker container is up and running
2. Open your browser and go to ``http://127.0.0.1:8025``
.. _Mailhog: https://github.com/mailhog/MailHog/
{% else %}
In development you can (optionally) use MailHog_ for email testing. MailHog is built with Go so there are no dependencies. To use MailHog:: In development you can (optionally) use MailHog_ for email testing. MailHog is built with Go so there are no dependencies. To use MailHog::
1. `Download the latest release`_ for your operating system 1. `Download the latest release`_ for your operating system
@ -52,7 +59,7 @@ In development you can (optionally) use MailHog_ for email testing. MailHog is b
.. _Mailhog: https://github.com/mailhog/MailHog/ .. _Mailhog: https://github.com/mailhog/MailHog/
.. _Download the latest release: https://github.com/mailhog/MailHog/releases .. _Download the latest release: https://github.com/mailhog/MailHog/releases
{% endif %}
Alternatively simply output emails to the console via: ``EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'`` Alternatively simply output emails to the console via: ``EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'``
In production basic email configuration is setup to send emails with Mailgun_ In production basic email configuration is setup to send emails with Mailgun_

View File

@ -68,5 +68,12 @@ node_modules/
# User-uploaded media # User-uploaded media
{{ cookiecutter.project_slug }}/media/ {{ cookiecutter.project_slug }}/media/
=======
{{ cookiecutter.repo_name }}/media/
# Hitch directory
tests/.hitch
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n'%}
# MailHog binary # MailHog binary
mailhog mailhog
{% endif %}

View File

@ -112,14 +112,14 @@ module.exports = function (grunt) {
runDjango: { runDjango: {
cmd: 'python <%= paths.manageScript %> runserver' cmd: 'python <%= paths.manageScript %> runserver'
}, },
{% if cookiecutter.use_mailhog == "y" -%}runMailHog: { {% if cookiecutter.use_mailhog == "y" and cookiecutter.use_docker == 'n' -%}runMailHog: {
cmd: './mailhog' cmd: './mailhog'
},{%- endif %} },{%- endif %}
} }
}); });
grunt.registerTask('serve', [ grunt.registerTask('serve', [
{% if cookiecutter.use_mailhog == "y" -%} {% if cookiecutter.use_mailhog == "y" and cookiecutter.use_docker == 'n' -%}
'bgShell:runMailHog', 'bgShell:runMailHog',
{%- endif %} {%- endif %}
'bgShell:runDjango', 'bgShell:runDjango',

View File

@ -77,7 +77,16 @@ Please note: For Celery's import magic to work, it is important *where* the cele
Email Server Email Server
^^^^^^^^^^^^ ^^^^^^^^^^^^
{% if cookiecutter.use_docker == 'y' %}
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server `MailHog`_ with a web interface is available as docker container.
.. _mailhog: https://github.com/mailhog/MailHog
Container mailhog will start automatically when you will run all docker containers.
Please check `cookiecutter-django Docker documentation`_ for more details how to start all containers.
With MailHog running, to view messages that are sent by your application, open your browser and go to ``http://127.0.0.1:8025``
{% else %}
In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use `MailHog`_ when generating the project a local SMTP server with a web interface will be available. In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use `MailHog`_ when generating the project a local SMTP server with a web interface will be available.
.. _mailhog: https://github.com/mailhog/MailHog .. _mailhog: https://github.com/mailhog/MailHog
@ -92,7 +101,7 @@ To start the service, make sure you have nodejs installed, and then type the fol
To view messages that are sent by your application, open your browser and go to ``http://127.0.0.1:8025`` To view messages that are sent by your application, open your browser and go to ``http://127.0.0.1:8025``
The email server will exit when you exit the Grunt task on the CLI with Ctrl+C. The email server will exit when you exit the Grunt task on the CLI with Ctrl+C.
{% endif %}
{% endif %} {% endif %}
{% if cookiecutter.use_sentry == "y" %} {% if cookiecutter.use_sentry == "y" %}

View File

@ -23,12 +23,15 @@ SECRET_KEY = env('DJANGO_SECRET_KEY', default='CHANGEME!!!')
# Mail settings # Mail settings
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025 EMAIL_PORT = 1025
{%if cookiecutter.use_mailhog == 'n' -%} {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %}
EMAIL_HOST = env("EMAIL_HOST", default='mailhog')
{% else %}
EMAIL_HOST = 'localhost'
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend') default='django.core.mail.backends.console.EmailBackend')
{%- endif %} {% endif %}
# CACHING # CACHING
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -28,6 +28,10 @@ services:
- "8000:8000" - "8000:8000"
links: links:
- postgres - postgres
{% if cookiecutter.use_mailhog == 'y' %}
- mailhog
{% endif %}
{% if cookiecutter.use_pycharm == 'y' %} {% if cookiecutter.use_pycharm == 'y' %}
pycharm: pycharm:
build: build:
@ -42,3 +46,10 @@ services:
links: links:
- postgres - postgres
{% endif %} {% endif %}
{% if cookiecutter.use_mailhog == 'y' %}
mailhog:
image: mailhog/mailhog
ports:
- "8025:8025"
{% endif %}