Add workaround for vitejs resolving font path
This commit is contained in:
parent
33b596c649
commit
5fda07a5c2
22
README.md
22
README.md
|
|
@ -89,25 +89,3 @@ npm install
|
||||||

|

|
||||||
|
|
||||||
#### Install the tailwind css Plugin from Jetbrains
|
#### Install the tailwind css Plugin from Jetbrains
|
||||||
|
|
||||||
|
|
||||||
## Wagtail API intro
|
|
||||||
|
|
||||||
get all pages:
|
|
||||||
|
|
||||||
http://localhost:8000/api/v2/pages/
|
|
||||||
|
|
||||||
get Analyse Circle (the one with the most demo data)
|
|
||||||
|
|
||||||
http://localhost:8000/api/v2/pages/?title=Analyse
|
|
||||||
|
|
||||||
|
|
||||||
Get Circles only
|
|
||||||
|
|
||||||
http://localhost:8000/api/v2/pages/?type=learnpath.Circle
|
|
||||||
|
|
||||||
Get All Contents from that circle:
|
|
||||||
|
|
||||||
http://localhost:8000/api/v2/pages/?child_of=11
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,12 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite App</title>
|
|
||||||
<link href="/static/fonts/BuenosAires/stylesheet.css" rel="stylesheet">
|
<!-- workaround for vitejs bundling -> reference https:// -->
|
||||||
|
<link href="https://vbv-lernwelt.control.iterativ.ch/static/fonts/BuenosAires/stylesheet.css" rel="stylesheet">
|
||||||
|
<!-- end workaround -->
|
||||||
|
|
||||||
|
<title>myVBV</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ defineProps(['learningSequence'])
|
||||||
>
|
>
|
||||||
<IconSmileyNeutral v-if="learningUnit.contents[0].type === 'self_evaluation'"/>
|
<IconSmileyNeutral v-if="learningUnit.contents[0].type === 'self_evaluation'"/>
|
||||||
<IconCheckboxUnchecked v-else/>
|
<IconCheckboxUnchecked v-else/>
|
||||||
<div>{{ learningUnit.title }}</div>
|
<div>{{ learningUnit.contents[0].type }}: {{ learningUnit.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="-mx-4 text-gray-500">
|
<hr class="-mx-4 text-gray-500">
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export default ({mode}) => {
|
||||||
// replacement: path.resolve(__dirname, './node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js')
|
// replacement: path.resolve(__dirname, './node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js')
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|
|
||||||
|
|
@ -462,7 +462,7 @@ CORS_URLS_REGEX = r"^/api/.*$"
|
||||||
# See more configuration options at https://drf-spectacular.readthedocs.io/en/latest/settings.html#settings
|
# See more configuration options at https://drf-spectacular.readthedocs.io/en/latest/settings.html#settings
|
||||||
SPECTACULAR_SETTINGS = {
|
SPECTACULAR_SETTINGS = {
|
||||||
"TITLE": "VBV Lernwelt API",
|
"TITLE": "VBV Lernwelt API",
|
||||||
"DESCRIPTION": "Documentation of API endpoiints of VBV Lernwelt",
|
"DESCRIPTION": "Documentation of API endpoints of VBV Lernwelt",
|
||||||
"VERSION": "1.0.0",
|
"VERSION": "1.0.0",
|
||||||
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
|
||||||
"SERVERS": [
|
"SERVERS": [
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.http import JsonResponse, HttpResponse, HttpResponseRedirect
|
from django.http import JsonResponse, HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from django.template import loader
|
||||||
from django.views.decorators.csrf import ensure_csrf_cookie
|
from django.views.decorators.csrf import ensure_csrf_cookie
|
||||||
from ratelimit.decorators import ratelimit
|
from ratelimit.decorators import ratelimit
|
||||||
from rest_framework import authentication
|
from rest_framework import authentication
|
||||||
|
|
@ -19,16 +21,20 @@ def vue_home(request):
|
||||||
if settings.IT_SERVE_VUE:
|
if settings.IT_SERVE_VUE:
|
||||||
try:
|
try:
|
||||||
res = requests.get(f'{settings.IT_SERVE_VUE_URL}{request.get_full_path()}')
|
res = requests.get(f'{settings.IT_SERVE_VUE_URL}{request.get_full_path()}')
|
||||||
|
content = res.text
|
||||||
|
content = content.replace('https://vbv-lernwelt.control.iterativ.ch/static/', '/static/')
|
||||||
headers = res.headers
|
headers = res.headers
|
||||||
content_type = headers.get('content-type', 'text/html')
|
content_type = headers.get('content-type', 'text/html')
|
||||||
return HttpResponse(res.text, content_type=content_type)
|
return HttpResponse(content, content_type=content_type)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return HttpResponse(
|
return HttpResponse(
|
||||||
f'Can not connect to vue dev server at {settings.IT_SERVE_VUE_URL}: {e}'
|
f'Can not connect to vue dev server at {settings.IT_SERVE_VUE_URL}: {e}'
|
||||||
)
|
)
|
||||||
|
|
||||||
# render index.html from `npm run build`
|
# render index.html from `npm run build`
|
||||||
return render(request, 'vue/index.html', {})
|
content = loader.render_to_string('vue/index.html', context={}, request=request)
|
||||||
|
content = content.replace('https://vbv-lernwelt.control.iterativ.ch/static/', '/static/')
|
||||||
|
return HttpResponse(content)
|
||||||
|
|
||||||
|
|
||||||
def permission_denied_view(request, exception):
|
def permission_denied_view(request, exception):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue