Skip to main content

Password authentication for Plain.

Project description

plain.passwords

Password authentication for Plain.

Overview

To enable password authentication in your Plain application, add the PasswordLoginView to your urls.py:

# app/urls.py
from plain.urls import path
from plain.passwords.views import PasswordLoginView

urlpatterns = [
    path('login/', PasswordLoginView, name='login'),
    # ...
]

This sets up a basic login view where users can authenticate using their email and password.

For password resets to work, you also need to install plain.email.

FAQs

How do I customize the login form?

To customize the login form, you can subclass PasswordLoginForm and override its fields or methods as needed. Then, set the form_class attribute in your view to use your custom form.

# app/forms.py
from plain.passwords.forms import PasswordLoginForm

class MyCustomLoginForm(PasswordLoginForm):
    # Add custom fields or override methods here
    pass

# app/views.py
from plain.passwords.views import PasswordLoginView
from .forms import MyCustomLoginForm

class MyPasswordLoginView(PasswordLoginView):
    form_class = MyCustomLoginForm

Update your urls.py to use your custom view:

# app/urls.py
from plain.urls import path
from .views import MyPasswordLoginView

urlpatterns = [
    path('login/', MyPasswordLoginView, name='login'),
    # ...
]

Installation

Install the plain.passwords package from PyPI:

uv add plain.passwords

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plain_passwords-0.13.0.tar.gz (97.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plain_passwords-0.13.0-py3-none-any.whl (100.0 kB view details)

Uploaded Python 3

File details

Details for the file plain_passwords-0.13.0.tar.gz.

File metadata

  • Download URL: plain_passwords-0.13.0.tar.gz
  • Upload date:
  • Size: 97.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for plain_passwords-0.13.0.tar.gz
Algorithm Hash digest
SHA256 aea10c896d9d662e84b559f46567c2c487bd050988d6ed82a123a176259a426c
MD5 bac3a0b40f47d3dcbcf9c5e1b507bcca
BLAKE2b-256 74f1b6784d42233cd196594a5600cc075f7202c6372f41671e14050730ba1e04

See more details on using hashes here.

File details

Details for the file plain_passwords-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plain_passwords-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a2d688acbe2111769bc7ba69a4348e1a498118a97d99c0e4720085256ee544
MD5 b15d10c8aa3e7fce0ad31ed87d5e345f
BLAKE2b-256 234e2f1733f25a60edde364972c88f71b87a86e2cdb77b59313aaa873260efb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page