1

I have created a website with Django, running locally in a linux virtual machine on ip adress 192.168.0.111:8000. Now I want to make this website available for the public, hosted on my own machine.

I have a webproxy (NginxProxyManager) running on my server on ip adress 192.168.0.118:7818 which handles all my other static websites.

I can route my domain name https://django.example.com to 192.168.0.111:8000 in my webproxy and everything works in DEBUG = True, but i know this is not the way to do it, and DEBUG = False does not serve static files properly.

How can i do this? All websites about this topic are takling about publishing to Heroku or something else, but i want to host it locally. Thank you!

Edit: I tried to serve static files from my webproxy like this and it worked fine

location /static/ {
    alias /config/static/; # local path on the webproxy server
}

but i'd really like to serve the files from the same computer that is hosting the Django website.

Fredrik Burmester
  • 237
  • 1
  • 4
  • 9
  • Are you saying that you want to serve static files with `DEBUG=False` and using the development server? – Lord Elrond Oct 19 '20 at 22:56
  • Does this answer your question? [Django Not Applying CSS File From App on 404 Page](https://stackoverflow.com/questions/63116823/django-not-applying-css-file-from-app-on-404-page) – Lord Elrond Oct 19 '20 at 23:03

0 Answers0