stormpath / stormpath-django

Django plugin for Stormpath
Apache License 2.0
38 stars 19 forks source link

Add instructions for integrating with models.py #16

Closed kevgathuku closed 9 years ago

kevgathuku commented 9 years ago

One minor problem I faced when trying to implement this is there were no instructions on replacing the default django auth with stormpath in models.py. For example, how to convert a model like:

from django.contrib.auth.models import User author = models.ForeignKey(User)

to use the Stormpath User model

denibertovic commented 9 years ago

@kevgathuku this is the standard django way (from version 1.5) for replacing the default user model with a custom one (regardless of stormpath). And that is using the AUTH_USER_MODEL setting (we mention it in the README). Also, you might find the example project useful: https://github.com/stormpath/stormpath-django-sample

But yes, I agree with you that we need more comprehensive docs!

denibertovic commented 9 years ago

@kevgathuku For the time being I've added some basic info here: https://github.com/denibertovic/stormpath-django/commit/8f9b294ebcb97e07a12c5ba97e204c4a5236619b so that others don't hit the same issue.

kevgathuku commented 9 years ago

@denibertovic Looks good. Will surely benefit others who might face the same issue in future.

rdegges commented 9 years ago

Closing this out as we have this in docs =)