Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
The static files take the default project directory always. how do I change it?
Hi… I did the configuration of a Droplet in Digital Ocean with Django-1-click. I using a new directory or my proyect, at the same level as the example project “django_project” created by default. I change the new project location in the file: /etc/systemd/system/gunicorn.service and change the config file: /etc/ nginx/sites-available/default
And I run the command: python3 manage.py collectstatic
For Nginx to serve the Static and Media, but it does not do it well since it still takes the default configuration.
I can see that it is looking for them in the project path by default: /django/djangoproject/djangoproject/static, I moved the static ones and it worked because I did not get the style right, but I do not know where that route is taking to be able to change it!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×