Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.5 Compatibility for Configurable User #18

Open
trent opened this issue Jan 30, 2013 · 5 comments
Open

Django 1.5 Compatibility for Configurable User #18

trent opened this issue Jan 30, 2013 · 5 comments

Comments

@trent
Copy link

trent commented Jan 30, 2013

In Django 1.5, you can create a custom user model (https://docs.djangoproject.com/en/1.5//topics/auth/customizing/#substituting-a-custom-user-model) for the Auth contrib application. To reference this user in other apps, there is a new setting AUTH_USER_MODEL that should be used on any relationship fields. django-follow does not currently use this setting in the local follow.Follow model, you actually reference the django.contrib.auth.models.User object directly. This raises an error "...'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL." when running syncdb.

@flashingpumpkin
Copy link
Contributor

Happy to accept pull requests. I'm a bit busy to add this myself right now and we've not got any Django 1.5 apps out there using django-follow.

@trent
Copy link
Author

trent commented Jan 30, 2013

I'm working on a Django 1.5 app right now and happy to develop a patch. How to you typically support existing installs? Do you provide migrations, or just put that on the user to handle?

@flashingpumpkin
Copy link
Contributor

I can include migrations into the code base - but that would only be for django-follow. I wouldn't want to mess with users' databases. :)

@trent
Copy link
Author

trent commented Jan 31, 2013

of course. i've actually decided to hold off on django 1.5 for my new project. it seems many pluggable apps have not made considerations for configurable models and i have a lot of open tickets similar to this one elsewhere. perhaps accommodating existing apps with ways to upgrade for this functionality is what is holding up the 1.5 release? not sure, but i won't be putting any time against patching this ticket until the release is official.

@rchrd2
Copy link

rchrd2 commented Jun 19, 2013

Hello, I wanted to try this out in my Django 1.5 project so forked it and made these changes. Maybe I'm missing something, but the changes were really minimal. You can see the changeset here rchrd2@7a56535

I have only tested with Django 1.5, but it worked for me. I can put a pull request if someone were to test this and confirm it works with older versions of Django.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants