OpenViper

Getting Started

  • Installation
    • Requirements
    • Installing OpenViper
    • Database URL Format
    • Redis Configuration
    • Verifying the Installation
    • Development Server

Tutorial

  • Tutorial: Building a Blog
    • Step 1 — Create the Project
    • Step 2 — Create the Users App
      • Create Migrations and Migrate the Database
      • Add User model to admin
      • Create a Superuser
      • Login to the admin panel
    • Step 3 — Create the Blog App
    • Define the Post Model
    • Create the Serializer (Optional)
    • Step 4 — Write the Views
    • Step 5 — Register Routes
    • Step 6 — Register with the Admin Panel
      • Start the server and navigate to admin, see the left sidebar. create Post records.
    • Step 7 — Task and Events
    • Step 8 — Optional: AI Content Generator
    • Explore the Tools
    • Testing with Swagger UI (OpenAPI)
    • Well Done!

Framework Reference

  • HTTP — Requests, Responses & Views
    • Overview
    • Key Classes & Functions
      • openviper.http.request
        • Request
        • UploadFile
      • openviper.http.response
        • Response
        • JSONResponse
        • HTMLResponse
        • PlainTextResponse
        • RedirectResponse
        • StreamingResponse
        • FileResponse
        • GZipResponse
      • Common HTTP Status Codes
      • openviper.http.views
        • View
        • action()
    • Example Usage
      • Function-Based Views
      • Reading Query Parameters
      • Class-Based Views
      • Extra View Actions
      • File Upload
      • Cookie Handling
      • Streaming Response
      • File Download
      • Redirect
      • Template Rendering
      • GZip Compression
  • Routing
    • Overview
    • Key Classes
      • openviper.routing.router.Router
        • openviper.routing.router.Router.route()
        • openviper.routing.router.Router.get()
        • openviper.routing.router.Router.post()
        • openviper.routing.router.Router.put()
        • openviper.routing.router.Router.patch()
        • openviper.routing.router.Router.delete()
        • openviper.routing.router.Router.options()
        • openviper.routing.router.Router.any()
        • openviper.routing.router.Router.add()
        • openviper.routing.router.Router.include_router()
        • openviper.routing.router.Router.resolve()
        • openviper.routing.router.Router.url_for()
      • openviper.routing.router.Route
      • openviper.routing.router.include()
    • Example Usage
      • Basic Route Registration
      • Named Routes and URL Reversal
      • Non-Decorator Registration
      • Sub-Router / Blueprint Pattern
      • Router-level Middleware
      • Per-Route Middleware
      • Class-Based Views
      • Mounting in the Application
  • Middleware
    • Overview
    • Key Classes
      • openviper.middleware.cors
        • CORSMiddleware
      • openviper.middleware.csrf
        • CSRFMiddleware
      • openviper.middleware.ratelimit
        • RateLimitMiddleware
        • openviper.middleware.ratelimit.rate_limit()
      • openviper.middleware.security
        • SecurityMiddleware
      • openviper.middleware.auth
      • openviper.middleware.base
        • BaseMiddleware
        • openviper.middleware.base.build_middleware_stack()
    • Example Usage
      • Registering via Settings
      • Programmatic Composition
      • Using build_middleware_stack
      • CSRF Token in Forms
      • Rate Limiting a Single View
      • Custom Middleware
  • Plugin Development
    • The ready() Hook
      • Where to define ready()
      • Sync ready() is also supported
      • Registering the plugin
      • Error handling
    • Middleware-based plugins
      • Combining ready() with middleware
    • INSTALLED_APPS auto-discovery
    • Full plugin example
  • Serializers
    • Overview
    • Key Classes & Functions
      • openviper.serializers.Serializer
        • openviper.serializers.Serializer.readonly_fields
        • openviper.serializers.Serializer.writeonly_fields
        • openviper.serializers.Serializer.PAGE_SIZE
        • openviper.serializers.Serializer.validate()
        • openviper.serializers.Serializer.validate_json_string()
        • openviper.serializers.Serializer.from_orm()
        • openviper.serializers.Serializer.from_orm_many()
        • openviper.serializers.Serializer.serialize()
        • openviper.serializers.Serializer.serialize_json()
        • openviper.serializers.Serializer.serialize_many()
        • openviper.serializers.Serializer.serialize_many_json()
        • openviper.serializers.Serializer.paginate()
      • openviper.serializers.PaginatedSerializer
      • openviper.serializers.ModelSerializer
        • openviper.serializers.ModelSerializer.create()
        • openviper.serializers.ModelSerializer.update()
        • openviper.serializers.ModelSerializer.save()
      • openviper.serializers.field_validator()
      • openviper.serializers.model_validator()
      • openviper.serializers.computed_field()
    • Field Type Mapping
    • Example Usage
      • Manual Serializer
      • Model Serializer
        • Exclude Fields
        • write_only and read_only Fields
      • Cross-Field Validation
      • Computed Fields
      • Partial Validation (PATCH)
      • serialize_many — Bulk Serialization
      • Pagination
      • Performance Optimizations
      • ModelSerializer CRUD Helpers
      • Nested Serializers
      • Error Handling
      • Using in a View
  • Database & ORM
    • Overview
    • Key Classes & Functions
      • openviper.db.models
        • Model
        • AbstractModel
        • Manager
        • QuerySet
        • F
        • Q
        • Page
      • openviper.db.fields
      • openviper.db.connection
        • init_db()
        • close_db()
        • get_connection()
    • Lifecycle Hooks
    • Model Events (Signals)
    • Example Usage
      • Defining Models
      • Querying
      • F() Expressions
      • Q() Objects — Complex Filters
      • Aggregate Functions
      • annotate
      • select_related vs prefetch_related
      • bulk_create and bulk_update
      • Large Dataset Iteration
      • Transactions
      • Bypassing Permissions
    • Migrations
  • Authentication & Authorization
    • Overview
    • Key Classes & Functions
      • openviper.auth.jwt
        • create_access_token()
        • create_refresh_token()
        • decode_access_token()
        • decode_refresh_token()
        • decode_token_unverified()
      • openviper.auth.hashers
        • make_password()
        • check_password()
        • is_password_usable()
        • make_unusable_password()
      • openviper.auth.sessions
        • openviper.auth.session.manager.SessionManager
      • openviper.auth.decorators
        • login_required()
        • permission_required()
        • role_required()
        • superuser_required()
        • staff_required()
      • openviper.auth.models
        • AbstractUser
        • User
        • AnonymousUser
        • Permission
        • Role
        • RoleProfile
      • openviper.auth.authentications (token storage)
        • TokenAuthentication
        • create_token()
        • revoke_token()
        • clear_token_auth_cache()
      • openviper.auth.middleware
        • AuthenticationMiddleware
      • Auth Backends
      • Token Blocklist
      • Opaque Token Auth
    • Example Usage
      • Token Authentication (opaque tokens)
      • JWT Login & Protected Endpoint
      • Token Refresh
      • Session Login & Logout
      • Middleware Setup
      • Password Hashing
      • Role & Permission Management
      • Decorator Usage
    • Configuration
    • Built-in Authentication Views and Routes
      • Quick start
      • Adding auth routes to the project
      • Granular view imports
      • Extending the built-in views
      • openviper.auth.views.base_login
        • BaseLoginView
      • openviper.auth.views.jwt_login
        • JWTLoginView
      • openviper.auth.views.token_login
        • TokenLoginView
      • openviper.auth.views.session_login
        • SessionLoginView
      • openviper.auth.views.logout
      • openviper.auth.views.me
        • MeView
      • openviper.views.routes
        • jwt_routes
        • token_routes
        • session_routes
        • all_auth_routes
  • OAuth2 / Social Login
    • Google OAuth2 — Quick Start
      • Required Settings
      • Registering the Routes
      • Customising Redirects
    • Google OAuth2 — Authentication Flow
    • Choosing an Authentication Method
      • Session (default — browser web apps)
      • JWT (SPA / mobile — tokens in cookies)
      • JWT (SPA — tokens in URL fragment)
      • Opaque Token (API clients / CLI tools)
    • Adding a Custom Provider
      • Customising User Creation
    • OAuth2 Events
      • Event Handler Signature
      • Safety Guarantees
    • openviper.auth.views.oauth2 Reference
      • BaseOAuth2InitView
      • BaseOAuth2CallbackView
        • BaseOAuth2CallbackView.extract_user_info()
        • BaseOAuth2CallbackView.get_or_create_user()
        • BaseOAuth2CallbackView.get_token_request_data()
        • BaseOAuth2CallbackView.get_userinfo_headers()
        • BaseOAuth2CallbackView.complete_login()
      • GoogleOAuthInitView
      • GoogleOAuthCallbackView
      • google_oauth_routes
  • Admin Panel
    • Overview
    • Key Classes & Functions
      • openviper.admin.options.ModelAdmin
        • openviper.admin.options.ModelAdmin.list_display
        • openviper.admin.options.ModelAdmin.list_display_links
        • openviper.admin.options.ModelAdmin.list_filter
        • openviper.admin.options.ModelAdmin.list_editable
        • openviper.admin.options.ModelAdmin.search_fields
        • openviper.admin.options.ModelAdmin.ordering
        • openviper.admin.options.ModelAdmin.list_per_page
        • openviper.admin.options.ModelAdmin.list_max_show_all
        • openviper.admin.options.ModelAdmin.date_hierarchy
        • openviper.admin.options.ModelAdmin.list_select_related
        • openviper.admin.options.ModelAdmin.fields
        • openviper.admin.options.ModelAdmin.exclude
        • openviper.admin.options.ModelAdmin.readonly_fields
        • openviper.admin.options.ModelAdmin.fieldsets
        • openviper.admin.options.ModelAdmin.form_fields
        • openviper.admin.options.ModelAdmin.list_display_styles
        • openviper.admin.options.ModelAdmin.sensitive_fields
        • openviper.admin.options.ModelAdmin.actions
        • openviper.admin.options.ModelAdmin.actions_on_top
        • openviper.admin.options.ModelAdmin.actions_on_bottom
        • openviper.admin.options.ModelAdmin.inlines
        • openviper.admin.options.ModelAdmin.child_tables
        • openviper.admin.options.ModelAdmin.save_on_top
        • openviper.admin.options.ModelAdmin.preserve_filters
        • openviper.admin.options.ModelAdmin.has_view_permission()
        • openviper.admin.options.ModelAdmin.has_add_permission()
        • openviper.admin.options.ModelAdmin.has_change_permission()
        • openviper.admin.options.ModelAdmin.has_delete_permission()
        • openviper.admin.options.ModelAdmin.save_model()
        • openviper.admin.options.ModelAdmin.delete_model()
      • openviper.admin.options.InlineModelAdmin
        • openviper.admin.options.InlineModelAdmin.model
        • openviper.admin.options.InlineModelAdmin.fk_name
        • openviper.admin.options.InlineModelAdmin.fields
        • openviper.admin.options.InlineModelAdmin.exclude
        • openviper.admin.options.InlineModelAdmin.readonly_fields
        • openviper.admin.options.InlineModelAdmin.extra
        • openviper.admin.options.InlineModelAdmin.max_num
        • openviper.admin.options.InlineModelAdmin.min_num
        • openviper.admin.options.InlineModelAdmin.can_delete
      • openviper.admin.options.TabularInline
      • openviper.admin.options.StackedInline
      • openviper.admin.options.ChildTable
      • openviper.admin.registry.AdminRegistry
        • openviper.admin.registry.AdminRegistry.register()
        • openviper.admin.registry.AdminRegistry.unregister()
        • openviper.admin.registry.AdminRegistry.is_registered()
        • openviper.admin.registry.AdminRegistry.get_admin()
      • openviper.admin.site.get_admin_site()
    • Example Usage
      • Registering a Model
      • Mounting the Admin Site
      • Custom Actions
      • Inline Editing
      • Overriding Permissions
      • Overriding save_model
      • Sensitive Fields
  • Background Tasks
    • Overview
    • Key Classes & Functions
      • openviper.tasks.decorators
        • task()
      • openviper.tasks.scheduler
        • periodic()
      • openviper.tasks.core
        • Scheduler
      • openviper.tasks.schedule
        • IntervalSchedule
        • CronSchedule
      • openviper.tasks.broker
        • get_broker()
        • setup_broker()
      • openviper.tasks.results
        • get_task_result()
        • list_task_results()
        • get_task_result_sync()
    • Example Usage
      • Defining & Enqueuing a Task
      • Periodic Tasks
      • CronSchedule and IntervalSchedule
      • Starting the Worker
      • Checking Task Results
      • Broker Configuration
  • Email
    • Settings
    • Sending Email
      • send_email()
      • Plain text
      • HTML
      • Multiple recipients, CC, and BCC
      • Custom sender
      • Error handling
    • Templates
      • Plain text template (.txt)
      • HTML template (.html)
      • Markdown template (.md)
      • Template + explicit body
    • Attachments
      • File path (string or Path)
      • Tuple — (filename, content) or (filename, content, mimetype)
      • Raw bytes
      • Dict — path, url, content, or content_b64
      • AttachmentData objects
      • Attachment limits
    • Background Delivery
      • Auto-detection
      • Explicit control
      • Safety fallback
      • Queue configuration
    • Backends
      • SMTPBackend
      • ConsoleBackend
    • API Reference
      • openviper.core.email.message
        • EmailMessageData
        • build_message()
      • openviper.core.email.attachments
        • AttachmentData
        • resolve_attachments()
      • openviper.core.email.backends
        • EmailSettings
        • get_backend()
      • openviper.core.email.queue
        • enqueue_email_job()
        • worker_available()
      • openviper.core.email.templates
        • render_template_content()
        • render_markdown()
  • OpenAPI & Swagger UI
    • Overview
    • Key Functions
      • openviper.openapi.schema
        • generate_openapi_schema()
        • reset_openapi_cache()
      • openviper.openapi.ui
        • get_swagger_html()
        • get_redoc_html()
    • Example Usage
      • Automatic Schema (Zero Configuration)
      • Richer Schema via Pydantic Serializers
      • Return Type Annotation for Response Schema
      • Accessing the Raw Schema
    • OpenAPI Exclusion
      • Disable OpenAPI
      • Exclude Routes by Prefix
      • Prefix Matching Rules
      • Security Benefits
      • API Reference — Exclusion Helpers
        • openviper.openapi.schema
        • openviper.openapi.router
    • Configuration Reference
      • OPENAPI_EXCLUDE
      • All OpenAPI Settings
      • Configuration Examples
      • Security Considerations
  • Templates
    • Overview
    • Key Classes & Functions
      • openviper.template.environment.get_jinja2_env()
      • openviper.template.plugin_loader
        • openviper.template.plugin_loader.load()
    • Example Usage
      • HTMLResponse with a Template
      • Template Structure
      • Custom Filter Plugin
    • Configuration
  • File Storage
    • Overview
    • Key Classes
      • openviper.storage.Storage
        • openviper.storage.Storage.save()
        • openviper.storage.Storage.delete()
        • openviper.storage.Storage.exists()
        • openviper.storage.Storage.url()
        • openviper.storage.Storage.size()
      • openviper.storage.FileSystemStorage
      • openviper.storage.default_storage
    • Example Usage
      • Using default_storage Directly
      • FileField on a Model
      • Custom Storage Backend
    • Configuration
  • Static Files
    • Overview
    • Key Classes & Functions
      • openviper.staticfiles.StaticFilesMiddleware
      • openviper.staticfiles.static()
      • openviper.staticfiles.media()
      • openviper.staticfiles.collect_static()
    • Example Usage
      • Development Static Serving
      • Direct Middleware Usage
      • Collecting Static Files for Production
    • Configuration
  • Exception Reference
    • Overview
    • Exception Hierarchy
    • Key Exceptions
      • OpenViperException
      • ImproperlyConfigured
      • SettingsValidationError
      • HTTPException
      • NotFound
      • MethodNotAllowed
      • PermissionDenied
      • Unauthorized
      • ValidationError
      • Conflict
      • TooManyRequests
      • AuthenticationFailed
      • TokenExpired
      • DoesNotExist
      • MultipleObjectsReturned
      • ModelNotFoundError
      • ModelCollisionError
    • Example Usage
      • Raising HTTP Exceptions in Views
      • Handling ORM Exceptions
      • Custom HTTP Exception
  • Cache Framework
    • Getting Started
    • Configuration
    • Built-in Backends
      • InMemoryCache
      • RedisCache
    • Creating Custom Backends

