Skip to content
Snippets Groups Projects
Commit a3366c22 authored by Bodor Máté's avatar Bodor Máté
Browse files

Add email settings

parent 80b14b30
No related branches found
No related tags found
No related merge requests found
from django.core import exceptions
from django.core.mail import send_mail
from common.email import registration_email
from . import models
def create_profile(backend, user, response, *args, **kwargs):
if backend.name == 'authsch':
if user.email is not None:
registration_email(user.email)
try:
user.profile
except exceptions.ObjectDoesNotExist:
models.Profile.objects.create(user=user)
if user.email is not None:
send_mail('TESZT', 'Udvozlunk a kszkepzesen, ne felejtsd el kitolteni a profilod.',
'noreply@devteam.sch.bme.hu', [user.email, ])
from django.core.mail import send_mail
def registration_email(email):
send_mail('TESZT', 'Udvozlunk a kszkepzesen, ne felejtsd el kitolteni a profilod.',
'noreply@devteam.sch.bme.hu', [email, ])
\ No newline at end of file
......@@ -38,7 +38,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',
'import_export',
'import_export',
'rest_framework',
'social_django',
'solo',
......@@ -158,10 +158,3 @@ STATIC_URL = '/django-static/'
MEDIA_ROOT = os.getenv('MEDIA_ROOT', '/tmp')
MEDIA_URL = '/media/'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'bmate711kamu@gmail.com'
EMAIL_HOST_PASSWORD = '1IronxDog'
from .base import *
SESSION_COOKIE_SECURE=False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'bmate711kamu@gmail.com'
EMAIL_HOST_PASSWORD = '1IronxDog'
......@@ -26,3 +26,9 @@ REST_FRAMEWORK = {
}
STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected')
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mail.sch.bme.hu'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment