Code Monkey home page Code Monkey logo

asynchronous-mail-celery's Introduction

Asynchronous Mail App

Mail App with Django, Django Rest Framework, Celery, Redis and Docker

How Asynchronous Mail App Works?

  • A client can create a custom mail with Mail Form.
  • Each mail contains; to field, subject, body, cc and attachments.
  • Client can also schedule a mail that is set as default. (New features to be add)

Installation

  1. Get the code

    Clone the repository

    git clone https://github.com/vuralmert/asynchronous-mail-celery.git

  2. Install the project dependencies

    Enter the following command

    pip install -r requirements.txt

  3. Run the commands to generate the database

    Enter the following commands

    python manage.py makemigrations
    python manage.py migrate

Usage

Once you have complete dowloading requirements and migrating and none of the services failed after you have run the following command,

python manage.py runserver
  1. Access and Interact with API Front-end App (Django Rest Framework)
  2. The API Front-end application should be running and you can see it via your web browser at http://127.0.0.1:8000/mail_form which will take you to the main web app interface where you can create and send your mails.

    You can check your previous mails and use query parameters to filter, order or search them via your web browser at http://127.0.0.1:8000/send_mail which will take you to the Django Rest Framework interface where you can do these operations.

    For the developers I created a Swagger UI which you can access it via your web browser at http://127.0.0.1:8000/docs which will take you to the page that you can see all of your apis and schemas.

  3. Access Django Admin
    1. Create the admin user
    2. To access the admin interface first you gonna need to generate a super-user with the following command

      python manage.py createsuperuser
      You will be prompted to add a username and password for your user.

    3. Logging to admin interface
    4. Once you have complete creating the super-user you can visit http://127.0.0.1:8000/admin which will take you to the admin interface login screen. You should enter the username and password created in the previous step.

  4. Scheduling Mails with Celery
    1. To use this feature first you need to install Redis from https://redis.io/download/ and then config your Redis files. Once Redis server is installed, open the terminal and run the following command to start the server.

      redis-server
    2. Before running any commands or connecting any clients to the Redis server, you must ensure that Redis is running.

      redis-cli ping
      Returns PONG if the server is up and running.


    3. After making sure that Redis is installed and working properly enter the custom command that I created for ease of use of the codes we will use for Celery and Flower.

      python manage.py run_and_schedule
    4. The API Back-end application and tasks should be running and your scheduled mails will be sent to the active users you have created from the admin interface. You can check running and previous tasks via your web browser at http://127.0.0.6:5555 which will take you to the Flower interface.

Endpoints

  • GET /send_mail
  • POST /send_mail
  • POST /mail_form
  • GET /sent_mails
  • GET /schedule_mail

Used Technologies

  • Python
  • Django
  • Django Rest Framework
  • Celery
  • Redis
  • Flower
  • Docker

asynchronous-mail-celery's People

Contributors

vuralmert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.