# ImproperlyConfigured at

**URL:** https://forum.djangoproject.com/t/improperlyconfigured-at/28962
**Category:** Getting Started
**Created:** [March 11, 2024, 2:13pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962 "2024-03-11T14:13:25Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 11, 2024, 2:13pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/1 "2024-03-11T14:13:25Z")

</div>

the following error occurs in my project:-  
The module in NAME could not be imported: bookstore\_app.validators.PasswordValidation. Check your AUTH\_PASSWORD\_VALIDATORS setting.  
i created my own password validation and registered it on setting.py file like the following:-  
setting.py

```auto
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS':{'min_length':6},
    },
    {
        'NAME':'bookstore_app.validators.PasswordValidation'
        },
    
]

```

validators.py file

```auto
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from .forms import registerForm
class PasswordValidation:
    def __init__ (self, min_length=1):
        self.min_length = min_length
    def validate(self, password, user=None):
        special_characters = "[~\!@#\$%\^&\*\(\)_\+{}\":;'\[\]]"
        if not any(char.isdigit() for char in password):
            raise ValidationError(_('Password must contain at least %(min_length)d digit.') % {'min_length': self.min_length})
        if not any(char.isalpha() for char in password):
            raise ValidationError(_('Password must contain at least %(min_length)d letter.') % {'min_length': self.min_length})
        if not any(char in special_characters for char in password):
            raise ValidationError(_('Password must contain at least %(min_length)d special character.') % {'min_length': self.min_length})
    def get_help_text(self):
        return ""

```

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [March 11, 2024, 2:24pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/2 "2024-03-11T14:24:56Z")

</div>

Note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of fixing your original post for you.)

What is the name of the directory that your validators.py file is in?

---

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 11, 2024, 2:30pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/3 "2024-03-11T14:30:54Z")

</div>

bookstore\_app is the app directory name where my validators.py file is there.

---

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 11, 2024, 2:31pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/4 "2024-03-11T14:31:40Z")

</div>

and setting.py file is included in my project direcotry which bookstore\_project

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [March 11, 2024, 2:44pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/5 "2024-03-11T14:44:40Z")

</div>

Is `bookstore_app` in your INSTALLED\_APPS setting?

---

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 11, 2024, 3:01pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/6 "2024-03-11T15:01:51Z")

</div>

yes. like this:-  
INSTALLED\_APPS = [  
‘django.contrib.admin’,  
‘django.contrib.auth’,  
‘django.contrib.contenttypes’,  
‘django.contrib.sessions’,  
‘django.contrib.messages’,  
‘django.contrib.staticfiles’,  
‘bookstore\_app’,

]

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [March 11, 2024, 4:19pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/7 "2024-03-11T16:19:22Z")

</div>

Try removing the `from .forms import registerForm` from the validators file. You are not using it in the validator, and there’s the possibility that it might be creating a circular import.

Also, if you’re getting a complete stacktrace it would be helpful to see the complete error being received.

---

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 11, 2024, 4:49pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/8 "2024-03-11T16:49:47Z")

</div>

i removed it. no solution yet

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [March 11, 2024, 5:07pm UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/9 "2024-03-11T17:07:47Z")

</div>

Ok, I’m going to need to see the complete command being run along with the full stacktrace. It’s probably worth posting your complete settings file at this time, too.

---

<div class="post-metadata">

### Author: ![taaddele](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/taaddele/32/19642_2.png) [@taaddele](https://forum.djangoproject.com/u/taaddele)
#### Post date: [March 12, 2024, 7:53am UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/10 "2024-03-12T07:53:45Z")

</div>

this is the complete setting.py file  
“”"  
Django settings for bookstore\_project project.

Generated by ‘django-admin startproject’ using Django 4.2.

For more information on this file, see

