ᅠ ᅠ
And where to find the request itself - I have no idea
ᅠ ᅠ
Not Found: /static/file/75847.mp4
Again, this is from the console
Muflone
Not Found: /static/file/75847.mp4
curl -I youwebsite/static/file/75847.mp4
ᅠ ᅠ
curl -I youwebsite/static/file/75847.mp4
Using the URLconf defined in json_site.urls, Django tried these URL patterns, in this order: admin/ post/ api/create_post/ [name='create_post'] api/get_views/ [name='get_views_api'] api/delete_posts/ [name='delete_posts_by_link'] The current path, static/file/75847.mp4, didn’t match any of these.
Muflone
Make sure to restart the web server
Muflone
Django must not receive at all those requests If Django is receiving them then nginx is passing the requests to it
ᅠ ᅠ
Django must not receive at all those requests If Django is receiving them then nginx is passing the requests to it
My project has an html template that: loads css, displays the sent html from the database, from it it also receives paths to files from static
Muflone
You could also delete your whole project, still nginx will serve them
Muflone
Restart the web server as a begin
ᅠ ᅠ
sudo systemctl restart nginx
ᅠ ᅠ
gunicorn json_site.wsgi:application --bind 127.0.0.1:8000
ᅠ ᅠ
Not Found: /static/css/styles.css
Muflone
What address are you requesting with the browser?
ᅠ ᅠ
domain.com/post/37372
Muflone
Domain with no ports?
ᅠ ᅠ
I used nginx to hide the ip of the server under the domain name, before this everything worked without nginx
Muflone
Domain with no ports?
Please answer the question
ᅠ ᅠ
Domain with no ports?
I don't understand
ᅠ ᅠ
port 8000
Muflone
I don't understand
domain:8000/ Or domain/ ?
ᅠ ᅠ
domain/
Muflone
Ok, then stop nginx and check if the application still answers
Muflone
Read the nginx logs I'm 99% sure nginx has no permissions to read files into /root
Muflone
Probably in /var/log
ᅠ ᅠ
Probably in /var/log
Did i find what you need from there?
Muflone
You need to read the nginx messages, in particular permission errors I have nothing to search
Muflone
The /root directory is for root user only nginx most probably is running with a different user, not authorized to dive into /root
ᅠ ᅠ
"location" directive is not allowed here in /etc/nginx/sites-enabled/django-app.conf:1
ᅠ ᅠ
errors log
Muflone
I'm running as root
I doubt nginx is using root
Muflone
errors log
What is that conf file?
ᅠ ᅠ
No more bugs
ᅠ ᅠ
What is that conf file?
It was an hour ago, I had already deleted that file
Muflone
Then what fixed?
ᅠ ᅠ
Then what fixed?
I just worked according to the instructions of chatgpt, then deleted that file because it didn't work
ᅠ ᅠ
Now there are only 3 errors about visiting the site while nginx is not running
Muflone
I don't get. What was that file? It was a previous error?
Muflone
Your paste had a different file name
ᅠ ᅠ
I don't get. What was that file? It was a previous error?
I added and deleted this file before I wrote here, don't pay attention to it
Muflone
Then what you changed now to fix ?
ᅠ ᅠ
We have been sitting on this problem for too long. Maybe it will be easier if I do everything as it was before, and in order to put the domain there are other ways without nginx?
ᅠ ᅠ
Then what you changed now to fix ?
nothing works, I'm already tired of sitting on it ..
Muflone
Oh ok, you wrote no more bugs
ᅠ ᅠ
Oh ok, you wrote no more bugs
Yes, nothing is written in the console except what I threw
Muflone
It's a permission error, move the files in /var/www
Muflone
And change location accordingly
ᅠ ᅠ
i need make collectstatic?
Muflone
You use collectstatic only once and then you move the files where nginx wants
ᅠ ᅠ
Because I repeat, static files are constantly added and I can't do a collectstatic all the time
ᅠ ᅠ
I think you're confusing static files with media
idk, i have only static/file - here media and static/css
Muflone
static files don't change, at all, never, so you collect them only when you change them Media root is used for files added/uploaded from the user
ᅠ ᅠ
Maybe all the same there are options for how to put a beautiful domain on the server without this tedious thing with nginx?
ᅠ ᅠ
static files don't change, at all, never, so you collect them only when you change them Media root is used for files added/uploaded from the user
I don't have this media root, I just use it as a static one, I don't need to do it for a long time, a regular site with a domain...
Muflone
Static and media files will have to be served from nginx, separate them from the application and move them in a folders accessible from nginx
Muflone
I don't have this media root, I just use it as a static one, I don't need to do it for a long time, a regular site with a domain...
You're confusing them. If you put your media files into static you can't delete them and collect them. Media files will not be collected
Maxim
I kind of found a solution without nginx
DEBUG=True is not a solution
Muflone
Django and gunicorn are not valid web servers
ᅠ ᅠ
Doragonsureiyā
Muflone
Lol
Maxim
i think solution
only if it's your own pet project
ᅠ ᅠ
so why not?
Muflone
It's not safe, it's not reliable, it has no performances, it carries a lot of risks, plus I bet you're running it as root
Maxim
so why not?
two arguments: performance and security
Muflone
so why not?
https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/#debug
ᅠ ᅠ
Thanks for the unsuccessful help, I'll try to start over
Muflone
move the static files, nginx cannot read from /root I told you thrice
ᅠ ᅠ
move the static files, nginx cannot read from /root I told you thrice
Yes, thanks, now I will restart the server and do everything from scratch without root