mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
move monkey patches to dedicated file
This commit is contained in:
parent
b5ad134264
commit
e97d779cd3
3 changed files with 21 additions and 4 deletions
|
@ -1,7 +1,4 @@
|
||||||
__package__ = 'archivebox'
|
__package__ = 'archivebox'
|
||||||
|
|
||||||
|
|
||||||
# monkey patch django timezone to add back utc (it was removed in Django 5.0)
|
from .monkey_patches import *
|
||||||
import datetime
|
|
||||||
from django.utils import timezone
|
|
||||||
timezone.utc = datetime.timezone.utc
|
|
||||||
|
|
|
@ -3,5 +3,9 @@ __package__ = 'archivebox.api'
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class APIConfig(AppConfig):
|
class APIConfig(AppConfig):
|
||||||
name = 'api'
|
name = 'api'
|
||||||
|
|
||||||
|
def ready(self):
|
||||||
|
pass
|
||||||
|
|
16
archivebox/monkey_patches.py
Normal file
16
archivebox/monkey_patches.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
__package__ = 'archivebox'
|
||||||
|
|
||||||
|
import django_stubs_ext
|
||||||
|
|
||||||
|
django_stubs_ext.monkeypatch()
|
||||||
|
|
||||||
|
|
||||||
|
# monkey patch django timezone to add back utc (it was removed in Django 5.0)
|
||||||
|
import datetime
|
||||||
|
from django.utils import timezone
|
||||||
|
timezone.utc = datetime.timezone.utc
|
||||||
|
|
||||||
|
|
||||||
|
# monkey patch django-signals-webhooks to change how it shows up in Admin UI
|
||||||
|
# from signal_webhooks.apps import DjangoSignalWebhooksConfig
|
||||||
|
# DjangoSignalWebhooksConfig.verbose_name = 'API'
|
Loading…
Reference in a new issue