From 6eac4ee2100c9067031af8b7b54211dde2940211 Mon Sep 17 00:00:00 2001 From: Vageeshan Date: Tue, 29 Aug 2023 17:35:28 -0700 Subject: [PATCH] Updating docs with mailpit --- README.md | 2 +- docs/developing-locally-docker.rst | 8 ++++---- docs/developing-locally.rst | 18 ++++++++---------- docs/project-generation-options.rst | 4 ++-- {{cookiecutter.project_slug}}/.gitignore | 2 +- {{cookiecutter.project_slug}}/README.md | 24 +++++++++++------------- {{cookiecutter.project_slug}}/local.yml | 6 +++--- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 6414b4f4c..c9d3d3489 100644 --- a/README.md +++ b/README.md @@ -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/) - 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 ## Constraints diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 9d00b53ca..a8f945adf 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -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 -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 ``_local_mailhog`` container is up and running; +#. make sure ``_local_mailpit`` container is up and running; #. open up ``http://127.0.0.1:8025``. -.. _Mailhog: https://github.com/mailhog/MailHog/ +.. _Mailpit: https://github.com/axllent/mailpit/ .. _`CeleryTasks`: diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 60d0e5506..92379f4fd 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -99,34 +99,32 @@ First things first. 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. -#. `Download the latest MailHog release`_ for your OS. +#. `Download the latest Mailpit release`_ for your OS. -#. Rename the build to ``MailHog``. - -#. Copy the file to the project root. +#. Copy the binary file to the project root. #. Make it executable: :: - $ chmod +x MailHog + $ chmod +x mailpit #. Spin up another terminal window and start it there: :: - ./MailHog + ./mailpit #. Check out ``_ to see how it goes. 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 ~~~~~~~ diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 4984d4abc..967b42426 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -116,7 +116,7 @@ use_celery: Indicates whether the project should be configured to use Celery_. use_mailpit: - Indicates whether the project should be configured to use MailHog_. + Indicates whether the project should be configured to use Mailpit_. use_sentry: Indicates whether the project should be configured to use Sentry_. @@ -185,7 +185,7 @@ debug: .. _Celery: https://github.com/celery/celery -.. _MailHog: https://github.com/mailhog/MailHog +.. _Mailpit: https://github.com/axllent/mailpit .. _Sentry: https://github.com/getsentry/sentry diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index da0b4a1cf..0bb322186 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -330,7 +330,7 @@ dump.rdb ### Project template {%- if cookiecutter.use_mailpit == 'y' and cookiecutter.use_docker == 'n' %} -MailHog +mailpit {%- endif %} {{ cookiecutter.project_slug }}/media/ diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index d22fb851a..ccf245a2f 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -84,31 +84,29 @@ celery -A config.celery_app worker -B -l info {%- 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. -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 %} -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 - -6. Check out to see how it goes. +5. Check out to see how it goes. Now you have your own mail server running locally, ready to receive whatever you send it. diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 9dbf7295b..692d87499 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -17,7 +17,7 @@ services: - redis {%- endif %} {%- if cookiecutter.use_mailpit == 'y' %} - - mailhog + - mailpit {%- endif %} volumes: - .:/app:z @@ -78,7 +78,7 @@ services: - redis - postgres {%- if cookiecutter.use_mailpit == 'y' %} - - mailhog + - mailpit {%- endif %} ports: [] command: /start-celeryworker @@ -91,7 +91,7 @@ services: - redis - postgres {%- if cookiecutter.use_mailpit == 'y' %} - - mailhog + - mailpit {%- endif %} ports: [] command: /start-celerybeat