Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling not found #118

Closed
gjelsas opened this issue Jan 19, 2021 · 5 comments
Closed

Styling not found #118

gjelsas opened this issue Jan 19, 2021 · 5 comments
Assignees
Labels

Comments

@gjelsas
Copy link

gjelsas commented Jan 19, 2021

I'm currently running the survey in a docker container behind a letsencrypt nginx proxy. Ssl works and the text is displayed. Whats missing is the styling of the website: spacing, the admin-panel, I guess all things css related... Any clues on that? Am I missing some setting?
I think this error is to blame: "GET /static/survey/js/jquery.min.js HTTP/2.0" 404 2470 "
Thanks for the work!

@Pierre-Sassoulas
Copy link
Owner

It definitely sound like something to do with static files not accessible. Maybe not deployed properly with the command to collect them, or something to do with the server configuration not being able to access the directory. I was using apache myself, but nginx probably need some configuration too ?

By the way I never used this project inside a docker, if you can contribute the generic part of the one you did for #62 that would be much appreciated ! :)

@gjelsas
Copy link
Author

gjelsas commented Jan 21, 2021

So, my mistake was not giving proper instructions to the nginx reverse proxy docker container. I fixed that by adding


 location /static/ {
         alias /static/;
     }
 

to the corresponding vhost-config file and mounting a folder containing the static files to /static in that nginx proxy container.

Just a misconception on my behalf. Maybe it helps someone...

@gjelsas gjelsas closed this as completed Jan 21, 2021
@gjelsas
Copy link
Author

gjelsas commented Jan 22, 2021

for the admin-css stuff I had to copy /usr/local/lib/python3.7/dist-packages/django/contrib/admin/static/ to that static folder mentioned above for the admin site...

@Pierre-Sassoulas
Copy link
Owner

I owuld have thougth collectstatic would do that for you ? (https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#collectstatic)

@gjelsas
Copy link
Author

gjelsas commented Jan 22, 2021

No it didn't. Actually I extracted it from the container and copied it to the folder which gets mounted to the nginx-proxy container. I know, not a very clean approach, but does the job...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants