django-user-accounts
raw JSON → 3.3.2 verified Mon Apr 27 auth: no python
A reusable Django application for managing user accounts, including signup, login, password reset, email verification, and account management. Current version is 3.3.2. Release cadence is irregular; maintained by the Pinax project.
pip install django-user-accounts Common errors
error ModuleNotFoundError: No module named 'account' ↓
cause The app is not installed or not added to INSTALLED_APPS.
fix
Run 'pip install django-user-accounts' and add 'account' to INSTALLED_APPS in your Django settings.
error django.core.exceptions.ImproperlyConfigured: The account app requires django.contrib.sites to be installed. ↓
cause django.contrib.sites is missing from INSTALLED_APPS.
fix
Add 'django.contrib.sites' to INSTALLED_APPS and set SITE_ID in settings.
error LookupError: No installed app with label 'account'. ↓
cause The app label 'account' is not found; migrations may not have been run or app not in INSTALLED_APPS.
fix
Verify 'account' is in INSTALLED_APPS and run 'python manage.py migrate account'.
Warnings
gotcha v3.3.0 was released without database migrations; upgrade to v3.3.1 or v3.3.2 immediately. ↓
fix pip install --upgrade django-user-accounts==3.3.2
breaking Dropped support for Django 2.2 in v3.3.0. If upgrading from v3.1.x or earlier, check your Django version. ↓
fix Use Django 3.2+ or stick with django-user-accounts v3.1.x.
deprecated The force_text() utility was removed in v3.0.3. Use force_str() instead. ↓
fix Replace force_text() with force_str() in your code.
gotcha Python 2.7, 3.4, 3.5 support dropped in v3.0.2. Ensure you use Python 3.6+. ↓
fix Upgrade Python interpreter.
Imports
- Account wrong
from user_accounts.models import Accountcorrectfrom account.models import Account - SignupView
from account.views import SignupView - LoginView
from account.views import LoginView - password_reset_url wrong
from account.views import password_reset_urlcorrectfrom account.utils import password_reset_url
Quickstart
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
django.setup()
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.sites',
'account',
]
SITE_ID = 1
ACCOUNT_EMAIL_UNIQUE = True
from django.conf import settings
from account.models import SignupCode
# Example: create a signup code
code = SignupCode.objects.create(email='test@example.com')
print(code.code)