Overview
This page documents all Django settings used in the Proyecto application. The settings module is located atproyecto/settings.py and controls application behavior, security, database connections, and more.
Security Settings
SECRET_KEY
Django’s secret key used for cryptographic signing. This key is used for session management, password reset tokens, and other security features.
proyecto/settings.py
DEBUG
Enables or disables debug mode. When
True, Django displays detailed error pages with full traceback information.ALLOWED_HOSTS
List of host/domain names that Django will serve. This is a security measure to prevent HTTP Host header attacks.
In production, update this list to include your actual domain names and IP addresses. You can use
['*'] for development, but never in production.Application Configuration
INSTALLED_APPS
List of all Django applications that are activated in this Django instance.
CTP app is the main application module containing:
- Models for projects, tasks, and team members
- Views for all CRUD operations
- Forms for data input
- Templates for UI rendering
MIDDLEWARE
Middleware components that process requests and responses in order.
- SecurityMiddleware: Provides several security enhancements
- SessionMiddleware: Enables session support
- CsrfViewMiddleware: Protects against Cross-Site Request Forgery attacks
- AuthenticationMiddleware: Associates users with requests
- ClickjackingMiddleware: Prevents clickjacking via X-Frame-Options header
ROOT_URLCONF
Python path to the root URL configuration module.
Session Configuration
SESSION_COOKIE_AGE
Age of session cookies in seconds. Controls how long users stay logged in.
SESSION_EXPIRE_AT_BROWSER_CLOSE
Whether to expire the session when the user closes their browser.
Database Configuration
DATABASES
Dictionary containing database connection settings. Proyecto uses PostgreSQL.
Database backend to use. Set to
django.db.backends.postgresql_psycopg2 for PostgreSQL.Database name. Default is
'Proyecto'.Database user for authentication.
Database password for authentication.
Database host. Use
'localhost' for local development.Database port. PostgreSQL default is
'5432'.When
True, wraps each view in a database transaction. This ensures data integrity by rolling back all database changes if any exception occurs.Templates Configuration
TEMPLATES
Template engine configuration. Proyecto uses Django’s built-in template engine.
- DIRS: Additional directories to search for templates
- APP_DIRS: Whether to look for templates in app directories
- context_processors: Functions that add variables to template context
Authentication Settings
Password Validation
List of validators that check password strength and security.
- Password is not too similar to user attributes
- Password meets minimum length requirements
- Password is not a commonly used password
- Password is not entirely numeric
Login/Logout Redirects
URL to redirect to after successful login.
URL to redirect to after logout.
Static and Media Files
Static Files
URL prefix for static files (CSS, JavaScript, images).
Additional directories where Django looks for static files.
Media Files
URL prefix for user-uploaded media files.
Filesystem path where uploaded media files are stored.
Internationalization
Language and Timezone
Default language code for the application.
Default timezone for the application.
- USE_I18N: Enable Django’s translation system
- USE_L10N: Enable localized formatting of data
- USE_TZ: Enable timezone support
Other Settings
WSGI_APPLICATION
Python path to the WSGI application object used by Django’s development server and WSGI deployments.
DEFAULT_AUTO_FIELD
Default primary key field type for models that don’t specify one.
Production Configuration Checklist
When deploying to production, review and update these settings:Security Settings
- Set
DEBUG = False - Generate new
SECRET_KEY - Update
ALLOWED_HOSTS - Use HTTPS
Database
- Use environment variables
- Set up connection pooling
- Configure backups
- Use strong passwords
Static Files
- Run
collectstatic - Configure web server
- Enable compression
- Set up CDN (optional)
Sessions & Security
- Adjust
SESSION_COOKIE_AGE - Enable CSRF protection
- Configure CORS if needed
- Set security headers
See Also
- Database Setup - Detailed database configuration guide
- Production Deployment - Complete production deployment guide
- Configuration Reference - Environment-specific configuration