django-tinyuser (0.0.1)

Published 2026-06-26 05:01:14 +02:00 by chris

Installation

pip install --index-url  django-tinyuser

About this package

A small minimal user for django using allauth-integration

Django TinyUser

Neither the app nor the documentation is finished yet, but I wanted to publish the project anyway, because I need it for my projects and I want to share it with others. If you want to contribute to the project, feel free to open a pull request or an issue.

Django TinyUser is a small user authentication app for django. It is meant to be used by projects that need a small user authentication for their projects and don't want to implement their own. It is used by my projects and docker images for basic user authentication using django-allauth.

This project is distributed under the 0BSD-License.

It uses django-allauth as backend and overloads the templates for Bootstrap and Tailwind CSS.

Installation

Add TinyUser to your project using poetry

poetry add https+git://codeberg.org/c9moser/django-tinyuser.git

Configuration of your project

from django_tinyuser.global_templates.tailwindcss import PATH as TINYUSER_GLOBAL_TEMPLATES
...
# Register allauth and django_tinyuser
APPS = [
    ...
    'allauth',
    'allauth.account',
    'allauth.socialaccount', # if you want to use social auth
    # add the providers you want to use, e.g. 'allauth.socialaccount.providers.google',
    'django_tinyuser',
    ...
]

If you use Bootstrap, you can add overloads to your TEMPLATES. The overloads are located in the global_templates folder of django_tinyuser. You can add them to your TEMPLATES like this is and they will be used instead of the default templates of django-allauth.

Note that you have to add the path to the overloads before the default templates of django-allauth, otherwise they will not be used.

And don't forget to add the context processors for django-allauth, and django-tinyuser otherwise the templates will not work.

from django_tinyuser.global_templates.bootstrap import PATH as TINYUSER_GLOBAL_TEMPLATES
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        # Add Bootstrap overloads to TEMPLATES
        'DIRS': [TINYUSER_GLOBAL_TEMPLATES],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django_tinyuser.context_processors.tinyuser'
                ...
            ],
        },
    },
...
]

If you use Tailwind CSS, you can add the overloads to your TEMPLATES like this is and they will be used instead of the default templates of django-allauth.

from django_tinyuser.global_templates.tailwindcss import PATH as TINYUSER_GLOBAL_TEMPLATES
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        # Add Tailwind CSS overloads to TEMPLATES
        'DIRS': [TINYUSER_GLOBAL_TEMPLATES],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django_tinyuser.context_processors.tinyuser'
                ...
            ],
        },
    },
...
]

You also need to set the CSS_FRAMEWORK option in your settings.py to the css framework you use, otherwise the templates will not work.

CSS_FRAMEWORK = 'bootstrap' # if you use Bootstrap
# or
CSS_FRAMEWORK = 'tailwindcss' # if you use Tailwind CSS
# or
CSS_FRAMEWORK = 'custom' # if you use custom templates

And you need to set the AUTH_USER_MODEL to django_tinyuser.TinyUser in your settings.py or to an overloaded model if you have customized the user model.

AUTH_USER_MODEL = 'django_tinyuser.TinyUser'

Then add the urls of django-allauth to your urls.py

from django.urls import path, include
urlpatterns = [
    ...
    path('accounts/', include('allauth.urls')),
    ...
]

Finally run the migrations to create the required tables added by required apps, django-allauth and django-tinyuser.

    python manage.py migrate

Configuration options to be added to your settings.py

CSS_FRAMEWORK

One of the following values:

  • bootstrap - if you use Bootstrap (partially implemented, but not tested yet)
  • tailwindcss - if you use Tailwind CSS (not implemented yet)
  • custom - custom template (you need to overload all templates yourself and add the path to your TEMPLATES)

Note that the default value is 'bootstrap', so if you use Bootstrap, you don't need to set this option.

If you use Tailwind CSS, you need to set this option to 'tailwindcss', otherwise the templates will not work.

You can contact me under my Mastodon account if you have any questions or suggestions for the project. I am also open for contributions, so if you want to contribute to the project, feel free to open a pull request or an issue.

Requirements

Requires Python: >=3.13,<3.15
Details
PyPI
2026-06-26 05:01:14 +02:00
12
Christian Moser
211 KiB
Assets (2)
Versions (1) View all
0.0.1 2026-06-26