django-allauth

Python - Multiple type users with custom user model in django-allauth

試著忘記壹切 提交于 2019-12-12 06:46:05
问题 I'm working on a project using PythoN(3.7) & Django(2.2) in which I have to create 4 different types of users with different fields but they will share some common fields like title & name etc. But I also need to use email as the username and need to provide different signup form but one login form. I'm currently using django-allauth to implement my user management and setup the email as the username. Here's what I did: From models.py : class CustomUser(AbstractUser): # add common fields in

Django allauth: empty 'signup_url'

安稳与你 提交于 2019-12-12 03:55:53
问题 Using django 1.8.16 and package django-allauth==0.27.0 Login works fine, but signup page cannot be reached from login page. The default login template 'login.html' contains a link to a signup page: <p>{% blocktrans %}If you have not created an account yet, then please <a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p> But since the value of 'signup_url' is empty, this points nowhere. Question is: where should 'signup_url' get its value from? django-allauth documentation

Email confirm error rest-auth

两盒软妹~` 提交于 2019-12-12 03:13:25
问题 I use a standard form for the confirmation email: from allauth.account.views import confirm_email as allauthemailconfirmation urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^rest-auth/', include('rest_auth.urls')), url(r'^accounts/', include('allauth.urls')), url(r'^rest-auth/registration/account-confirm-email/(?P<key>\w+)/$', allauthemailconfirmation, name="account_confirm_email"), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), ] Settings: LOGIN_REDIRECT

Facebook connect button not showing up with django-allauth

筅森魡賤 提交于 2019-12-11 15:09:57
问题 Using this template <!DOCTYPE html> <html> <head> {% load socialaccount %} <title></title> </head> <body> {% providers_media_js %} </body> </html> This html is generated <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div id="fb-root"></div> <script type="text/javascript" src="/static/facebook/js/fbconnect.js"></script> <script type="text/javascript"> allauth.facebook.init({ appId: '133560690071122', locale: 'en_US', loginOptions: {"scope": ""}, loginByTokenUrl: '/accounts

Templates in Allauth registration for Django

心不动则不痛 提交于 2019-12-11 11:48:24
问题 ¿How can i edit/fix the Allauth templates for login pages into Django 1.8? I been reading about guides around and i don't find anything who resolves that. This is my settings.py """ Django settings for colectr project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths

Django allauth session JSON serializable error after login

梦想与她 提交于 2019-12-11 07:51:31
问题 I have installed django-allauth, after that this is my settings.py Django_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) Third_party_apps = ( 'avatar', 'allauth', 'allauth.account', 'allauth.socialaccount', 'bootstrapform', 'allauth.socialaccount.providers

django-The page isn’t redirecting properly

被刻印的时光 ゝ 提交于 2019-12-11 07:01:50
问题 I have a middleware that check user profile. If auth user doesn't have a profile, then redirect to user profile. My browser displays the error The page isn’t redirecting properly . class Check(MiddlewareMixin): def process_request(self, request): if request.user.is_authenticated(): user = request.user try: profile = Profile.objects.get(user_id = user) if profile: pass except ObjectDoesNotExist: return HttpResponseRedirect('/accounts/profile/') I'm use django-allauth . 回答1: It sounds like you

Django All-Auth Facebook Integration

情到浓时终转凉″ 提交于 2019-12-11 06:10:28
问题 I am having problems setting up the Facebook social integration for Django All-Auth. I have successfully setup the Google login, so I am at a loss as to why one works and the other doesn't. I think it might be due to my Facebook configuration in settings.py, as Facebook has many possible options. Events Summary: Click Login by Facebook Button on my website Browser redirects to Facebook website for login, and facebook requests password. Facebook accepts the password Browser redirects back to

Passing Parameters to An Overrode View in Django/Allauth

放肆的年华 提交于 2019-12-11 03:54:05
问题 With Django 1.4 and Allauth, I'm trying to have 2 different signup pages. When I say different, I mean 2 different URLs and 'html layouts'. Here's what I did so far. It 'works', but it doesn't pass the 'is_alternate_template' variable to the HTML template: In urls.py: url(r'^accounts/', include('allauth.urls')), url(r'^abc/alternate-signup/?$','project.views.alternate_signup'), in views.py: def alternate_signup(request): from allauth.account import views as account_views is_alternate_template

How to use a signup form outside of the /accounts/ url pattern with Django-AllAuth?

醉酒当歌 提交于 2019-12-11 03:19:43
问题 I'm currently using django-allauth to manage my registrations and logins. Until now, all of my logins and signups have worked by having the django-allauth pages at the /accounts/ prefix for url patterns, so to register a new account you would navigate to /accounts/signup/ . I want to keep this functionality, but also want to introduce a signup form onto my landing page (at my base url), and I want to have a quick login form in my top banner from anywhere in my website (not /accounts/ ). My