Skip to content

Commit

Permalink
Custom user model in mongoengine example app. Refs omab#70
Browse files Browse the repository at this point in the history
  • Loading branch information
omab authored and Branden Rolston committed Nov 5, 2013
1 parent c78ef57 commit a1d3dd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions examples/django_me_example/example/app/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from django.db import models
from mongoengine.fields import ListField
from mongoengine.django.auth import User

# Create your models here.

class User(User):
"""Extend Mongo Engine User model"""
foo = ListField(default=[])
5 changes: 3 additions & 2 deletions examples/django_me_example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@
)

SESSION_ENGINE = 'mongoengine.django.sessions'
MONGOENGINE_USER_DOCUMENT = 'mongoengine.django.auth.User'
mongoengine.connect('psa', host='mongodb://localhost/psa')
SOCIAL_AUTH_USER_MODEL = 'mongoengine.django.auth.User'
MONGOENGINE_USER_DOCUMENT = 'example.app.models.User'
SOCIAL_AUTH_USER_MODEL = 'example.app.models.User'


AUTHENTICATION_BACKENDS = (
'social.backends.open_id.OpenIdAuth',
Expand Down

0 comments on commit a1d3dd6

Please sign in to comment.