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

Re: Serving static files

2016-06-28 Thread Ankush Thakur
Hmmm. One argument I read supporting separate servers is that it would save the main server a few socket connections. But this appears to be too little of a gain. The approach of using a CDN, I think, is much more sensible. Thanks once again, Tim! Regards, Ankush Thakur On Wed, Jun 29, 2016 at

Re: Serving static files

2016-06-28 Thread Tim Graham
The concerns about needing a separate server are likely overblown. In particular, Whitenoise is a popular solution for static file serving using Python. See its FAQ: http://whitenoise.evans.io/en/stable/#isn-t-serving-static-files-from-python-horribly-inefficient On Tuesday, June 28, 2016 at 9:

Re: Serving static files

2016-06-28 Thread Ankush Thakur
Thanks but I'm afraid I wasn't able to grasp the point of that article. Could you break it down for me, please? ~~Ankush On Monday, June 27, 2016 at 10:07:43 PM UTC+5:30, ludovic coues wrote: > > It's not that the framework will come to an halt. It's that a server > serving static file directl

Re: Serving static files

2016-06-27 Thread ludovic coues
It's not that the framework will come to an halt. It's that a server serving static file directly would be an order of magnitude faster. https://unix4lyfe.org/time/hn.html is a nice article on how server react to heavy load when serving static file. 2016-06-27 18:26 GMT+02:00 Ankush Thakur : > I

Re: Serving static files and media in Django 1.7.1

2015-01-06 Thread Sithembewena Lloyd Dube
Thanks @Vijay! Can't believe that caught me out like that. Regards, Sithu On Wed, Jan 7, 2015 at 1:34 AM, Vijay Khemlani wrote: > the static tag should be > > {% static 'mainsite/bootstrap.css' %} > > according to the layout you said > > On Tue, Jan 6, 2015 at 8:30 PM, Sithembewena Lloyd Dube

Re: Serving static files and media in Django 1.7.1

2015-01-06 Thread Vijay Khemlani
the static tag should be {% static 'mainsite/bootstrap.css' %} according to the layout you said On Tue, Jan 6, 2015 at 8:30 PM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a Django 1.7.1 project structured as per documentation. In it, I > have an app called "mainsite". In mainsite

Re: Serving static files (admin panel and others)

2014-12-13 Thread Muhammed Tüfekyapan
I find the problem. Problem was the file dir nginx looking for static file is different than I used for static file. I changed the files location and it solved. Thanks for response. On Sunday, December 14, 2014 4:31:49 AM UTC+2, Florian Schweikert wrote: > > On 14/12/14 00:55, Muhammed Tüfe

Re: Serving static files (admin panel and others)

2014-12-13 Thread Florian Schweikert
On 14/12/14 00:55, Muhammed Tüfekyapan wrote: > I try many things to serve .css files but I can't do that. How can i > serve .css and .js files in Django 1.7? > > > I typed django manage.py collectstatic but still my admin panel don't > load css. > > What can i do? did you follow the howto in t

Re: Serving static files from another directory rather than "statics"

2014-07-08 Thread mulianto
Hi, Why not generate the new file under static folder. I use compressor but for big js css need time for generate the compress minify file when on production. Sent from my iPhone On 8 Jul 2014, at 10:35, carlos wrote: > Hi, maybe you need use this third party solution > http://django-comp

Re: Serving static files from another directory rather than "statics"

2014-07-07 Thread Chen Xu
django-pipline looks good for me at first, and then I realize it copies both the minified files and the original files (which I dont want). That is why I wrote my own scripts. Thanks On Mon, Jul 7, 2014 at 10:35 PM, carlos wrote: > Hi, maybe you need use this third party solution > http://dja

Re: Serving static files from another directory rather than "statics"

2014-07-07 Thread carlos
Hi, maybe you need use this third party solution http://django-compressor.readthedocs.org/en/latest/ and other is https://django-pipeline.readthedocs.org/en/latest/ Cheers On Mon, Jul 7, 2014 at 5:58 PM, Chen Xu wrote: > Hi Everyone, > I am working on a site, under my project in my local envi

Re: Serving static files: Tried 3 ways with no luck

2012-12-27 Thread Jani Tiainen
27.12.2012 5:03, warsam...@gmail.com kirjoitti: I am having an unbelievable time getting my new django application to servie static files, i have read the django documentation but it seems as there isn't one consistent way to serve static files while in development using the Django server. In or