Configuration & Operations

  • Configuration
    • Overview
    • Key Classes & Functions
      • openviper.conf.Settings
        • openviper.conf.Settings.as_dict()
      • openviper.conf.settings._LazySettings
        • openviper.conf.settings._LazySettings.configure()
      • openviper.conf.settings.validate_settings()
      • openviper.conf.settings.generate_secret_key()
    • Example Usage
      • Defining Settings
      • Accessing Settings
      • Programmatic Configuration (Tests)
      • Environment Variable Overrides
  • Core & CLI
    • Overview
    • Key Classes & Functions
      • openviper.core.app_resolver.AppResolver
        • openviper.core.app_resolver.AppResolver.get_app_dirs()
      • openviper.core.context.current_user
      • openviper.core.context.ignore_permissions_ctx
    • Example Usage
      • Running Management Commands
      • Accessing the Current User in Async Code
      • Bypassing Permissions for Internal Operations
  • Utilities
    • Overview
    • Key Modules
      • openviper.utils.timezone
        • now()
        • get_current_timezone()
        • make_aware()
        • make_naive()
        • is_aware()
        • is_naive()
      • openviper.utils.datastructures
        • Headers
        • MutableHeaders
        • QueryParams
        • ImmutableMultiDict
      • openviper.utils.importlib
        • import_string()
        • reset_import_cache()
    • Example Usage
      • Timezone Helpers
      • Headers Usage
      • Dynamic Import
  • Contrib
    • Overview
    • Key Classes & Functions
      • openviper.contrib.default.middleware
        • DefaultLandingMiddleware
      • openviper.contrib.default.landing
        • LANDING_HTML
    • Example Usage
      • Replacing the Default Landing Page
      • Custom Welcome Page
  • AI Integration
    • Installation
    • Overview
    • Key Classes & Functions
      • openviper.ai.base
        • AIProvider
      • openviper.ai.registry
        • ProviderRegistry
        • openviper.ai.registry.provider_registry
      • openviper.ai.router
        • ModelRouter
        • openviper.ai.router.model_router
      • openviper.ai.extension
      • openviper.ai.devkit
        • SimpleProvider
        • normalize_response()
        • map_http_error()
    • Example Usage
      • Registering & Using a Provider
      • Configuration via Settings
      • Streaming Response
OpenViper
  • Search


© Copyright 2026, OpenViper Contributors.

Built with Sphinx using a theme provided by Read the Docs.