Skip to content

Commit

Permalink
Merge branch 'main' into boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
hUwUtao authored Nov 22, 2024
2 parents 4b1ace0 + c40b377 commit dd1f59b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules\\typescript\\lib",
"python.analysis.typeCheckingMode": "basic"
}
7 changes: 7 additions & 0 deletions fuhoblog/err.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class TestException(Exception):
def __init__(self, message: str):
super().__init__(message)


def test_error_route(request):
raise TestException(message="Test error is invoked")
12 changes: 11 additions & 1 deletion fuhoblog/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
import os
from urllib.parse import urlparse

import sentry_sdk

if os.environ.get('SENTRY_DSN') is not None:
sentry_sdk.init(
dsn=os.environ.get('SENTRY_DSN'),
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
)

os.environ.setdefault('DJANGO_DEBUG', 'False')

DEBUG = False or (os.environ['DJANGO_DEBUG'] == 'True')
Expand All @@ -25,7 +35,7 @@
'USER': DATABASE_ENVIRON.username or 'root',
'PASSWORD': DATABASE_ENVIRON.password or '',
'HOST': DATABASE_ENVIRON.hostname or 'localhost',
'PORT': int(DATABASE_ENVIRON.port) or 3306,
'PORT': int(DATABASE_ENVIRON.port or 3306) or 3306,
},
}
else:
Expand Down
3 changes: 2 additions & 1 deletion fuhoblog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
from wagtail.documents import urls as wagtaildocs_urls

from .api import api_router

from .err import test_error_route

urlpatterns = [
path('django-admin/', admin.site.urls),
path('admin/', include(wagtailadmin_urls)),
path('documents/', include(wagtaildocs_urls)),
path('api/v2/', api_router.urls),
path('api/test/error/', test_error_route),
re_path(r'^', include(wagtail_urls)),
]

Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "@team-fuho/wt",
"version": "1.5.0",
"version": "1.4.0",
"description": "",
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"files": [
"/dist"
"/src"
],
"scripts": {
"fmt": "biome check --fix",
Expand All @@ -21,4 +20,4 @@
"typescript": "^5.4.5",
"vitest": "^1.6.0"
}
}
}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ elasticsearch==7.13.4
wagtail-localize==1.9
wagtail_modeladmin==2.0
python-dotenv
mysqlclient
mysqlclient
sentry-sdk[django]

0 comments on commit dd1f59b

Please sign in to comment.