Re: Serving static files: Tried 3 ways with no luck

2012-12-27 Thread Dylan Tuominen
Yes make sure your STATICFILES_DIRS setting is pointing to the exact location you want to put them in, and then make sure all of the needed files are indeed being collected by manage.py collectstatic. after that, assuming your static_url is set to /static/, you should have no problems referenci

Re: Serving static files: Tried 3 ways with no luck

2012-12-26 Thread Mike Dewhirst
On 27/12/2012 2:03pm, warsam...@gmail.com wrote: I am having an unbelievable time getting my new django application to servie static files, i have read the django documentation but it seems as there isn't one consistent way to serve static files while in development using the Django server. In o

Re: Serving static files weirdness

2011-07-08 Thread neridaj
Got it working by changing the following: STATIC_ROOT = '' STATIC_URL = '/static/' STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/ static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths.

Re: Serving static files weirdness

2011-07-08 Thread neridaj
I'm using Django version 1.3 and the Django devserver. My admin media is the default: ADMIN_MEDIA_PREFIX = '/static/admin/' On Jul 8, 1:49 am, bruno desthuilliers wrote: > On Jul 8, 4:40 am, neridaj wrote: > > > > > > > > > > > I had mystaticfiles being served form media i.e., the tree looked >

Re: Serving static files weirdness

