Updating docs with mailpit

This commit is contained in:
Vageeshan 2023-08-29 17:35:28 -07:00
parent 0c3bd77917
commit 6eac4ee210
7 changed files with 30 additions and 34 deletions

View File

@ -45,7 +45,7 @@ _These features can be enabled during initial project setup._
- Serve static files from Amazon S3, Google Cloud Storage, Azure Storage or [Whitenoise](https://whitenoise.readthedocs.io/) - Serve static files from Amazon S3, Google Cloud Storage, Azure Storage or [Whitenoise](https://whitenoise.readthedocs.io/)
- Configuration for [Celery](https://docs.celeryq.dev) and [Flower](https://github.com/mher/flower) (the latter in Docker setup only) - Configuration for [Celery](https://docs.celeryq.dev) and [Flower](https://github.com/mher/flower) (the latter in Docker setup only)
- Integration with [MailHog](https://github.com/mailhog/MailHog) for local email testing - Integration with [Mailpit](https://github.com/axllent/mailpit/) for local email testing
- Integration with [Sentry](https://sentry.io/welcome/) for error logging - Integration with [Sentry](https://sentry.io/welcome/) for error logging
## Constraints ## Constraints

View File

@ -191,16 +191,16 @@ The ``container_name`` from the yml file can be used to check on containers with
Notice that the ``container_name`` is generated dynamically using your project slug as a prefix Notice that the ``container_name`` is generated dynamically using your project slug as a prefix
Mailhog Mailpit
~~~~~~~ ~~~~~~~
When developing locally you can go with MailHog_ for email testing provided ``use_mailpit`` was set to ``y`` on setup. To proceed, When developing locally you can go with Mailpit_ for email testing provided ``use_mailpit`` was set to ``y`` on setup. To proceed,
#. make sure ``<project_slug>_local_mailhog`` container is up and running; #. make sure ``<project_slug>_local_mailpit`` container is up and running;
#. open up ``http://127.0.0.1:8025``. #. open up ``http://127.0.0.1:8025``.
.. _Mailhog: https://github.com/mailhog/MailHog/ .. _Mailpit: https://github.com/axllent/mailpit/
.. _`CeleryTasks`: .. _`CeleryTasks`:

View File

@ -99,34 +99,32 @@ First things first.
Setup Email Backend Setup Email Backend
------------------- -------------------
MailHog Mailpit
~~~~~~~ ~~~~~~~
.. note:: In order for the project to support MailHog_ it must have been bootstrapped with ``use_mailpit`` set to ``y``. .. note:: In order for the project to support Mailpit_ it must have been bootstrapped with ``use_mailpit`` set to ``y``.
MailHog is used to receive emails during development, it is written in Go and has no external dependencies. Mailpit is used to receive emails during development, it is written in Go and has no external dependencies.
For instance, one of the packages we depend upon, ``django-allauth`` sends verification emails to new users signing up as well as to the existing ones who have not yet verified themselves. For instance, one of the packages we depend upon, ``django-allauth`` sends verification emails to new users signing up as well as to the existing ones who have not yet verified themselves.
#. `Download the latest MailHog release`_ for your OS. #. `Download the latest Mailpit release`_ for your OS.
#. Rename the build to ``MailHog``. #. Copy the binary file to the project root.
#. Copy the file to the project root.
#. Make it executable: :: #. Make it executable: ::
$ chmod +x MailHog $ chmod +x mailpit
#. Spin up another terminal window and start it there: :: #. Spin up another terminal window and start it there: ::
./MailHog ./mailpit
#. Check out `<http://127.0.0.1:8025/>`_ to see how it goes. #. Check out `<http://127.0.0.1:8025/>`_ to see how it goes.
Now you have your own mail server running locally, ready to receive whatever you send it. Now you have your own mail server running locally, ready to receive whatever you send it.
.. _`Download the latest MailHog release`: https://github.com/mailhog/MailHog .. _`Download the latest Mailpit release`: https://github.com/axllent/mailpit
Console Console
~~~~~~~ ~~~~~~~

View File

@ -116,7 +116,7 @@ use_celery:
Indicates whether the project should be configured to use Celery_. Indicates whether the project should be configured to use Celery_.
use_mailpit: use_mailpit:
Indicates whether the project should be configured to use MailHog_. Indicates whether the project should be configured to use Mailpit_.
use_sentry: use_sentry:
Indicates whether the project should be configured to use Sentry_. Indicates whether the project should be configured to use Sentry_.
@ -185,7 +185,7 @@ debug:
.. _Celery: https://github.com/celery/celery .. _Celery: https://github.com/celery/celery
.. _MailHog: https://github.com/mailhog/MailHog .. _Mailpit: https://github.com/axllent/mailpit
.. _Sentry: https://github.com/getsentry/sentry .. _Sentry: https://github.com/getsentry/sentry

View File

@ -330,7 +330,7 @@ dump.rdb
### Project template ### Project template
{%- if cookiecutter.use_mailpit == 'y' and cookiecutter.use_docker == 'n' %} {%- if cookiecutter.use_mailpit == 'y' and cookiecutter.use_docker == 'n' %}
MailHog mailpit
{%- endif %} {%- endif %}
{{ cookiecutter.project_slug }}/media/ {{ cookiecutter.project_slug }}/media/

View File

@ -84,31 +84,29 @@ celery -A config.celery_app worker -B -l info
{%- if cookiecutter.use_docker == "y" %} {%- 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](https://github.com/mailhog/MailHog) with a web interface is available as docker container. 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 [Mailpit](https://github.com/axllent/mailpit) with a web interface is available as docker container.
Container mailhog will start automatically when you will run all docker containers. Container mailpit will start automatically when you will run all docker containers.
Please check [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html) for more details how to start all containers. Please check [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html) 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` With Mailpit running, to view messages that are sent by your application, open your browser and go to `http://127.0.0.1:8025`
{%- else %} {%- 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](https://github.com/mailhog/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 [Mailpit](https://github.com/axllent/mailpit) when generating the project a local SMTP server with a web interface will be available.
1. [Download the latest MailHog release](https://github.com/mailhog/MailHog/releases) for your OS. 1. [Download the latest Mailpit release](https://github.com/axllent/mailpit/releases) for your OS.
2. Rename the build to `MailHog`. 2. Copy the binary file to the project root.
3. Copy the file to the project root. 3. Make it executable:
4. Make it executable: $ chmod +x mailpit
$ chmod +x MailHog 4. Spin up another terminal window and start it there:
5. Spin up another terminal window and start it there: ./mailpit
./MailHog 5. Check out <http://127.0.0.1:8025/> to see how it goes.
6. Check out <http://127.0.0.1:8025/> to see how it goes.
Now you have your own mail server running locally, ready to receive whatever you send it. Now you have your own mail server running locally, ready to receive whatever you send it.

View File

@ -17,7 +17,7 @@ services:
- redis - redis
{%- endif %} {%- endif %}
{%- if cookiecutter.use_mailpit == 'y' %} {%- if cookiecutter.use_mailpit == 'y' %}
- mailhog - mailpit
{%- endif %} {%- endif %}
volumes: volumes:
- .:/app:z - .:/app:z
@ -78,7 +78,7 @@ services:
- redis - redis
- postgres - postgres
{%- if cookiecutter.use_mailpit == 'y' %} {%- if cookiecutter.use_mailpit == 'y' %}
- mailhog - mailpit
{%- endif %} {%- endif %}
ports: [] ports: []
command: /start-celeryworker command: /start-celeryworker
@ -91,7 +91,7 @@ services:
- redis - redis
- postgres - postgres
{%- if cookiecutter.use_mailpit == 'y' %} {%- if cookiecutter.use_mailpit == 'y' %}
- mailhog - mailpit
{%- endif %} {%- endif %}
ports: [] ports: []
command: /start-celerybeat command: /start-celerybeat