Project Structure
Blueprints
Enferno uses a three-blueprint architecture for better organization and security:1. Portal Blueprint (portal/)
Usually contains protected routes that require authentication. Enferno uses a pattern of protecting all routes in this blueprint automatically using before_request:
2. User Blueprint (user/)
Handles user management, authentication, and profile-related routes:
3. Public Blueprint (public/)
Contains routes that are publicly accessible without authentication:
Database Operations
Enferno uses SQLAlchemy 2.x with the Flask-SQLAlchemy extension. Thedb instance is available from enferno.extensions.
Model Definition
Database Operations
Background Tasks (Optional)
Celery is available when you need async job processing. First, install the full extras:enferno/tasks/__init__.py:
API Development
Add API endpoints to your blueprints:Development Server
Security Best Practices
-
Input Validation
-
CSRF Protection
-
Authentication
Debugging
Enferno includes several debugging tools:-
Flask Debug Toolbar
-
Logging
-
Database Debugging