Commit abb2506d352be7d86dab46b3f53a54feb24e39c3

Authored by Andrew Buss
1 parent 18095ed465
Exists in master

Wrong SES region

Showing 4 changed files with 13 additions and 4 deletions Side-by-side Diff

flashcards/api.py View file @ abb2506
... ... @@ -55,5 +55,5 @@
55 55 "noreply@flashy.cards",
56 56 [user.email])
57 57  
58   - return Response(User)
  58 + return Response(UserSerializer(User).data)
flashcards/models.py View file @ abb2506
1   -from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
  1 +from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
2 2 from django.contrib.auth.tests.custom_user import CustomUser
3 3 from django.db.models import *
4 4 from simple_email_confirmation import SimpleEmailConfirmationUserMixin
5 5  
6 6  
... ... @@ -24,16 +24,17 @@
24 24 Creates and saves a superuser with the given email and password.
25 25 """
26 26 user = self.create_user(email, password=password)
27   - user.is_admin = True
  27 + user.is_staff = True
28 28 user.save(using=self._db)
29 29 return user
30 30  
31 31  
32   -class User(AbstractBaseUser, SimpleEmailConfirmationUserMixin):
  32 +class User(AbstractBaseUser, SimpleEmailConfirmationUserMixin, ):
33 33 USERNAME_FIELD = 'email'
34 34 REQUIRED_FIELDS = []
35 35  
36 36 objects = UserManager()
  37 + is_staff = BooleanField(default=False)
37 38  
38 39 email = EmailField(
39 40 verbose_name='email address',
flashy/settings.py View file @ abb2506
... ... @@ -108,6 +108,12 @@
108 108 STATIC_ROOT = 'static'
109 109  
110 110 EMAIL_BACKEND = 'django_ses.SESBackend'
  111 +EMAIL_FROM = 'noreply@flashy.cards'
  112 +EMAIL_HOST_USER = 'noreply@flashy.cards'
  113 +DEFAULT_FROM_EMAIL = 'noreply@flashy.cards'
  114 +SERVER_EMAIL = 'noreply@flashy.cards'
111 115  
  116 +AWS_SES_REGION_NAME = 'us-west-2'
  117 +AWS_SES_REGION_ENDPOINT = 'email.us-west-2.amazonaws.com'
112 118 SECRET_KEY = os.environ.get('SECRET_KEY', 'LOL DEFAULT SECRET KEY')
flashy/urls.py View file @ abb2506
... ... @@ -15,4 +15,6 @@
15 15 url(r'^admin/', include(admin.site.urls)),
16 16 url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
17 17 ]
  18 +
  19 +urlpatterns += (url(r'^admin/django-ses/', include('django_ses.urls')),)