0

I need to share user credentials across multiple django apps. Each app is completely different and serves different purposes, but I want a user to only have to register once in order to use any of the apps.

I have managed to set this up by defining multiple schemas in my Postgres db. As far as I could find on the web schemas are not supported in Django explicitly but I did get it to work (mostly) by just defining a different search path for each app (each app uses its own username to connect to Postgres).

I have the following schemas (as an example):

- auth
- app1    
- app2
- app3
- common

So an app's user's search path might look something like this:

app1, common, auth

Everything seems to work fine, except the registration functionality provided by django-registration. When I try to register a new user it creates a new row in the auth_user table as well as the registration_registrationprofile tables (both reside in the auth schema). The activation email is also sent, but when I click on the activation link I get a message that "Account activation failed". No other info.

Has anyone else seen this and maybe have a solution to get activation working in a setup like this?

Ries
  • 2,844
  • 4
  • 32
  • 45
  • See https://bitbucket.org/ubernostrum/django-registration, a reusable registration app – Pramod Nov 09 '12 at 11:47
  • Isn't this exactly the module available via http://pypi.python.org/pypi/django-registration? I am using this already. – Ries Nov 09 '12 at 13:26
  • Yes it is. I think you can let django create the database schema for you using syncdb instead of manually creating it. That could be the issue. – Pramod Nov 09 '12 at 15:45
  • I don't think you understand my problem... – Ries Nov 10 '12 at 11:09

1 Answers1

0

Ah, the reason why the activation failed had nothing to do with the registration module. My template for the activation email contained an activation url for the production site and I was testing on a staging site. (blush)

Ries
  • 2,844
  • 4
  • 32
  • 45