"""
Django settings for turf_portal project.

Generated by 'django-admin startproject' using Django 3.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import logging
import logging.config
import os
import sys
from pathlib import Path

import dj_database_url
from decouple import Csv, config

# 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 https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config("SECRET_KEY", "LEDHGFLEFBOUEW*!@#$qGEDIW&T")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config("DEBUG", default=True, cast=bool)
ALLOWED_HOSTS = ["*", "turf-portal.herokuapp.com"]

# Application definition

INSTALLED_APPS = [
    "accounts.apps.AccountsConfig",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "django.contrib.humanize",
    "rest_framework",
    "crispy_forms",
    "sales",
    "invoice",
    "stock",
    "expense",
]

MIDDLEWARE = [
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "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 = "turf_portal.urls"
CRISPY_TEMPLATE_PACK = "bootstrap4"
TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [
            BASE_DIR / "templates",
            BASE_DIR / "templates" / "sales",
        ],
        "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 = "turf_portal.wsgi.application"

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql_psycopg2",
        "NAME": config("DB_NAME", "turf_portal"),
        "USER": config("DB_USER", "turf_portal_user"),
        "PASSWORD": config("DB_PASSWORD"),
        "HOST": config("DB_HOST", "127.0.0.1"),
        "PORT": "5432",
    }
}

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

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",
    },
]

# LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
# LOGGING_CONFIG = None
# logging.config.dictConfig({
#     'version': 1,
#     'disable_existing_loggers': False,
#     'formatters': {
#         'console': {
#             # exact format is not important, this is the minimum information
#             'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
#         },
#     },
#     'handlers': {
#         'console': {
#             'class': 'logging.StreamHandler',
#             'formatter': 'console',
#         },
#         # Add Handler for Sentry for `warning` and above
#         'sentry': {
#             'level': 'WARNING',
#             'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
#         },
#     },
#     'loggers': {
#         # root logger
#         '': {
#             'level': 'WARNING',
#             'handlers': ['console', 'sentry'],
#         },
#         'turf_portal.page_processors': {
#             'level': LOGLEVEL,
#             'handlers': ['console', 'sentry'],
#             # required to avoid double logging with root logger
#             'propagate': False,
#         },
#     },
# })

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
        },
    },
    "root": {
        "handlers": ["console"],
        "level": "WARNING",
    },
    "loggers": {
        "django": {
            "handlers": ["console"],
            "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"),
            "propagate": False,
        },
    },
}

LOGIN_URL = "login"

LOGOUT_URL = "logout"

LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = "home"

# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_I18N = True

USE_L10N = True

USE_TZ = False

DATE_INPUT_FORMATS = ["%Y-%m-%d"]

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = "/static/"
STATICFILES_DIRS = [
    BASE_DIR / "turf_portal" / "static",
]
STATIC_ROOT = BASE_DIR / "static"

DEFAULT_ROLL_WIDTH = 2
DEFAULT_ROLL_HEIGHT = 30
DEFAULT_ROLL_LENGTH = 25

# Email
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = config("MAILGUN_SMTP_SERVER", "smtp.gmail.com")
EMAIL_USE_TLS = True
EMAIL_PORT = os.environ.get("MAILGUN_SMTP_PORT", 587)
EMAIL_HOST_USER = config(
    "EMAIL_HOST_USER", os.environ.get("MAILGUN_SMTP_LOGIN")
)
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD", "")
PHONE_NUMBER = config(
    "PHONE_NUMBER", os.environ.get("MAILGUN_SMTP_PASSWORD", "")
)

# Banking Details
BANK = config("BANK", "")
BRANCH = config("BRANCH", "")
BRANCH_CODE = config("BRANCH_CODE", "")
SWIFT_CODE = config("SWIFT_CODE", "")
ACCOUNT_NUMBER = config("ACCOUNT_NUMBER", "")
ACCOUNT_TYPE = config("ACCOUNT_TYPE", "")

if (
    "test" in sys.argv or "test_coverage" in sys.argv or "--cov" in sys.argv
):  # Covers regular testing and django-coverage
    DATABASES["default"]["ENGINE"] = "django.db.backends.sqlite3"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
PROJECT_ROOT = os.path.join(os.path.abspath(__file__))
# STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
# STATIC_URL = '/static/'
#
# # Extra lookup directories for collectstatic to find static files
# STATICFILES_DIRS = (
#     os.path.join(PROJECT_ROOT, 'static'),
# )

#  Add configuration for static files storage using whitenoise
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"


prod_db = dj_database_url.config(conn_max_age=500)
DATABASES["default"].update(prod_db)

"""
To Suppress The Following Warnings:
WARNINGS:
expense.Expense: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the ExpenseConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
invoice.Invoice: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
invoice.Payment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.Buyer: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.BuyerProduct: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.Order: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.OrderLine: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Batch: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Color: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Height: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Product: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.RollSpec: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.TurfRoll: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Warehouse: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Width: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
"""
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

"""
Django settings for turf_portal project.

