Reference¶
Complete API reference for Aksara — a quick lookup for all classes, methods, and options.
What is This Section?¶
This is a reference guide, not a tutorial. Use it when you need to look up:
- What options a setting accepts
- What methods are available on a class
- What parameters a function takes
New to Aksara? Start with the Getting Started Guide or Quickstart instead.
Reference Sections¶
| Reference | What It Covers |
|---|---|
| Settings Reference | All configuration options for your app |
| API Reference | ViewSets, serializers, permissions, actions |
| ORM Reference | Models, fields, queries, managers |
| CLI Reference | All command-line commands |
| Exceptions | Error types and how to handle them |
| Types | Type definitions for type hints |
Quick Reference¶
Settings¶
# settings.py
AKSARA = {
"DEBUG": True, # Enable debug mode
"DATABASE_URL": "postgresql://localhost/myapp", # Database connection
"SECRET_KEY": "your-secret-key", # For encryption
"INSTALLED_APPS": ["myapp"], # Your apps
}
Models¶
from aksara import Model, fields
class User(Model):
email = fields.Email(unique=True)
name = fields.String(max_length=100)
is_active = fields.Boolean(default=True)
ViewSets¶
from aksara.api import ModelViewSet
class UserViewSet(ModelViewSet):
model = User
serializer_class = UserSerializer
permission_classes = [IsAuthenticated]
CLI Commands¶
# Create a project
aksara startproject myproject
# Create database migrations
aksara makemigrations
# Apply migrations
aksara migrate
# Start the development server
aksara dev
Version Information¶
Current version: 0.5.46
Check your installed version:
How to Use This Reference¶
Finding What You Need¶
- Know the setting name? → Settings Reference
- Working with models? → ORM Reference
- Building an API? → API Reference
- Running commands? → CLI Reference
- Handling errors? → Exceptions
Understanding the Format¶
Each reference page uses this format:
# Class or Function Name
description of what it does
# Parameters/Options
parameter_name: type = default # description
# Example
actual_code_example()
Related Documentation¶
| Section | For |
|---|---|
| Getting Started | Learning Aksara from scratch |
| Tutorials | Building complete applications |
| ORM Guide | Understanding the ORM in depth |
| API Guide | Understanding the API layer |
| Changelog | What's new in each version |