Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Thank you so much for this project.

I have been trying to get Django to work with a Docker image for code-server from linuxserver.io. Everything works great so far except for static files. Code-server serves the Django app with a suffix /proxy/8000/. I have looked at the documentation and it says that code-server strips /proxy/ from the request path. This is true only for static files but is not ideal for the django development server. Static files are reachable when the suffix is added. I would really appreciate help setting up serving static files with a prefix /proxy/8000/ or any other suggestion

Many thanks!

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

You must be logged in to vote
2 replies
@mskaif
Comment options

Thank you for your time and help!

I was trying to run code-server on a local server from another local machine. I have tried all combinations of different settings including the ones you suggested but none worked for django.
I have managed to run the code-server on apache2, ubuntu and published it on my site as a subdomain. However, I am still working on forwarding/adding reverse proxy for the development server traffic to the subdomain 8000.example.com. I'll update you on this later on.

@rm76
Comment options

Adding FORCE_SCRIPT_NAME = "/proxy/8000/" in settings.py worked for me! Thanks!
I still haven't investigated whether it messes up when deploying to production, you might want to read up about it: https://docs.djangoproject.com/en/6.0/ref/settings/#force-script-name

Comment options

Anyone found a way to get Django working?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.