Generated by 'django-admin startproject' using Django 3.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import logging
import logging.config
import os
import sys
from pathlib import Path

import dj_database_url
from decouple import Csv, config

# 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 https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config("SECRET_KEY", "LEDHGFLEFBOUEW*!@#$qGEDIW&T")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config("DEBUG", default=True, cast=bool)
ALLOWED_HOSTS = ["*", "turf-portal.herokuapp.com"]

# Application definition

INSTALLED_APPS = [
    "accounts.apps.AccountsConfig",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "django.contrib.humanize",
    "rest_framework",
    "crispy_forms",
    "sales",
    "invoice",
    "stock",
    "expense",
]

MIDDLEWARE = [
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "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 = "turf_portal.urls"
CRISPY_TEMPLATE_PACK = "bootstrap4"
TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [
            BASE_DIR / "templates",
            BASE_DIR / "templates" / "sales",
        ],
        "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 = "turf_portal.wsgi.application"

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql_psycopg2",
        "NAME": config("DB_NAME", "turf_portal"),
        "USER": config("DB_USER", "turf_portal_user"),
        "PASSWORD": config("DB_PASSWORD"),
        "HOST": config("DB_HOST", "127.0.0.1"),
        "PORT": "5432",
    }
}

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

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",
    },
]

# LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
# LOGGING_CONFIG = None
# logging.config.dictConfig({
#     'version': 1,
#     'disable_existing_loggers': False,
#     'formatters': {
#         'console': {
#             # exact format is not important, this is the minimum information
#             'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
#         },
#     },
#     'handlers': {
#         'console': {
#             'class': 'logging.StreamHandler',
#             'formatter': 'console',
#         },
#         # Add Handler for Sentry for `warning` and above
#         'sentry': {
#             'level': 'WARNING',
#             'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
#         },
#     },
#     'loggers': {
#         # root logger
#         '': {
#             'level': 'WARNING',
#             'handlers': ['console', 'sentry'],
#         },
#         'turf_portal.page_processors': {
#             'level': LOGLEVEL,
#             'handlers': ['console', 'sentry'],
#             # required to avoid double logging with root logger
#             'propagate': False,
#         },
#     },
# })

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
        },
    },
    "root": {
        "handlers": ["console"],
        "level": "WARNING",
    },
    "loggers": {
        "django": {
            "handlers": ["console"],
            "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"),
            "propagate": False,
        },
    },
}

LOGIN_URL = "login"

LOGOUT_URL = "logout"

LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = "home"

# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_I18N = True

USE_L10N = True

USE_TZ = False

DATE_INPUT_FORMATS = ["%Y-%m-%d"]

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = "/static/"
STATICFILES_DIRS = [
    BASE_DIR / "turf_portal" / "static",
]
STATIC_ROOT = BASE_DIR / "static"

DEFAULT_ROLL_WIDTH = 2
DEFAULT_ROLL_HEIGHT = 30
DEFAULT_ROLL_LENGTH = 25

