okay i know how to configure nginx - uwsgi - django. How is nginx aware of the directory where my app has been bundled
schinckel
Why? What do you need nginx to do?
CAPITANOOO has quit
mattmcc
Your app bundle ought to just be another static file.
birdbolt1
without react before, it was simply dealing with views in django. Now I am trying to get nginx to show a default react page, after having configured react in my django project
spithash_ joined the channel
I cant figure out why when nginx loads the index.html, it cant find the css and js file. I assumed it would make those requests through uwsgi
schinckel
You may need to configure nginx so it knows where to look for the static files (css, js and images)
birdbolt1
i went ahead and changed nginx's config to do just that ^
mattmcc
You might be making some relative path assumptions in your HTML.
birdbolt1
it doesnt show me any errors in the log about being unable to find the files now
i see no errors in nginx log when i load my page, but when i look in chrome dev tools to see why i'm getting a syntax error in my js file, i see that it has my html code
i checked my css file and it had my html code as well
How the hell are they getting overwritten?
schinckel
You probably don't want to hard code `/static/` in there. That makes some presumptions.
tdy has quit
You'll want to use the static files helpers.
rpkilby joined the channel
birdbolt1
is that a feature of django?
schinckel
It's possible that it's just that your nginx is serving HTML content at those paths.
Yes.
Leeds joined the channel
birdbolt1
well one thing i should note is that, my original nginx config had nothing for static files, since i assumed the requests were passed thru uwsgi to django. In my dev environment i changed the nginx config to serve static files from a full path in my dev environment, where they js and css files are stored
in docker however, nginx is in its own container
schinckel
You should use django's static file handling, and collectstatic can then collect static files from possibly various locations, pre-process them and store them in a place nginx knows to look for them.