This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# users/admin.py | |
from django.contrib import admin | |
from django.contrib.auth import get_user_model | |
from django.contrib.auth.admin import UserAdmin | |
from .forms import CustomUserCreationForm, CustomUserChangeForm | |
from .models import CustomUser | |
class CustomUserAdmin(UserAdmin): | |
add_form = CustomUserCreationForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 as build-system | |
RUN pip install -U pip | |
COPY requirements.txt requirements.txt | |
### create temporary image used to download and vendor packages using private key ### | |
FROM build-system as intermediate | |
# add credentials on build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import EmailMessage class - https://docs.djangoproject.com/en/1.9/topics/email/#django.core.mail.EmailMessage | |
from django.core.mail import EmailMessage | |
email = EmailMessage('... Subject ...', '... Body ...', 'from-email', | |
['to-email-1', 'to-email-2'], ['bcc-email-1', 'bcc-email-2']) | |
# now let's create a csv file dynamically | |
import csv, StringIO | |
attachment_csv_file = StringIO.StringIO() | |
writer = csv.writer(attachment_csv_file) |