# Email
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = config("MAILGUN_SMTP_SERVER", "smtp.gmail.com")
EMAIL_USE_TLS = True
EMAIL_PORT = os.environ.get("MAILGUN_SMTP_PORT", 587)
EMAIL_HOST_USER = config(
    "EMAIL_HOST_USER", os.environ.get("MAILGUN_SMTP_LOGIN")
)
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD", "")
PHONE_NUMBER = config(
    "PHONE_NUMBER", os.environ.get("MAILGUN_SMTP_PASSWORD", "")
)

# Banking Details
BANK = config("BANK", "")
BRANCH = config("BRANCH", "")
BRANCH_CODE = config("BRANCH_CODE", "")
SWIFT_CODE = config("SWIFT_CODE", "")
ACCOUNT_NUMBER = config("ACCOUNT_NUMBER", "")
ACCOUNT_TYPE = config("ACCOUNT_TYPE", "")

if (
    "test" in sys.argv or "test_coverage" in sys.argv or "--cov" in sys.argv
):  # Covers regular testing and django-coverage
    DATABASES["default"]["ENGINE"] = "django.db.backends.sqlite3"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
PROJECT_ROOT = os.path.join(os.path.abspath(__file__))
# STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
# STATIC_URL = '/static/'
#
# # Extra lookup directories for collectstatic to find static files
# STATICFILES_DIRS = (
#     os.path.join(PROJECT_ROOT, 'static'),
# )

#  Add configuration for static files storage using whitenoise
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"


prod_db = dj_database_url.config(conn_max_age=500)
DATABASES["default"].update(prod_db)

"""
To Suppress The Following Warnings:
WARNINGS:
expense.Expense: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the ExpenseConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
invoice.Invoice: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
invoice.Payment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.Buyer: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.BuyerProduct: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.Order: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
sales.OrderLine: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Batch: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Color: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Height: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Product: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.RollSpec: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.TurfRoll: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Warehouse: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
stock.Width: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
        HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
"""
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

Django settings for turf_portal project.  Generated by 'django-admin startproject' using Django 3.1.1.  For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/  For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ # Build paths inside the project like this: BASE_DIR / 'subdir'. # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! #$qGEDIW&T") # SECURITY WARNING: don't run with debug turned on in production! # Application definition # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators # LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() # LOGGING_CONFIG = None # logging.config.dictConfig({ #     'version': 1, #     'disable_existing_loggers': False, #     'formatters': { #         'console': { #             # exact format is not important, this is the minimum information #             'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', #         }, #     }, #     'handlers': { #         'console': { #             'class': 'logging.StreamHandler', #             'formatter': 'console', #         }, #         # Add Handler for Sentry for `warning` and above #         'sentry': { #             'level': 'WARNING', #             'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', #         }, #     }, #     'loggers': { #         # root logger #         '': { #             'level': 'WARNING', #             'handlers': ['console', 'sentry'], #         }, #         'turf_portal.page_processors': { #             'level': LOGLEVEL, #             'handlers': ['console', 'sentry'], #             # required to avoid double logging with root logger #             'propagate': False, #         }, #     }, # }) # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.1/howto/static-files/ # Email # Banking Details # Covers regular testing and django-coverage # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ # STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') # STATIC_URL = '/static/' # # # Extra lookup directories for collectstatic to find static files # STATICFILES_DIRS = ( #     os.path.join(PROJECT_ROOT, 'static'), # ) #  Add configuration for static files storage using whitenoise To Suppress The Following Warnings: WARNINGS: expense.Expense: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the ExpenseConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. invoice.Invoice: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. invoice.Payment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the InvoiceConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. sales.Buyer: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. sales.BuyerProduct: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. sales.Order: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. sales.OrderLine: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the SaleConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Batch: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Color: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Height: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Product: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.RollSpec: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.TurfRoll: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Warehouse: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. stock.Width: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.         HINT: Configure the DEFAULT_AUTO_FIELD setting or the StockConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.