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

Already on GitHub? Sign in to your account

Django 1.5 custom user model not supported #592

Closed
dtougas opened this Issue Mar 7, 2013 · 8 comments

Comments

Projects
None yet
4 participants

dtougas commented Mar 7, 2013

I am running Django 1.5, Mezzanine 1.4.3, and I am using a custom user model defined in my settings.py. The South migration core:0004_set_site_permissions fails in this situation because it requires the auth.User model.

Owner

stephenmcd commented Mar 7, 2013

Thanks Damien. I suspected this would be an issue and at this point I'm not sure what the solution will be.

Meanwhile you can certainly make use of the approach with Profile models, which Mezzanine is actually built around.

dtougas commented Mar 7, 2013

I thought about taking that approach, but since this is a new site in early development and the Profile model is now deprecated, that I might try the new "blessed" way. Perhaps this is too bleeding edge :-)

Owner

stephenmcd commented Mar 7, 2013

At this stage I can at least say that by using a profile model, there will be an upgrade path with Mezzanine, since Mezzanine's accounts app has made heavy use of it for quite some time, with production sites in place using that feature.

I can't say for certain what that will look like, but one path that may pan out would be:

  • We can't support custom user models due to a fundamental incompatibility with South.
  • Profile models are removed from Django 1.6, which we'll need to support.

If that turns out to be the case, we may end up implementing our own way of using a Profile style model, which could just involve removing references to user.get_profile and providing our own way of doing that.

dtougas commented Mar 7, 2013

Thanks Stephen. I guess for now I will stick with the Profile model then, so that I can take full advantage of Mezzanine's accounts app.

Contributor

jfw commented Apr 20, 2013

Is it just this one migration that's broken? If this were fixed, would Mezzanine work with a custom user model, or is there something else preventing that?

dtougas commented Apr 22, 2013

I don't know for sure. Most likely the accounts app wouldn't work right though, as it depends on a profile class.

Contributor

rockymeza commented May 3, 2013

Maybe there can be a management command that does this instead of a migration? If I am reading it correctly, this migration does the following:

  1. Collects all the Site objects
  2. Adds those sites to the SitePermissions of each user.

In my use case, I'm adding Mezzanine to a project that already exists and has a custom user model. I don't have my Site objects set up yet anyway, so this migration is likely only going to reflect the Site objects that existed at the time of migration, not the Site objects that will exist when I'm done. Same goes for the users.

Owner

stephenmcd commented May 8, 2013

Fixed in a9ea147

@stephenmcd stephenmcd closed this May 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment