Giter Club home page Giter Club logo

puremail's Introduction

Define the project components

Tutorial

 docker-compose run web django-admin.py startproject puremail .
 docker-compose up

Connect the database

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'HOST': 'db',
        'PORT': 5432,
    }
}

Migrations

  • Plug the appConfig in the INSTALLED_APPS
  • Change your models (in models.py).
  • Run python manage.py makemigrations to create migrations for those changes
  • Run python manage.py migrate to apply those changes to the database.

Apply Migrations

docker-compose down
docker-compose run web python manage.py makemigrations
docker-compose run web python manage.py migrate
docker-compose up

See the sql

 docker-compose run web python manage.py sqlmigrate polls 0001

Fixtures

Export

docker-compose run web python manage.py dumpdata --format=json --indent=4 -o students/fixtures/001.json

import

docker-compose run web python manage.py loaddata students/fixtures/001.json

Create admin user

docker-compose stop
docker-compose run web python manage.py createsuperuser
docker-compose start

Email Setup

Sending Email Doc

Gmail Example

Current Email Setup (only for development)

run this on local machine

python3 -m smtpd -n -c DebuggingServer localhost:1025
from django.core.mail import send_mail

send_mail('Subject here', 'Here is the message.', '[email protected]', ['[email protected]'], fail_silently=False)

Settings for email

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'xxxxxxxx'
EMAIL_HOST_PASSWORD = 'xxxxxxxx'
EMAIL_MAIN = '[email protected]'
EMAIL_PORT = 587
EMAIL_USE_TLS = True

or

EMAIL_BACKEND = "sendgrid_backend.SendgridBackend"
SENDGRID_API_KEY = "xxx"
#os.environ["SENDGRID_API_KEY"]

Security

File Encryption

  1. encrypt ID uploads before saving/decrypt when viewing (only if owner or admin) Library 1 Library 2

File Storage

AWS

Going Live

NGINX-django setup

puremail's People

Contributors

an21p 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.