oxutils 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oxutils-0.1.2 → oxutils-0.1.3}/PKG-INFO +15 -3
- {oxutils-0.1.2 → oxutils-0.1.3}/README.md +14 -2
- {oxutils-0.1.2 → oxutils-0.1.3}/pyproject.toml +1 -1
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/__init__.py +1 -1
- oxutils-0.1.3/src/oxutils/context/site_name_processor.py +11 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/functions.py +5 -2
- oxutils-0.1.3/src/oxutils/s3/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/settings.py +2 -0
- oxutils-0.1.2/src/oxutils/locale/fr/LC_MESSAGES/django.mo +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/apps.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/apps.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/export.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/masks.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/migrations/0001_initial.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/migrations/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/models.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/audit/settings.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/celery/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/celery/base.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/celery/settings.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/conf.py +0 -0
- {oxutils-0.1.2/src/oxutils/jwt → oxutils-0.1.3/src/oxutils/context}/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/enums/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/enums/audit.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/enums/invoices.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/exceptions.py +0 -0
- {oxutils-0.1.2/src/oxutils/logger → oxutils-0.1.3/src/oxutils/jwt}/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/jwt/auth.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/jwt/client.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/jwt/constants.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/locale/fr/LC_MESSAGES/django.po +0 -0
- {oxutils-0.1.2/src/oxutils/mixins → oxutils-0.1.3/src/oxutils/logger}/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/logger/receivers.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/logger/settings.py +0 -0
- {oxutils-0.1.2/src/oxutils/s3 → oxutils-0.1.3/src/oxutils/mixins}/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/mixins/base.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/mixins/schemas.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/mixins/services.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/models/__init__.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/models/base.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/models/billing.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/models/invoice.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/py.typed +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/s3/settings.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/s3/storages.py +0 -0
- {oxutils-0.1.2 → oxutils-0.1.3}/src/oxutils/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oxutils
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Production-ready utilities for Django applications in the Oxiliere ecosystem
|
|
5
5
|
Keywords: django,utilities,jwt,s3,audit,logging,celery,structlog
|
|
6
6
|
Author: Edimedia Mutoke
|
|
@@ -47,7 +47,7 @@ Description-Content-Type: text/markdown
|
|
|
47
47
|
[](https://pypi.org/project/oxutils/)
|
|
48
48
|
[](https://www.python.org/)
|
|
49
49
|
[](https://www.djangoproject.com/)
|
|
50
|
-
[](tests/)
|
|
51
51
|
[](LICENSE)
|
|
52
52
|
[](https://github.com/astral-sh/ruff)
|
|
53
53
|
|
|
@@ -60,6 +60,7 @@ Description-Content-Type: text/markdown
|
|
|
60
60
|
- ⚙️ **Celery Integration** - Pre-configured task processing
|
|
61
61
|
- 🛠️ **Django Mixins** - UUID, timestamps, user tracking
|
|
62
62
|
- ⚡ **Custom Exceptions** - Standardized API errors
|
|
63
|
+
- 🎨 **Context Processors** - Site name and domain for templates
|
|
63
64
|
|
|
64
65
|
---
|
|
65
66
|
|
|
@@ -126,6 +127,17 @@ class Product(BaseModelMixin): # UUID + timestamps + is_active
|
|
|
126
127
|
# Custom Exceptions
|
|
127
128
|
from oxutils.exceptions import NotFoundException
|
|
128
129
|
raise NotFoundException(detail="User not found")
|
|
130
|
+
|
|
131
|
+
# Context Processors
|
|
132
|
+
# settings.py
|
|
133
|
+
TEMPLATES = [{
|
|
134
|
+
'OPTIONS': {
|
|
135
|
+
'context_processors': [
|
|
136
|
+
'oxutils.context.site_name_processor.site_name',
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
}]
|
|
140
|
+
# Now {{ site_name }} and {{ site_domain }} are available in templates
|
|
129
141
|
```
|
|
130
142
|
|
|
131
143
|
## Documentation
|
|
@@ -150,7 +162,7 @@ raise NotFoundException(detail="User not found")
|
|
|
150
162
|
git clone https://github.com/oxiliere/oxutils.git
|
|
151
163
|
cd oxutils
|
|
152
164
|
uv sync
|
|
153
|
-
uv run pytest #
|
|
165
|
+
uv run pytest # 145 tests
|
|
154
166
|
```
|
|
155
167
|
|
|
156
168
|
### Creating Migrations
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://pypi.org/project/oxutils/)
|
|
6
6
|
[](https://www.python.org/)
|
|
7
7
|
[](https://www.djangoproject.com/)
|
|
8
|
-
[](tests/)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://github.com/astral-sh/ruff)
|
|
11
11
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- ⚙️ **Celery Integration** - Pre-configured task processing
|
|
19
19
|
- 🛠️ **Django Mixins** - UUID, timestamps, user tracking
|
|
20
20
|
- ⚡ **Custom Exceptions** - Standardized API errors
|
|
21
|
+
- 🎨 **Context Processors** - Site name and domain for templates
|
|
21
22
|
|
|
22
23
|
---
|
|
23
24
|
|
|
@@ -84,6 +85,17 @@ class Product(BaseModelMixin): # UUID + timestamps + is_active
|
|
|
84
85
|
# Custom Exceptions
|
|
85
86
|
from oxutils.exceptions import NotFoundException
|
|
86
87
|
raise NotFoundException(detail="User not found")
|
|
88
|
+
|
|
89
|
+
# Context Processors
|
|
90
|
+
# settings.py
|
|
91
|
+
TEMPLATES = [{
|
|
92
|
+
'OPTIONS': {
|
|
93
|
+
'context_processors': [
|
|
94
|
+
'oxutils.context.site_name_processor.site_name',
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
}]
|
|
98
|
+
# Now {{ site_name }} and {{ site_domain }} are available in templates
|
|
87
99
|
```
|
|
88
100
|
|
|
89
101
|
## Documentation
|
|
@@ -108,7 +120,7 @@ raise NotFoundException(detail="User not found")
|
|
|
108
120
|
git clone https://github.com/oxiliere/oxutils.git
|
|
109
121
|
cd oxutils
|
|
110
122
|
uv sync
|
|
111
|
-
uv run pytest #
|
|
123
|
+
uv run pytest # 145 tests
|
|
112
124
|
```
|
|
113
125
|
|
|
114
126
|
### Creating Migrations
|
|
@@ -6,12 +6,15 @@ from ninja_extra.exceptions import ValidationError
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def get_absolute_url(url: str, request=None):
|
|
9
|
+
if url.startswith('http'):
|
|
10
|
+
return url
|
|
11
|
+
|
|
9
12
|
if request:
|
|
10
13
|
# Build absolute URL using request
|
|
11
14
|
return request.build_absolute_uri(url)
|
|
12
15
|
else:
|
|
13
|
-
# Fallback: build URL using
|
|
14
|
-
base_url = getattr(settings, '
|
|
16
|
+
# Fallback: build URL using SITE_DOMAIN and domain
|
|
17
|
+
base_url = getattr(settings, 'SITE_DOMAIN', 'http://localhost:8000')
|
|
15
18
|
return urljoin(base_url, url)
|
|
16
19
|
|
|
17
20
|
|
|
File without changes
|
|
@@ -21,6 +21,8 @@ class OxUtilsSettings(BaseSettings):
|
|
|
21
21
|
|
|
22
22
|
# Service
|
|
23
23
|
service_name: Optional[str] = 'Oxutils'
|
|
24
|
+
site_name: Optional[str] = 'Oxiliere'
|
|
25
|
+
site_domain: Optional[str] = 'oxiliere.com'
|
|
24
26
|
|
|
25
27
|
# Auth JWT Settings (JWT_SIGNING_KEY)
|
|
26
28
|
jwt_signing_key: Optional[str] = None
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|