Closed NewmanJ1987 closed 2 years ago
Ok I was able to figure it out.
If you want to preview the question you need to serve the files that are generated in your PREVIEW_PATH
.
For me the simplest way to do this was to use he builtin in server that comes with python.
These are the steps if anybody faces the same problem, these instruction assume you followed the steps here https://docs.numbas.org.uk/en/latest/server-installation/windows-local.html .
1) Execute this
cd .\static\
python -m http.server 8080
2) Go to you settings.py
and modify the field PREVIEW_URL
to
http://127.0.0.1:8080/previews/
.
You should be able to preview your questions after this.
Does it make sense to update the docs with this information ?
The django development server can serve these static files - you shouldn't need to run a separate server. Can you check the STATIC_URL
setting in numbas/settings.py
, and look at the Django documentation?
The STATIC_URL
setting is set to /static/
This is how my configs look like
STATIC_URL = '/static/'
STATIC_ROOT = 'static/'
...
GLOBAL_SETTINGS = {
'NUMBAS_PATH': '../numbas_runtime',
'PREVIEW_PATH': 'static/previews',
'PREVIEW_URL': 'http://127.0.0.1:8080/previews/',
There are some new instructions on setting up a development environment at https://docs.numbas.org.uk/en/latest/development/installation.html. The first_setup
script now sets more of the settings for you when you choose development mode, and we tested with a couple of Windows machines.
I followed the instruction from here. https://docs.numbas.org.uk/en/latest/server-installation/windows-local.html
I created a question looks like the questions is created.
But when I try to preview the question I have the following problem, did somebody face this issue before ?