> **[Django settings | Django documentation](https://docs.djangoproject.com/en/4.2/topics/settings/)**
>
> The web framework for perfectionists with deadlines.

For the full list of settings and their values, see

> **[Settings | Django documentation](https://docs.djangoproject.com/en/4.2/ref/settings/)**
>
> The web framework for perfectionists with deadlines.

“”"

import os  
from pathlib import Path

# Build paths inside the project like this: BASE\_DIR / ‘subdir’.

BASE\_DIR = Path( **file** ).resolve().parent.parent

# Quick-start development settings - unsuitable for production

# See [Deployment checklist | Django documentation | Django](https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/)

# SECURITY WARNING: keep the secret key used in production secret!

SECRET\_KEY = ‘django-insecure-z#=e9#82)jp0g\_gs$h_kq$6_@%4g4=c@g6otuj42%4113#01$d’

# SECURITY WARNING: don’t run with debug turned on in production!

DEBUG = True

ALLOWED\_HOSTS =

# Application definition

INSTALLED\_APPS = [  
‘django.contrib.admin’,  
‘django.contrib.auth’,  
‘django.contrib.contenttypes’,  
‘django.contrib.sessions’,  
‘django.contrib.messages’,  
‘django.contrib.staticfiles’,  
‘bookstore\_app’,

]

MIDDLEWARE = [  
‘django.middleware.security.SecurityMiddleware’,  
‘django.contrib.sessions.middleware.SessionMiddleware’,  
‘django.middleware.common.CommonMiddleware’,  
‘django.middleware.csrf.CsrfViewMiddleware’,  
‘django.contrib.auth.middleware.AuthenticationMiddleware’,  
‘django.contrib.messages.middleware.MessageMiddleware’,  
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,  
]

ROOT\_URLCONF = ‘bookstore\_project.urls’

TEMPLATES = [  
{  
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,  
‘DIRS’: ,  
‘APP\_DIRS’: True,  
‘OPTIONS’: {  
‘context\_processors’: [  
‘django.template.context\_processors.debug’,  
‘django.template.context\_processors.request’,  
‘django.contrib.auth.context\_processors.auth’,  
‘django.contrib.messages.context\_processors.messages’,  
],  
},  
},  
]

WSGI\_APPLICATION = ‘bookstore\_project.wsgi.application’

# Database

# [Settings | Django documentation | Django](https://docs.djangoproject.com/en/4.2/ref/settings/#databases)

DATABASES = {  
‘default’: {  
‘ENGINE’: ‘django.db.backends.postgresql’,  
‘NAME’:‘Bookstore’,  
‘USER’:‘postgres’,  
‘PASSWORD’:‘Informatics4\*\*’,  
‘HOST’:‘localhost’  
}  
}

# Password validation

# [Settings | Django documentation | Django](https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators)

AUTH\_PASSWORD\_VALIDATORS = [  
{  
‘NAME’: ‘django.contrib.auth.password\_validation.MinimumLengthValidator’,  
‘OPTIONS’:{‘min\_length’:6},  
},  
{  
‘NAME’:‘bookstore\_app.validators.PasswordValidation’  
},

]

# Internationalization

# [Internationalization and localization | Django documentation | Django](https://docs.djangoproject.com/en/4.2/topics/i18n/)

LANGUAGE\_CODE = ‘en-us’

TIME\_ZONE = ‘UTC’

USE\_I18N = True

USE\_TZ = True

# Static files (CSS, JavaScript, Images)

# [How to manage static files (e.g. images, JavaScript, CSS) | Django documentation | Django](https://docs.djangoproject.com/en/4.2/howto/static-files/)

STATIC\_URL = ‘static/’  
STATICFILES\_DIRS =[  
os.path.join(BASE\_DIR,‘static/’)  
]  
#BASE\_DIR = os.path.dirname(os.path.dirname(os.path.abspath( **file** )))

# Default primary key field type

# [Settings | Django documentation | Django](https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field)

DEFAULT\_AUTO\_FIELD = ‘django.db.models.BigAutoField’  
AUTH\_USER\_MODEL = “bookstore\_app.CustomUser”

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [March 12, 2024, 11:51am UTC](https://forum.djangoproject.com/t/improperlyconfigured-at/28962/11 "2024-03-12T11:51:52Z")

</div>

Please fix your post.

> [@KenWhitesell](#):
>
> Note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.

And please post the complete error being received with the traceback.
