Settings
In [ ]:
Copied!
"""
Django settings for censo project.
Generated by 'django-admin startproject' using Django 5.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""
"""
Django settings for censo project.
Generated by 'django-admin startproject' using Django 5.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""
In [ ]:
Copied!
from pathlib import Path
from pathlib import Path
In [ ]:
Copied!
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# 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/5.1/howto/deployment/checklist/
In [ ]:
Copied!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-3*rj=@s)ot_8w$c+w5p$**0&^4=fe8+q&r(@0)3)_%0#qv@6-$'
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-3*rj=@s)ot_8w$c+w5p$**0&^4=fe8+q&r(@0)3)_%0#qv@6-$'
In [ ]:
Copied!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
In [ ]:
Copied!
ALLOWED_HOSTS = []
ALLOWED_HOSTS = []
Application definition
In [ ]:
Copied!
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'basico',
]
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'basico',
]
In [ ]:
Copied!
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',
]
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',
]
In [ ]:
Copied!
ROOT_URLCONF = 'censo.urls'
ROOT_URLCONF = 'censo.urls'
In [ ]:
Copied!
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',
],
},
},
]
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',
],
},
},
]
In [ ]:
Copied!
WSGI_APPLICATION = 'censo.wsgi.application'
WSGI_APPLICATION = 'censo.wsgi.application'
In [ ]:
Copied!
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
Password validation https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
In [ ]:
Copied!
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',
},
]
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',
},
]
Internationalization https://docs.djangoproject.com/en/5.1/topics/i18n/
In [ ]:
Copied!
LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'en-us'
In [ ]:
Copied!
TIME_ZONE = 'UTC'
TIME_ZONE = 'UTC'
In [ ]:
Copied!
USE_I18N = True
USE_I18N = True
In [ ]:
Copied!
USE_TZ = True
USE_TZ = True
Static files (CSS, JavaScript, Images) https://docs.djangoproject.com/en/5.1/howto/static-files/
In [ ]:
Copied!
STATIC_URL = 'static/'
STATIC_URL = 'static/'
Default primary key field type https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
In [ ]:
Copied!
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'