Simplified Django Allauth package with Tailwind templates.
Project description
SomeAuth
A Python package based on Django Allauth, simplified to bypass repetitive setup. Comes with pre-styled Tailwind templates for quick integration of authentication and social login.
Features
- Email/password authentication.
- Password Reset.
- Email notifications.
- Optional social login (Google, GitHub, Discord, etc.).
- Pre-styled forms using Tailwind CSS with DaisyUI.
- Minimal configuration required.
- Supports template overrides for full customization.
- All Allauth views
Installation
pip install django-someauth
Add to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
# Django default apps
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites', # required
# SomeAuth
'someauth',
# Tailwind (optional)
'tailwind',
'theme',
# Allauth
'allauth',
'allauth.account',
'allauth.socialaccount',
# Social providers (only include the ones enabled in SOMEAUTH)
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.github',
]
Set SITE_ID:
SITE_ID = 1
SomeAuth Configuration
SOMEAUTH = {
"USE_SOCIAL": True, # Set False to disable social login
"ENABLED_PROVIDERS": ["google", "github"], # Must match provider apps in INSTALLED_APPS
"PROVIDERS": {
"google": {
"client_id": "<your-google-client-id>",
"secret": "<your-google-secret>",
},
"github": {
"client_id": "<your-github-client-id>",
"secret": "<your-github-secret>",
},
}
}
Optional Allauth Settings (Inherited Defaults)
SomeAuth sets sensible defaults for most Allauth settings. You can override them if needed:
MIDDLEWARE = [
# default Django middleware
'allauth.account.middleware.AccountMiddleware',
]
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
]
LOGIN_REDIRECT_URL = "/"
ACCOUNT_LOGOUT_REDIRECT_URL = "/"
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_EMAIL_VERIFICATION = "optional" # or 'mandatory'
SOCIALACCOUNT_AUTO_SIGNUP = True
SOCIALACCOUNT_LOGIN_ON_GET = True
ACCOUNT_FORMS = {
'login': 'someauth.forms.CustomLoginForm',
'signup': 'someauth.forms.CustomSignupForm',
}
SOCIALACCOUNT_ADAPTER = 'someauth.adapters.MySocialAccountAdapter'
ACCOUNT_ADAPTER = 'someauth.adapters.CustomAccountAdapter'
⚠️ Override only when necessary; changing some of these may break SomeAuth behavior.
Email Configuration
SomeAuth supports email notifications. Configure email in settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 465
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
EMAIL_HOST_USER = 'youraddress@email.com'
EMAIL_HOST_PASSWORD = 'emailpassword'
DEFAULT_FROM_EMAIL = 'youraddress@email.com' # Should match EMAIL_HOST_USER
Template Overrides
To customize the look, create template files matching those in SomeAuth (someauth/templates/someauth/...). Django will automatically use your custom templates instead.
First Steps
URLs
Add SomeAuth URLs to your urls.py:
from django.urls import path, include
urlpatterns = [
path('accounts/', include('someauth.urls')), # handles login, logout, signup, social auth
]
Customization
- Override templates in
templates/someauth/... - Override forms via
ACCOUNT_FORMSinsettings.py - Override adapters via
SOCIALACCOUNT_ADAPTERorACCOUNT_ADAPTER
With this setup, your project is fully ready for email/password authentication and optional social login without extra boilerplate.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_someauth-0.1.0.tar.gz.
File metadata
- Download URL: django_someauth-0.1.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6e3a5c2fc6793abcc72b22dc53069dca26834609ba92f2738ffd38576669484
|
|
| MD5 |
e3526cc13b3806269140cfd4a94fa9e3
|
|
| BLAKE2b-256 |
29b920514251b42ca77127139fc448d6071c330b6065cec0b9275edfdfd052ed
|
File details
Details for the file django_someauth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_someauth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a746241b51b191eb8b5e9f2272373c24d3194e7ee2bbae37f015431484f57c6a
|
|
| MD5 |
76dae6b1015a1247efe7e5c296d9c9c2
|
|
| BLAKE2b-256 |
93f43fe6e464d9288ca5acb065938493bbaf8affbb895f86f6945a965f7a3b5d
|