Get django-registration and django-profile working together

I am going to create a new django project and I want to use the provided django-registration and django-profile applications. I installed both of them with a simple installation and managed to work fine with django-registration. The next step is to connect the django-profile application to the work branch. Django-registration offers a service that redirects the URL that is defined in the settings.py LOGIN_REDIRECT_URL parameters. I assumed that I could just insert the django-profile application url to connect both. (e.g. '/ profiles /'). My settings.py-variable AUTH_PROFILE_MODULE is set to 'registration.User' (trying to use the django registration model!). But I get SiteProfileNotAvailable at / profiles / Throw exception 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'm not sure if I did everything right, namely this paragraph from overview.txt

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

So my questions are:

  • Is this a known bug?
  • Is it right to set 'registration.User' as AUTH_PROFILE_MODULE?
  • What is "value", you should define the get_absolute_url() method, which routes to the profiles.views.profile_detail view, passing the username. "in the overview.txt file?
+6
source share
1 answer

django-registration is difficult to use due to the type of documentation and the 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

+3
source

Source: https://habr.com/ru/post/899499/


All Articles