Skip to content

Commit

Permalink
Update django-crispy form support
Browse files Browse the repository at this point in the history
  • Loading branch information
rampal-punia committed Dec 7, 2023
1 parent 7583574 commit 8b2fc0f
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 54 deletions.
107 changes: 53 additions & 54 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,54 +53,52 @@ def get_secret(setting):
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
#### Project Apps ####
'detectobj',
'images',
'modelmanager',
'users',


"detectobj",
"images",
"modelmanager",
"users",
#### Third Party Apps #####
'crispy_forms',
'django_cleanup.apps.CleanupConfig',
"crispy_forms",
"crispy_bootstrap4",
"django_cleanup.apps.CleanupConfig",
]

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',
"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 = 'config.urls'
ROOT_URLCONF = "config.urls"

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'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',
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [BASE_DIR / "templates"],
"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 = 'config.wsgi.application'
WSGI_APPLICATION = "config.wsgi.application"


# Database
Expand All @@ -119,9 +117,9 @@ def get_secret(setting):
# }

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': str(BASE_DIR / 'db.sqlite3'),
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": str(BASE_DIR / "db.sqlite3"),
}
}

Expand All @@ -131,26 +129,26 @@ def get_secret(setting):

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]


# Internationalization
# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/

LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = "en-us"

TIME_ZONE = 'UTC'
TIME_ZONE = "UTC"

USE_I18N = True

Expand All @@ -161,16 +159,16 @@ def get_secret(setting):
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/

STATIC_URL = 'static/'
STATIC_URL = "static/"
STATICFILES_DIRS = [
BASE_DIR / 'static',
BASE_DIR / "static",
]

MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR / "media"

YOLOV5_ROOTDIR = os.path.join(BASE_DIR, 'yolov5')
YOLOV5_WEIGTHS_DIR = os.path.join(YOLOV5_ROOTDIR, 'weights')
YOLOV5_ROOTDIR = os.path.join(BASE_DIR, "yolov5")
YOLOV5_WEIGTHS_DIR = os.path.join(YOLOV5_ROOTDIR, "weights")
if not os.path.exists(YOLOV5_WEIGTHS_DIR):
os.makedirs(YOLOV5_WEIGTHS_DIR)

Expand All @@ -180,22 +178,23 @@ def get_secret(setting):
# Default primary key field type
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#default-auto-field

AUTH_USER_MODEL = 'users.CustomUser'
AUTH_USER_MODEL = "users.CustomUser"

CRISPY_TEMPLATE_PACK = 'bootstrap4'
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
CRISPY_TEMPLATE_PACK = "bootstrap4"

LOGIN_REDIRECT_URL = '/'
LOGIN_REDIRECT_URL = "/"

LOGIN_URL = '/users/login/'
LOGIN_URL = "/users/login/"

# Celery settings
CELERY_RESULT_BACKEND = 'django-db'
CELERY_RESULT_BACKEND = 'django-cache'
CELERY_RESULT_BACKEND = "django-db"
CELERY_RESULT_BACKEND = "django-cache"

# Celery Configuration Options
CELERY_TIMEZONE = 'Asia/Kolkata'
CELERY_TIMEZONE = "Asia/Kolkata"
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 30 * 60


DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
139 changes: 139 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
absl-py==1.3.0
altair==4.2.2
amqp==5.1.1
asgiref==3.5.2
asttokens==2.1.0
attrs==22.2.0
autopep8==2.0.0
av==10.0.0
backcall==0.2.0
backports.zoneinfo==0.2.1
billiard==3.6.4.0
blinker==1.5
boto3==1.26.14
botocore==1.29.14
cachetools==5.2.0
celery==5.2.7
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.0.4
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
confluent-kafka==2.0.2
contourpy==1.0.6
cycler==0.11.0
decorator==5.1.1
Django==4.1.3
django-cleanup==6.0.0
django-crispy-forms==1.14.0
django-debug-toolbar==3.7.0
entrypoints==0.4
executing==1.2.0
filterpy==1.4.5
fire==0.4.0
fonttools==4.38.0
gitdb==4.0.10
GitPython==3.1.31
google-auth==2.14.1
google-auth-oauthlib==0.4.6
grpcio==1.50.0
idna==3.4
imageio==2.26.0
importlib-metadata==5.0.0
importlib-resources==5.12.0
imutils==0.5.4
ipython==8.6.0
jedi==0.18.2
Jinja2==3.1.2
jmespath==1.0.1
jsonschema==4.17.3
kiwisolver==1.4.4
klvdata==0.0.3
kombu==5.2.4
lap==0.4.0
lazy-loader==0.1
Markdown==3.4.1
markdown-it-py==2.2.0
MarkupSafe==2.1.1
matplotlib==3.6.2
matplotlib-inline==0.1.6
mdurl==0.1.2
networkx==3.0
numpy==1.23.5
nvidia-cublas-cu11==11.10.3.66
nvidia-cuda-nvrtc-cu11==11.7.99
nvidia-cuda-runtime-cu11==11.7.99
nvidia-cudnn-cu11==8.5.0.96
oauthlib==3.2.2
opencv-python==4.6.0.66
packaging==21.3
pandas==1.5.1
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.3.0
pkgutil-resolve-name==1.3.10
prompt-toolkit==3.0.33
protobuf==3.20.3
psutil==5.9.4
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==11.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybboxes==0.1.5
pycodestyle==2.9.1
pydeck==0.8.0
Pygments==2.13.0
Pympler==1.0.1
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
pytz==2022.6
pytz-deprecation-shim==0.1.0.post0
PyWavelets==1.4.1
PyYAML==6.0
requests==2.28.1
requests-oauthlib==1.3.1
rich==13.3.2
rsa==4.9
s3transfer==0.6.0
sahi==0.11.4
scikit-image==0.20.0
scipy==1.9.3
seaborn==0.12.1
semver==2.13.0
Shapely==1.8.5.post1
six==1.16.0
smmap==5.0.0
sqlparse==0.4.3
stack-data==0.6.1
streamlit==1.20.0
tensorboard==2.11.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
termcolor==2.1.1
terminaltables==3.1.10
thop==0.1.1.post2209072238
tifffile==2023.2.28
toml==0.10.2
tomli==2.0.1
toolz==0.12.0
torch==1.13.1
torchaudio==0.13.1+cu116
torchvision==0.14.1
tornado==6.2
tqdm==4.64.1
traitlets==5.5.0
typing-extensions==4.4.0
tzdata==2022.7
tzlocal==4.2
urllib3==1.26.12
validators==0.20.0
vine==5.0.0
watchdog==2.3.1
wcwidth==0.2.5
Werkzeug==2.2.2
yolov5==6.2.3
zipp==3.10.0

0 comments on commit 8b2fc0f

Please sign in to comment.