2011-07-08 Thread bruno desthuilliers
On Jul 8, 4:40 am, neridaj wrote: > I had my static files being served form media i.e., the tree looked > like this: > > media/ > /css > /js > /images > > with this in my url conf: > if settings.SERVE_MEDIA_FROM_DJANGO: >     urlpatterns += patterns('', >     (r'^media/(?P.*)$', 'django.views.stat

Re: Serving static files weirdness

2011-07-07 Thread Xavier Ordoquy
Hi, If you want help, you'll need to provide more information. What django version, what env (wsgi, devserver), what's your admin media and so on. Regards, Xavier. Le 8 juil. 2011 à 04:40, neridaj a écrit : > I had my static files being served form media i.e., the tree looked > like this: > >

Re: serving static files

2011-02-26 Thread Andre Terra
Are you sure you have that urlpattern in your project's urls.py rather than an app's urls.py? Regards, Andre On Sat, Feb 26, 2011 at 8:14 AM, wrote: > it should work, but it's not clear why you want that. (This regex also > match "notvalidsite_media/image.jpg") > > What did you get ? > > Stefa

Re: serving static files

2011-02-26 Thread s . apostolico
it should work, but it's not clear why you want that. (This regex also match "notvalidsite_media/image.jpg") What did you get ? Stefano 2011/2/26 snippetmaker : > I admit that I am not so sure about how regular expressions work, I > need to spend some time on these. > > I was trying to follow >

Re: Serving static files from subdomain.

2010-01-17 Thread Malcolm Box
On Mon, Jan 18, 2010 at 12:41 AM, nameless wrote: > Thank you for tips. > Now I want that when an user upload an image ( through forms ), then > it will be saved in media.example.com. > This is the point that I don't understand :-\ > > Does the computer running Django have access to a directory w

Re: Serving static files from subdomain.

2010-01-17 Thread nameless
Thank you for tips. Now I want that when an user upload an image ( through forms ), then it will be saved in media.example.com. This is the point that I don't understand :-\ --- On Jan 18, 1:08 am, Malcolm Box wrote: > On Sat, Jan 16, 2010 at 3:20 PM, nameless wrote: > > I have a site

Re: Serving static files from subdomain.

2010-01-17 Thread Malcolm Box
On Sat, Jan 16, 2010 at 3:20 PM, nameless wrote: > I have a site developed with django at www.example.com > > I want that django insert/serve static files ( images, css, js, ect ) > in/from media.example.com. > > Are these files that Django is managing (e.g. via an upload), or just part of the ou

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-17 Thread Anthony
Sure thing: === # Django settings for my project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_em...@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Wayne Koorts
>> Also just another tip: it is a good idea to not use named colour >> values ("green" / "red" etc.) as each CSS rendering engine might >> interpret it differently.  For green you could use: "color: rgb(0, >> 255, 0);" and for red you could use: "color: rgb(255, 0, 0);". > > That is incorrect, the

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Les
You might post your settings.py as a help to other newbies On Apr 15, 7:21 pm, Anthony wrote: > Thanks. > > I was just trying to get the stylesheet to show up.  I have a full CSS > template I got from somewhere else that I'll be using now that it's > being successfully pulled in. > > On Apr 15,

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Tom Evans
On Thu, 2009-04-16 at 11:06 +1200, Wayne Koorts wrote: > Also just another tip: it is a good idea to not use named colour > values ("green" / "red" etc.) as each CSS rendering engine might > interpret it differently. For green you could use: "color: rgb(0, > 255, 0);" and for red you could use: "

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Anthony
Thanks. I was just trying to get the stylesheet to show up. I have a full CSS template I got from somewhere else that I'll be using now that it's being successfully pulled in. On Apr 15, 4:06 pm, Wayne Koorts wrote: > >> > The picture shows up, but the text doesn't turn green like I think it >

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Wayne Koorts
>> > The picture shows up, but the text doesn't turn green like I think it >> > should. See if it helps changing your code and CSS as follows (basically making it XHTML compliant - not sure what you're aiming at specifically with what you've done): Test paragraph. p.baseline { co

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Anthony
That was it! Thanks, I thought "baseline" was just a variable name I could use. I appreciate your time on this. On Apr 15, 4:01 pm, Alex Gaynor wrote: > On Wed, Apr 15, 2009 at 6:59 PM, Anthony wrote: > > > Yes, they are right next to each other in the same folder. > > > On Apr 15, 3:55 pm,

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Alex Gaynor
On Wed, Apr 15, 2009 at 6:59 PM, Anthony wrote: > > Yes, they are right next to each other in the same folder. > > On Apr 15, 3:55 pm, Alex Gaynor wrote: > > On Wed, Apr 15, 2009 at 6:50 PM, Anthony wrote: > > > > > Hello, > > > > > I'm pretty new to CSS as well as Django, so I'm sure I'm doing

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Anthony
Yes, they are right next to each other in the same folder. On Apr 15, 3:55 pm, Alex Gaynor wrote: > On Wed, Apr 15, 2009 at 6:50 PM, Anthony wrote: > > > Hello, > > > I'm pretty new to CSS as well as Django, so I'm sure I'm doing > > something simple wrong.  Anyway, I'm able to serve up a test

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-15 Thread Alex Gaynor
On Wed, Apr 15, 2009 at 6:50 PM, Anthony wrote: > > Hello, > > I'm pretty new to CSS as well as Django, so I'm sure I'm doing > something simple wrong. Anyway, I'm able to serve up a test pic that > I placed in the media folder, but I can't get the html to use the CSS > template. > > > >

Re: serving static files

2009-04-13 Thread amit sethi
hi thanks , well got the point about url-conf the url pattern you have given does not raise the error but i have still not been able to get my css working my urls.py has an entry (r'^sitemedia/?P.*$', 'django.views.static.serve', {'document_root': '/home/amit/analytics/sitemedia', 'show_ind

Re: serving static files

2009-04-13 Thread google torp
Hi. You misunderstood the docs a bit, I c/p'ed the url-conf bit here: (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}), The problem here that is also causing the error is that the file name should be a variable and not hardcoded for every file,

Re: Serving static files?

2008-09-05 Thread Robert Dailey
On Sep 1, 1:32 am, Davor Lučić <[EMAIL PROTECTED]> wrote: > If you are using Apache you can use mod_rewrite. > > http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html > > On Aug 31, 10:08 pm, Robert <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I just got done reading through the 4 django tutorials a

Re: Serving static files?

2008-08-31 Thread Davor Lučić
If you are using Apache you can use mod_rewrite. http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html On Aug 31, 10:08 pm, Robert <[EMAIL PROTECTED]> wrote: > Hi, > > I just got done reading through the 4 django tutorials and they were > very helpful. However, I did not find out through the tut

Re: Serving static files?

2008-08-31 Thread djandrow
You may find this useful: http://groups.google.com/group/django-users/browse_thread/thread/73aae22ae6d20de0/dbfe3a60be00d9bb#dbfe3a60be00d9bb You should have apache serve the static content because its much faster. The link I sent you is when I was having problems with it a few weeks ago, basica

Re: serving static files with apache on windows with mod_python

2007-12-07 Thread Empty
> to the apache httpd.conf file > but when i turn off debug in the settings file as well as turning > PythonDebug Off in the httpd.conf, > my media files (css,images,...) disappear. > I have also done > > SetHandler None > > as well as > > SetHandler None > > I have read that my media files sh