Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get django-registration and django-profile working together

I am in process to setting up a new django project and I want to use the provided apps django-registration and django-profile. I installed both of them with easy-install and managed to get the django-registration working fine. My next step would be to connect the django-profile app to the working branch. The django-registration offers a service, that redirects to a URL, which is defined in the settings.py-variable LOGIN_REDIRECT_URL. My guess was, that I can simply paste a url of the django-profile app to connect both. (e.g. '/profiles/'). My settings.py-variable AUTH_PROFILE_MODULE is set on 'registration.User', (trying to use the django-registration model!). But I get a SiteProfileNotAvailable at /profiles/ No exception supplied error. I tried to follow these steps: https://bitbucket.org/ubernostrum/django-registration/src/tip/docs/index.rst https://bitbucket.org/ubernostrum/django-profiles/src/tip/docs/overview.txt But i am not sure, if I done everything properly, namely this paragraph from overview.txt

For default use, create a profile model for your site and specify the AUTH_PROFILE_MODULE setting appropriately. Then add profiles to your INSTALLED_APPS setting, create the appropriate templates and set up the URLs. For convenience in linking to profiles, your profile model should define a get_absolute_url() method which routes to the view profiles.views.profile_detail, passing the username.

So my questions are:

  • Is that a well known error?
  • Is it the right way to set 'registration.User' as AUTH_PROFILE_MODULE?
  • What is ment by "should define a get_absolute_url() method which routes to the view profiles.views.profile_detail, passing the username." in the overview.txt?
like image 924
Milla Well Avatar asked Oct 17 '11 23:10

Milla Well


1 Answers

django-registration is hard to use thanks to the type of documentation and lack of templates. Many Django developers now use django-social-auth instead:

https://github.com/omab/django-social-auth http://django-social-auth.readthedocs.org/en/latest/index.html

You can see how Kenneth Love integrated it into the Django Packages code base here:

https://github.com/opencomparison/opencomparison/blob/master/apps/profiles/views.py#L83 https://github.com/opencomparison/opencomparison/blob/master/settings.py#L277

like image 132
pydanny Avatar answered Oct 20 '22 20:10

pydanny