Re: Serving static files in production

2023-04-27 Thread David Nugent
Don't think I ever used alias for this. You could try something like this (works for me - this is a cut and paste of an existing working config) though you may be a little more constrained with names of directories: server { [... elided] location / { location ~ /static/ {

Re: Serving static files in production

2023-04-26 Thread Brian Odhiambo
@Prosper, I installed whitenoise at some point, but later removed its configuration. On Thu, Apr 27, 2023 at 8:11 AM Prosper Lekia wrote: > Is whitenoise installed and added to MiddleWare? > > On Thu, Apr 27, 2023, 00:37 David Nugent wrote: > >> Ensure that nginx is correctly configured, since

Re: Serving static files in production

2023-04-26 Thread Brian Odhiambo
Thanks for your response @David. Here is my nginx configuration.[image: 1c9b64ec-c74f-4004-8b8d-9a6e7a3d8069.png] Pointed it to staticfiles after running collectstatic files command. On Thu, Apr 27, 2023 at 8:11 AM Prosper Lekia wrote: > Is whitenoise installed and added to MiddleWare? > > On Th

Re: Serving static files in production

2023-04-26 Thread Prosper Lekia
Is whitenoise installed and added to MiddleWare? On Thu, Apr 27, 2023, 00:37 David Nugent wrote: > Ensure that nginx is correctly configured, since from what you have > provided the django configuration looks correct (although I generally use > /static/ as STATIC_URL - with the leading / but sho

Re: Serving static files in production

2023-04-26 Thread David Nugent
Ensure that nginx is correctly configured, since from what you have provided the django configuration looks correct (although I generally use /static/ as STATIC_URL - with the leading / but should work as you have it). Check the nginx error log to try to discover the cause of the 404s. I suspect th

Serving static files in production

2023-04-26 Thread Brian Odhiambo
Hello everyone, I am deploying a django project to a dedicated server. I have set nginx to find static files in this file "staticfiles". This is the setting in settings.py file: STATIC_ROOT = BASE_DIR / 'staticfiles' STATIC_URL = 'static/' After running collectstatic command, my project can't st

Re: Static files in production [Was: How does WSGI work?]

2019-03-08 Thread Tal
Ok - maybe I'll try to get a hold of Grahame Dumpleton when I have some time. Thanks guys PS. Python frameworks like Flask or Django are good at making decisions about what response to return for a given request, and returning it. In most cases, that response is an HTML page, or json, or somet

Static files in production [Was: How does WSGI work?]

2019-03-07 Thread Mike Dewhirst
On 8/03/2019 11:54 am, Joel Mathew wrote: There's a mod_wsgi_express thread that Graham monitors, so he's sure to get feedback from there Understanding this better could help me solve static file blues. Most of the time I don't understand why my static files fine aren't served when I move to

Re: static files in production

2017-11-08 Thread Tony King
Ok, I've found a solution here which allows the serving of static files from within the project file folder structure as gathered by collectstatic. I now see that the FastCGI Handler required for

Re: static files in production

2017-11-08 Thread Tony King
> Thanks. The diagram clarified what I'd already thought to a degree, > although I'd gotten confused by the warning in the documentation for > STATIC_ROOT, which says > " This should be an initially empty destination directory for collecting your static files from their permanent locations

Re: static files in production

2017-11-07 Thread Antonis Christofides
Hello, You might find my drawings on how django static files work in production helpful. Unfortunately they are only for nginx and apache, but the same principles apply to IIS. Regards, Antonis Antonis Christo

Re: static files in production

2017-11-07 Thread Dylan Reinhold
In production django does not serve static files. You need to configure iis to serve the files directly from your STATIC_ROOT directory. Then from your project you run manage.py collectstatic . Django will collect up all the staic files and put them in STATIC_ROOT. Dylan On Nov 7, 2017 7:21 AM,

static files in production

2017-11-07 Thread Tony King
Hi again, I'm having to deploy my project using IIS 8.5 as this all I have access too and I've been relatively successful, however, my static image files are not displaying in the way they did in the development environment. I've tried adding what I believe to be the recommended settings but I

Re: Serve static files in production server

2013-01-02 Thread Stefano Tranquillini
On Sunday, December 30, 2012 6:01:24 PM UTC+1, Amirouche wrote: > > Héllo Stefano, > > On Sunday, December 30, 2012 1:27:12 PM UTC+1, Stefano Tranquillini wrote: >> >> Hi all. >> in the appfog ML we were fighting again the possibility to serve static >> file in django without using an external s

Re: Serve static files in production server

2012-12-30 Thread Amirouche
Héllo Stefano, On Sunday, December 30, 2012 1:27:12 PM UTC+1, Stefano Tranquillini wrote: > > Hi all. > in the appfog ML we were fighting again the possibility to serve static > file in django without using an external server. > So far AF does not provide a setup of the server to split the server