Add workaround for vitejs resolving font path

This commit is contained in:
Daniel Egger 2022-06-05 19:53:22 +02:00
parent 33b596c649
commit 5fda07a5c2
6 changed files with 17 additions and 29 deletions

View File

@ -89,25 +89,3 @@ npm install
![](docs/envfile_plugin_settings.png)
#### 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

View File

@ -4,8 +4,12 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<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>
<body>
<div id="app"></div>

View File

@ -33,7 +33,7 @@ defineProps(['learningSequence'])
>
<IconSmileyNeutral v-if="learningUnit.contents[0].type === 'self_evaluation'"/>
<IconCheckboxUnchecked v-else/>
<div>{{ learningUnit.title }}</div>
<div>{{ learningUnit.contents[0].type }}: {{ learningUnit.title }}</div>
</div>
<hr class="-mx-4 text-gray-500">

View File

@ -23,7 +23,7 @@ export default ({mode}) => {
// replacement: path.resolve(__dirname, './node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js')
// }
// ]
})
}),
],
resolve: {
alias: {

View File

@ -462,7 +462,7 @@ CORS_URLS_REGEX = r"^/api/.*$"
# See more configuration options at https://drf-spectacular.readthedocs.io/en/latest/settings.html#settings
SPECTACULAR_SETTINGS = {
"TITLE": "VBV Lernwelt API",
"DESCRIPTION": "Documentation of API endpoiints of VBV Lernwelt",
"DESCRIPTION": "Documentation of API endpoints of VBV Lernwelt",
"VERSION": "1.0.0",
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
"SERVERS": [

View File

@ -1,9 +1,11 @@
# Create your views here.
import requests
from django.conf import settings
from django.core.management import call_command
from django.http import JsonResponse, HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.template import loader
from django.views.decorators.csrf import ensure_csrf_cookie
from ratelimit.decorators import ratelimit
from rest_framework import authentication
@ -19,16 +21,20 @@ def vue_home(request):
if settings.IT_SERVE_VUE:
try:
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
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:
return HttpResponse(
f'Can not connect to vue dev server at {settings.IT_SERVE_VUE_URL}: {e}'
)
# 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):