#28163: Make the default settings.py pass pep8
-------------------------------------+-------------------------------------
Reporter: Yoni Lavi | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Yoni Lavi):
* status: closed => new
* resolution: wontfix =>
Comment:
Hi folks,
I'm sorry to rehash this, but the current validator verbosity keeps
bugging me on my own projects and I'm sure I'm not the only one. So I just
wanted to ask if you would be open to a more flexible approach such as
using this sort of utility function (to be included in django.utils?):
{{{#!python
def basic_password_validator(class_name, **kwargs):
MODULE_PATH = 'django.contrib.auth.password_validation.'
validator = {'NAME': '.'.join(MODULE_PATH, class_name)}
validator.update(kwargs)
return validator
AUTH_PASSWORD_VALIDATORS = [
basic_password_validator('UserAttributeSimilarityValidator'),
basic_password_validator('MinimumLengthValidator',
OPTIONS={'min_length': 9}),
basic_password_validator('CommonPasswordValidator'),
basic_password_validator('NumericPasswordValidator'),
]
}}}
So I'm just looking for feedback about whether this sort of approach might
be deemed acceptable, and if so whether you have advice about the specific
implementation. If not, I promise to stop spamming this ticket :)
--
Ticket URL: <https://code.djangoproject.com/ticket/28163#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.fb5684a9fc061f77723991c16c6f4a9a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.