Shared Django utilities for LightWave Media projects
Project description
lightwave-core
Shared Django utilities for LightWave Media projects.
Installation
# Local development (from workspace root)
uv pip install -e packages/lightwave-core
# With billing support (Stripe)
uv pip install -e "packages/lightwave-core[billing]"
# In a project's requirements.txt
-e file:../../packages/lightwave-core
Modules
Storage (lightwave.storage)
CDN and S3 storage backends for static files and media.
from lightwave.storage import StaticStorage, PublicMediaStorage, PrivateMediaStorage
# In settings.py
STORAGES = {
"staticfiles": {"BACKEND": "lightwave.storage.StaticStorage"},
"default": {"BACKEND": "lightwave.storage.PublicMediaStorage"},
}
# Configure static file prefix per project
LIGHTWAVE_STATIC_PREFIX = "static/my-project"
Utils (lightwave.utils)
Common utilities including BaseModel, timezone helpers, slug generation.
from lightwave.utils import BaseModel, get_common_timezones, get_next_unique_slug
class MyModel(BaseModel):
# Automatically has created_at and updated_at fields
name = models.CharField(max_length=100)
Auth (lightwave.auth)
Base user model and authentication helpers.
from lightwave.auth import BaseCustomUser, validate_profile_picture
class CustomUser(BaseCustomUser):
# Inherits avatar, language, timezone, gravatar support
# Add project-specific fields
stripe_customer = models.ForeignKey(...)
Chat (lightwave.chat)
Base models for AI chat sessions.
from lightwave.chat import BaseChatSession, BaseChatMessage, ChatTypes, MessageTypes
class Chat(BaseChatSession):
agent_type = models.CharField(...)
class ChatMessage(BaseChatMessage):
chat = models.ForeignKey(Chat, on_delete=models.CASCADE, related_name="messages")
Development
Setup
-
Install dependencies:
uv pip install -e ".[dev]"
-
Install pre-commit hooks:
pre-commit installThis ensures code is automatically formatted and checked before each commit.
Running Tests
uv run pytest
Optional Dependencies
billing: Stripe utilities via dj-stripe (uv pip install lightwave-core[billing])dev: Testing utilities (uv pip install lightwave-core[dev])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lightwave_core-0.3.2.tar.gz.
File metadata
- Download URL: lightwave_core-0.3.2.tar.gz
- Upload date:
- Size: 53.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773c706db67b6e226b80a3755fef0035babad4e0f032466a5171d503710ca601
|
|
| MD5 |
0ecdcbc057d59137cce2d5556fbf7cfa
|
|
| BLAKE2b-256 |
e00e6649bc3e67f8d8707fe5d59d3a718d18352d40715e0eabeb39b371afe885
|
File details
Details for the file lightwave_core-0.3.2-py3-none-any.whl.
File metadata
- Download URL: lightwave_core-0.3.2-py3-none-any.whl
- Upload date:
- Size: 74.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8c42304974b73689d012a0d38d595ce3ce02dd2c4f3fa65abd9b60926a4d897
|
|
| MD5 |
dcf5722af63ea709d2ea5d076b088e7c
|
|
| BLAKE2b-256 |
298794211ffb5e04ace848b27f8e18f645299f0d68bae99591d01dd1e71f644f
|