django-registration

django-registration (1048, “Column 'last_login' cannot be null”)

本秂侑毒 提交于 2019-12-09 18:10:41
问题 I'm trying to use django-registration in my simple project. settings.py # DJANGO REGISTRATION ACCOUNT_ACTIVATION_DAYS = 7 AUTH_USER_EMAIL_UNIQUE = True EMAIL_HOST = 'localhost' EMAIL_PORT = 1025 EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' EMAIL_USE_TLS = False DEFAULT_FROM_EMAIL = 'example@gmail.com' urls.py url(r'^accounts/', include('registration.backends.hmac.urls')), Registration template: {% extends "index.html" %} {% block content %} <h1>Registration</h1> <form method="post" action=""

{% url %} gives me NoReverseMatch error while reverse() returns the url just fine. Why?

你离开我真会死。 提交于 2019-12-09 04:46:40
问题 I don't know if this SO question is of the same problem that I am about to describe, but it does share the same symptoms. Unfortunately, it still remains unresolved as I am writing. So here is my problem. I am trying to add James Bennett's django-registration app to my django project. I have pretty much finished configuring it to my needs - custom templates and urls. Just when I thought everything was good to go. I got NoReverseMatch error from using {% url 'testing' item_id=123 %} (I also

Passing context to django-registration's views

半城伤御伤魂 提交于 2019-12-08 11:37:16
问题 I'm utilizing django-registration with a set of premade templates I found on Github for doing a two-step (registration-activation) workflow using HMAC. I want to pass global variables (defined in context-processors) like my website's name to the emails sent by django-registration. the activation email sent to a new registrant, for example, or the password change one. The "problem" is I don't directly have access to those views. That's kinda the point of django-registration, you include its

Connecting a django-registration signal

巧了我就是萌 提交于 2019-12-06 08:06:32
问题 I have a function: def create(sender, **kw): [...] Which should be called when the user_activated signal from django-registration is called. I connect the signal and the function using this: from registration.signals import user_activated [...] post_save.connect(create, sender=user_activated, dispatch_uid="users-atactivation-signal") But the function isn't called when a user clicks on the activation link, which he got by email. What do I miss here. 回答1: A function like this: def create(sender

Extending the user model with Django-Registration

烂漫一生 提交于 2019-12-06 03:08:19
Django version: 4.0.2 Django-Registration version: 0.8 App name: userAccounts PROBLEM: Im trying to create a user type called professor extending the user model. I can complete the registration process, the problem is that only the user is saved on the DB, the professor table keep empty. So i think the problem could be in the save method. Some clue about what could be the problem? SETTINGS.PY AUTH_PROFILE_MODULE = "userAccounts.Professor" MODELS.PY - Here i create the model that extending from user and a example field from django.db import models from django.contrib.auth.models import User

Django-registration setup without password

旧巷老猫 提交于 2019-12-05 04:19:17
问题 I am trying to make a website, where people only put their email addresses and they are logged in with cookies and all. At a later stage, i will ask them provide password and names, but NO username will be used. I am trying to do this with django-registraition, but i get errors and i have a few problems. First to disable usernames as a login feature, i put str(time()) instead of username - i was looking for something that will change every time. However, when I skip the authentication (which

Creating a Django Registration Form by Extending Django-Registation Application

女生的网名这么多〃 提交于 2019-12-05 02:45:13
问题 Am trying to create a registration form by extending django-registration app and using Django Profile. I have created the model and form for the profile and when I checked through the django shell it is generating the fields. For the profile fields i am using ModelForm. Now I am struck on how to bring both the django-registration and the profile fields together. Following are the code i have developed model.py class UserProfile(models.Model): """ This class would define the extra fields that

django-registration app and Django 1.5 custom user model

若如初见. 提交于 2019-12-05 00:49:21
I use django-registration app and Django 1.5. How to create (new in django) custom user model and save also this data during registration (Please note that I am using django-registration): class CustomProfile(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=255) bank = models.CharField(max_length=255) address = models.CharField(max_length=255) ? django-registration's main fork is not compatible with django 1.5 for now. Check this pull request . You have three options: Patch django-registration's code. You can get the changes needed from the pull request. Use an

Simple form not validating

橙三吉。 提交于 2019-12-04 15:38:17
I have found here on stackoverflow a method to extend django's built-in authentication using signals. My base User is defined by 'email' and passwords (so no username there). So I'm trying to modify it to my needs, but I'm geting a validation error for my form. Strange thing is that error is connected to the User.email field and I'm getting 'already in use' even though I'm just registering at the moment. Is it trying to save it 2 times or what ? I've discovered it when I was sending dictionary with data to form's contstructor in shell: form = MyForm(data={}) . After this form was still invalid

Already Registered at /appname/: The model User is already registered

て烟熏妆下的殇ゞ 提交于 2019-12-04 15:27:05
问题 I'm trying to connect the django.contrib.auth User with my own UserProfile, and I'm getting an 'AlreadyRegistered' error when I go on the site. Here's the traceback: Environment: Request Method: GET Request URL: myurl.com/django/appname/ Django Version: 1.4.2 Python Version: 2.6.8 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin',