Skip to main content

Password-based login for Plain.

Project description

plain.password

Password authentication for Plain.

Usage

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 username 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 PasswordLoginView 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'),
    # ...
]

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.9.1.tar.gz (95.6 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.9.1-py3-none-any.whl (98.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plain_passwords-0.9.1.tar.gz
Algorithm Hash digest
SHA256 4abb7b33356cbe1267af315f8bca82322c6ed963922aa1b7874d2edc7421f2b8
MD5 eed0dd16063993ebc21a5981ced4cf2d
BLAKE2b-256 a17ba6a798448b4eaedf6cb47f4f3b4ab3b458c94287466f23a1e0b93dd3cd39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_passwords-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d3b64bd88ed602b7e12fc99ba31899ea0a284eced8f208fc4e2ac53547e1d27
MD5 996b804c1061a3ce52d583f3dbacb35a
BLAKE2b-256 bda74647f4fdc2c9b9f45941dd5511f1833e063255dea2a72293a6c554d4997d

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