Python Forum
Question about dot notation syntax (Django source)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about dot notation syntax (Django source)
#1
In, “Password management in Django”, it explains that this particular doc is for advanced users, like Django admins who need to choose different hashing algorithms. So it’s not really necessary for a beginner user like me to understand. From the doc:

Quote:depending on your requirements, you may choose a different algorithm, or even use a custom algorithm to match your specific security situation. Again, most users shouldn’t need to do this – if you’re not sure, you probably don’t. If you do, please read on...

I don’t. So I don’t need to continue reading.

But I do have some questions about dot notation in general as some code appears in settings.py. Lines 87 - 100 in this file appear as follows:

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
Can someone please identify the first item in this list? I understand that all the items in this list are dictionaries. The first dictionary is named, ‘NAME’. The key involves libraries, functions, variables, class names and more functions. Which is which? Is django the library? What is contrib? Is this a function name or a class name? If contrib is a function name or class name, where is it located in my venv or Django project folder?

What does each word in the dictionary mean or refer to? Can someone please explain the syntax?

Thanks for your attention.
Reply


Messages In This Thread
Question about dot notation syntax (Django source) - by Drone4four - Feb-16-2018, 12:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,477 Jun-30-2019, 12:21 AM
Last Post: scidam
  Python requests.get() returns broken source code instead of expected source code? FatalPythonError 3 3,795 Sep-21-2018, 02:46 PM
Last Post: nilamo
  Django syntax mepyyeti 2 2,570 Feb-16-2018, 05:03 AM
Last Post: Drone4four
  Django question tony1812 1 3,373 Aug-28-2017, 01:13 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020