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/ {
@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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
>
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
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:
>
>
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
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
>
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
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
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
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
>> 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
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,
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: "
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
>
>> > 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
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,
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
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
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.
>
>
> >
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
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,
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
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
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
> 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
44 matches
Mail list logo