Serving static files with whitenoise

2024-05-13 Thread Richlue King
Hi, I'm trying to upload my project to render.com and I need to set up the 
static files with whitenoise. However, when I run collectstatic, I keep 
encountering this error:

Post-processing 'assets\css\bootstrap.min.css' failed!

raise ValueError(
ValueError: The file 'assets/css/bootstrap.min.css.map' could not be found 
with 
Could somebody please help me with this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75882c41-d554-462a-96f5-d853bc3125a1n%40googlegroups.com.


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/ {
sendfileon;
tcp_nopush  on;
root/srv/approot;
}

location / {
proxy_set_headerHost $http_host;
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_headerX-Forwarded-Proto $scheme;
proxy_redirect  off;
proxy_pass  http://;
}
}
[... elided]
}

Note that files being served are contained in the actual directory
/srv/approot/static, and you can serve media here also from the "media" dir
using

location ~ /(media|static)/ { ...

HTH, David

On Thu, Apr 27, 2023 at 3:42 PM Brian Odhiambo 
wrote:

> 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 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 should work as you have
>>> it). Check the nginx error log to try to discover the cause of the 404s. I
>>> suspect that the location blocks are defined in the wrong order or the
>>> directory pointing to the incorrect location.
>>>
>>> In any case, whitenoise is not a bad solution tbh, and very flexible
>>> besides. I would solve the above - which should work - before investigating
>>> that further.
>>>
>>> Regards,
>>> David
>>>
>>> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo <
>>> brianodhiambo...@gmail.com> wrote:
>>>
 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 still load the
 static files.
 Could I get a general way of going about this, without having to rely
 on a third party library like whitenoise?

 My appreciation in advance.

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPjQKqZcbd8nPu-2cLAER_nGZnPtm%2BBbEXRDvFTtb-ZG40Bo5w%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
T

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 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 that the location blocks are defined in the wrong order or the
>> directory pointing to the incorrect location.
>>
>> In any case, whitenoise is not a bad solution tbh, and very flexible
>> besides. I would solve the above - which should work - before investigating
>> that further.
>>
>> Regards,
>> David
>>
>> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo <
>> brianodhiambo...@gmail.com> wrote:
>>
>>> 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 still load the
>>> static files.
>>> Could I get a general way of going about this, without having to rely on
>>> a third party library like whitenoise?
>>>
>>> My appreciation in advance.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjQKqaN8dHhw7OoYsBCXxycKo7qgAFkAWHT0o%3DRYMvauPL%3DtA%40mail.gmail.com.


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 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 should work as you have
>> it). Check the nginx error log to try to discover the cause of the 404s. I
>> suspect that the location blocks are defined in the wrong order or the
>> directory pointing to the incorrect location.
>>
>> In any case, whitenoise is not a bad solution tbh, and very flexible
>> besides. I would solve the above - which should work - before investigating
>> that further.
>>
>> Regards,
>> David
>>
>> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo <
>> brianodhiambo...@gmail.com> wrote:
>>
>>> 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 still load the
>>> static files.
>>> Could I get a general way of going about this, without having to rely on
>>> a third party library like whitenoise?
>>>
>>> My appreciation in advance.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjQKqZcbd8nPu-2cLAER_nGZnPtm%2BBbEXRDvFTtb-ZG40Bo5w%40mail.gmail.com.


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 should work as you have
> it). Check the nginx error log to try to discover the cause of the 404s. I
> suspect that the location blocks are defined in the wrong order or the
> directory pointing to the incorrect location.
>
> In any case, whitenoise is not a bad solution tbh, and very flexible
> besides. I would solve the above - which should work - before investigating
> that further.
>
> Regards,
> David
>
> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo 
> wrote:
>
>> 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 still load the
>> static files.
>> Could I get a general way of going about this, without having to rely on
>> a third party library like whitenoise?
>>
>> My appreciation in advance.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com.


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 that the location blocks are defined in the wrong order or the
directory pointing to the incorrect location.

In any case, whitenoise is not a bad solution tbh, and very flexible
besides. I would solve the above - which should work - before investigating
that further.

Regards,
David

On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo 
wrote:

> 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 still load the
> static files.
> Could I get a general way of going about this, without having to rely on a
> third party library like whitenoise?
>
> My appreciation in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com.


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 still load the static 
files.
Could I get a general way of going about this, without having to rely on a 
third party library like whitenoise?

My appreciation in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com.


403 serving static files

2020-05-24 Thread みやうち`
Hi,

I'm trying to serve static files using nginx, but nginx gives following 
error.
- [error] 8202#8202: *10 open() "/home/user/myproject/media/xxx.jpg" failed 
(13: Permission denied)

I've tried giving all users permission to this directory and it didn't 
change.
What is the cause?

I'm using mod_wsgi 4.7.1 and apache 2.4.
my apache setting is here.

WSGIPythonHome /home/user/mypythonenv
WSGIScriptAlias / /home/user/myproject/myproject/wsgi.py
WSGIPythonPath 
/home/user/myproject/myproject:/home/user/mypythonenv/lib/python3.6/site-packages
WSGIApplicationGroup %{GLOBAL}


 
  Require all granted
 


Alias /static/ /home/user/myproject/collected_static/

 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted


Alias /media/ /home/user/myproject/media/

 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23624e5b-2701-45fb-9672-c179cb979403%40googlegroups.com.


Re: Django not serving static files with even after collectstatic

2017-07-02 Thread Antonis Christofides
Hello,

Take a look at
https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/
and if you still have problems show us the related nginx or apache 
configuration.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 2017-07-03 02:25, Dennis Gathagu wrote:
>
> i'm having problems with django static files in production.I know django
> requires that you collectstatic during deployment, which i did. The real
> problem comes when i try to access my page on the browser and i get a 403
> forbidden error on all static files. I tried changing my permissions and
> ownership of var/www/html folders to 755 and files to 644 but still no luck.
> How do i make my static files load?
>
>
> 
>
>
> please advise me on what to do, i have been struggling with this problem for
> days now.
>
> thanks in advance, Dennis
>
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5ecd31a9-e135-4558-8b8b-1754308cfa35%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b869f85f-d788-c7ef-3e2f-766f9dd96bd2%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django not serving static files with even after collectstatic

2017-07-02 Thread Dylan Reinhold
django does not (should not) serve your static files.
You want your web server to serve up those files, so you dont have the
overheard of url routing for files that don't need to run any python code
to display.

Dylan

On Sun, Jul 2, 2017 at 4:25 PM, Dennis Gathagu 
wrote:

> i'm having problems with django static files in production.I know django
> requires that you collectstatic during deployment, which i did. The real
> problem comes when i try to access my page on the browser and i get a 403
> forbidden error on all static files. I tried changing my permissions and
> ownership of var/www/html folders to 755 and files to 644 but still no
> luck. How do i make my static files load?
>
>
>
> 
>
>
> please advise me on what to do, i have been struggling with this problem
> for days now.
>
> thanks in advance, Dennis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/5ecd31a9-e135-4558-8b8b-1754308cfa35%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHtg44DZph%2BeotKnenLVSKABv4E0gmAX%2B7VkCJhEA6cE6HZOiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django not serving static files with even after collectstatic

2017-07-02 Thread Dennis Gathagu


i'm having problems with django static files in production.I know django 
requires that you collectstatic during deployment, which i did. The real 
problem comes when i try to access my page on the browser and i get a 403 
forbidden error on all static files. I tried changing my permissions and 
ownership of var/www/html folders to 755 and files to 644 but still no 
luck. How do i make my static files load?





please advise me on what to do, i have been struggling with this problem 
for days now.

thanks in advance, Dennis

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ecd31a9-e135-4558-8b8b-1754308cfa35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 7:33 AM, Tim Graham  wrote:

> 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:59:26 PM UTC-4, Ankush Thakur wrote:
>>
>> 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 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 keep hearing in the docs and in tutorials that frameworks are
>>> horrible
>>> > when it comes to service static files. In production, also, one needs
>>> to set
>>> > up another dedicated server to serve static files.
>>> >
>>> > I'm wondering why. What is so special about serving static files that
>>> a
>>> > framework comes to a halt, even though the same framework can happily
>>> serve
>>> > thousands of requests per hour?
>>> >
>>> > Regards,
>>> > Ankush Thakur
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> > email to django-users...@googlegroups.com.
>>> > To post to this group, send email to django...@googlegroups.com.
>>> > Visit this group at https://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/CALX%3DrKLw_nMxZz7xeC0N%3D5Zwn0Q0eZnV_GFGkdwmP-%3DabtPMUQ%40mail.gmail.com.
>>>
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>>
>>> Cordialement, Coues Ludovic
>>> +336 148 743 42
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/U1Y52ad4lDM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c2f1699e-9bfc-43f4-a858-a54a256cec1d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c2f1699e-9bfc-43f4-a858-a54a256cec1d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALX%3DrKKR-40%2B%3DjssfSk6HEaTk3ibkKQqENDA6gQ2Acjzm2q3bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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:59:26 PM UTC-4, Ankush Thakur wrote:
>
> 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 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 keep hearing in the docs and in tutorials that frameworks are 
>> horrible 
>> > when it comes to service static files. In production, also, one needs 
>> to set 
>> > up another dedicated server to serve static files. 
>> > 
>> > I'm wondering why. What is so special about serving static files that a 
>> > framework comes to a halt, even though the same framework can happily 
>> serve 
>> > thousands of requests per hour? 
>> > 
>> > Regards, 
>> > Ankush Thakur 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Django users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to django-users...@googlegroups.com. 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > Visit this group at https://groups.google.com/group/django-users. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/django-users/CALX%3DrKLw_nMxZz7xeC0N%3D5Zwn0Q0eZnV_GFGkdwmP-%3DabtPMUQ%40mail.gmail.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>
>> -- 
>>
>> Cordialement, Coues Ludovic 
>> +336 148 743 42 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c2f1699e-9bfc-43f4-a858-a54a256cec1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 keep hearing in the docs and in tutorials that frameworks are horrible 
> > when it comes to service static files. In production, also, one needs to 
> set 
> > up another dedicated server to serve static files. 
> > 
> > I'm wondering why. What is so special about serving static files that a 
> > framework comes to a halt, even though the same framework can happily 
> serve 
> > thousands of requests per hour? 
> > 
> > Regards, 
> > Ankush Thakur 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/CALX%3DrKLw_nMxZz7xeC0N%3D5Zwn0Q0eZnV_GFGkdwmP-%3DabtPMUQ%40mail.gmail.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ee672fa-f6d8-4882-8420-ac57032e4904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 keep hearing in the docs and in tutorials that frameworks are horrible
> when it comes to service static files. In production, also, one needs to set
> up another dedicated server to serve static files.
>
> I'm wondering why. What is so special about serving static files that a
> framework comes to a halt, even though the same framework can happily serve
> thousands of requests per hour?
>
> Regards,
> Ankush Thakur
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALX%3DrKLw_nMxZz7xeC0N%3D5Zwn0Q0eZnV_GFGkdwmP-%3DabtPMUQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTaKCRLharU2e51qrWnENq5T_rxbefsSt3koFL6%3DbEB7ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Serving static files

2016-06-27 Thread Ankush Thakur
I keep hearing in the docs and in tutorials that frameworks are horrible
when it comes to service static files. In production, also, one needs to
set up another dedicated server to serve static files.

I'm wondering why. What is so special about serving static files that a
framework comes to a halt, even though the same framework can happily serve
thousands of requests per hour?

Regards,
Ankush Thakur

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALX%3DrKLw_nMxZz7xeC0N%3D5Zwn0Q0eZnV_GFGkdwmP-%3DabtPMUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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  > 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 have
>> templates/mainsite/index.html and static/mainsite/bootstrap.css. In the
>> index template, I use {% load staticfiles %} and then for css I have the
>> following link: > rel="stylesheet"> However, when I load the page in the browser, the css
>> does not load and when in "view source" mode, I click the link href
>> ("/static/css/bootstrap.css"). This generates a 404 error.
>>
>> What am I missing? Any suggestions welcome.
>>
>> P.S: I have the STATIC_URL = '/static/' setting defined in the settings
>> file.
>>
>> --
>> Regards,
>> Sithu Lloyd Dube
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAH-SnCBJamc9ZKzmy3y63fAo5n7p7xT6G8oAiu%3DFUbjM-KF%2Bbw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALn3ei1gt%2BKmk9zU%3DGRuR8DFxmYiwyQ_cF%2Ba9fMTgMk3Vg0nmA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCBeXSMWjKkr5WojN8%3DDSq3hn5%2B27jwqgEZvD65N_jeeOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, I have
> templates/mainsite/index.html and static/mainsite/bootstrap.css. In the
> index template, I use {% load staticfiles %} and then for css I have the
> following link:  rel="stylesheet"> However, when I load the page in the browser, the css
> does not load and when in "view source" mode, I click the link href
> ("/static/css/bootstrap.css"). This generates a 404 error.
>
> What am I missing? Any suggestions welcome.
>
> P.S: I have the STATIC_URL = '/static/' setting defined in the settings
> file.
>
> --
> Regards,
> Sithu Lloyd Dube
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAH-SnCBJamc9ZKzmy3y63fAo5n7p7xT6G8oAiu%3DFUbjM-KF%2Bbw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei1gt%2BKmk9zU%3DGRuR8DFxmYiwyQ_cF%2Ba9fMTgMk3Vg0nmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Serving static files and media in Django 1.7.1

2015-01-06 Thread Sithembewena Lloyd Dube
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 have
templates/mainsite/index.html and static/mainsite/bootstrap.css. In the
index template, I use {% load staticfiles %} and then for css I have the
following link:  However, when I load the page in the browser, the css
does not load and when in "view source" mode, I click the link href
("/static/css/bootstrap.css"). This generates a 404 error.

What am I missing? Any suggestions welcome.

P.S: I have the STATIC_URL = '/static/' setting defined in the settings
file.

-- 
Regards,
Sithu Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCBJamc9ZKzmy3y63fAo5n7p7xT6G8oAiu%3DFUbjM-KF%2Bbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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ü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 the documentation? 
>
> https://docs.djangoproject.com/en/1.7/howto/static-files/ 
>
> -- Florian 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1477ffe3-5d07-4556-b125-c6b5f2ad52f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 the documentation?

https://docs.djangoproject.com/en/1.7/howto/static-files/

-- Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/548CF669.4050907%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Serving static files (admin panel and others)

2014-12-13 Thread Muhammed Tüfekyapan
Hello everyone,


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?



Best.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9616735-fd97-40ef-8b39-976f2b4974c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django server and Apache serving static files

2014-12-09 Thread Collin Anderson
Hi,

There's a good Apache example here if you haven't seen it.

https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#serving-files

Collin

On Monday, December 8, 2014 9:32:07 AM UTC-5, pythonista wrote:
>
> My apache admin is having problems serving static files to the django app.
>
>
> Apache is on its own server.
>
> My admin says that he needs a relative path defined in Django in order to 
> get Apache to serve the static files from that server for the Django App
>
> Is it possible to define relative paths in the settings file to comply 
> with the requirements of Apache?
>
> And if it is possible can I still use the {%load staticfiles %}  variable.
>
> If this is possible, what would the relevant settings file entries be?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67b937d6-90b7-4d70-a720-f3e4db7d8953%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django server and Apache serving static files

2014-12-08 Thread pythonista
My apache admin is having problems serving static files to the django app.


Apache is on its own server.

My admin says that he needs a relative path defined in Django in order to 
get Apache to serve the static files from that server for the Django App

Is it possible to define relative paths in the settings file to comply with 
the requirements of Apache?

And if it is possible can I still use the {%load staticfiles %}  variable.

If this is possible, what would the relevant settings file entries be?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/899d46b4-1da9-4c88-9345-85e4f779d084%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question on serving static files from apache

2014-11-15 Thread Daniel Roseman
On Saturday, 15 November 2014 03:13:37 UTC, pythonista wrote:
>
> I am using django 1.7 and apache.
>
> I do not understand the instructions on the django tutorial.
>
> The files were delivered as expected in debug mode and locally from the 
> django web server.
>
>
> Can someone provide me with a simple example or link to a site.
>
> Thanks
>
>
The documentation is pretty extensive:

https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#serving-files
 
https://docs.djangoproject.com/en/1.7/howto/static-files/deployment/
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5c36b35-577e-4493-81cd-67d6d79fd87e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie question on serving static files from apache

2014-11-14 Thread pythonista
I am using django 1.7 and apache.

I do not understand the instructions on the django tutorial.

The files were delivered as expected in debug mode and locally from the 
django web server.


Can someone provide me with a simple example or link to a site.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d9f345b5-5473-4134-a588-6ceb155490a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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-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 environment, I have a 
>> directory called "static" (generated by django just like everyone else's) to 
>> server my js and css. I wrote a script which minify all the js and css files 
>> and copy them in a directory called "static_min" which is at the same level 
>> as "static". When I try to include my css and js files from "static_min", it 
>> show url not found. 
>> 
>> And I tried the followeing:
>> in my settings: I changed the STATICFILES_DIRS as the following:
>> 
>> STATIC_ROOT = sys.path[0]
>> 
>> STATICFILES_DIRS = (
>> os.path.join(STATIC_ROOT, 'static'),
>> os.path.join(STATIC_ROOT, 'static_min')
>> )
>> 
>> I thought doing this will make Django to look for file in both static and 
>> static_min, but it did not work.
>> 
>> 
>> Could someone help.
>> 
>> Thanks
>> 
>> 
>> 
>> 
>> 
>> -- 
>> ⚡ Chen Xu ⚡
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CACac-qZbMcM6%2Bqs9frw1gToBSvbgD2NSaFtdOFrDfxScX%3DiVmg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAM-7rO28fM3wZmYL85jCXECaiiYnOrHhVv8%3DZSfKVmLV5-ox_Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D80E3ACB-E88B-4467-B2B3-1B711A60B113%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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://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 environment, I have
>> a directory called "static" (generated by django just like everyone else's)
>> to server my js and css. I wrote a script which minify all the js and css
>> files and copy them in a directory called "static_min" which is at the same
>> level as "static". When I try to include my css and js files from
>> "static_min", it show url not found.
>>
>> And I tried the followeing:
>> in my settings: I changed the STATICFILES_DIRS as the following:
>>
>> STATIC_ROOT = sys.path[0]
>>
>> STATICFILES_DIRS = (
>> os.path.join(STATIC_ROOT, 'static'),
>> os.path.join(STATIC_ROOT, 'static_min')
>> )
>>
>> I thought doing this will make Django to look for file in both static and
>> static_min, but it did not work.
>>
>>
>> Could someone help.
>>
>> Thanks
>>
>>
>>
>>
>>
>> --
>> ⚡ Chen Xu ⚡
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACac-qZbMcM6%2Bqs9frw1gToBSvbgD2NSaFtdOFrDfxScX%3DiVmg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM-7rO28fM3wZmYL85jCXECaiiYnOrHhVv8%3DZSfKVmLV5-ox_Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
⚡ Chen Xu ⚡

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACac-qYQ_1t1vrOKtYBM3yZbsDcZ3NN5byVAvyYvkOd-jdavNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 environment, I have a
> directory called "static" (generated by django just like everyone else's)
> to server my js and css. I wrote a script which minify all the js and css
> files and copy them in a directory called "static_min" which is at the same
> level as "static". When I try to include my css and js files from
> "static_min", it show url not found.
>
> And I tried the followeing:
> in my settings: I changed the STATICFILES_DIRS as the following:
>
> STATIC_ROOT = sys.path[0]
>
> STATICFILES_DIRS = (
> os.path.join(STATIC_ROOT, 'static'),
> os.path.join(STATIC_ROOT, 'static_min')
> )
>
> I thought doing this will make Django to look for file in both static and
> static_min, but it did not work.
>
>
> Could someone help.
>
> Thanks
>
>
>
>
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACac-qZbMcM6%2Bqs9frw1gToBSvbgD2NSaFtdOFrDfxScX%3DiVmg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO28fM3wZmYL85jCXECaiiYnOrHhVv8%3DZSfKVmLV5-ox_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Serving static files from another directory rather than "statics"

2014-07-07 Thread Chen Xu
Hi Everyone,
I am working on a site, under my project in my local environment, I have a
directory called "static" (generated by django just like everyone else's)
to server my js and css. I wrote a script which minify all the js and css
files and copy them in a directory called "static_min" which is at the same
level as "static". When I try to include my css and js files from
"static_min", it show url not found.

And I tried the followeing:
in my settings: I changed the STATICFILES_DIRS as the following:

STATIC_ROOT = sys.path[0]

STATICFILES_DIRS = (
os.path.join(STATIC_ROOT, 'static'),
os.path.join(STATIC_ROOT, 'static_min')
)

I thought doing this will make Django to look for file in both static and
static_min, but it did not work.


Could someone help.

Thanks





-- 
⚡ Chen Xu ⚡

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACac-qZbMcM6%2Bqs9frw1gToBSvbgD2NSaFtdOFrDfxScX%3DiVmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Apache with mod_wsgi not serving static files

2014-02-21 Thread Alex Mandel
On 02/21/2014 04:00 PM, Bryan P wrote:
> Hello all,
> 
> My Django application is not serving my static files (CSS, JS) and keeps 
> returning a 404 error. I have set the STATIC_ROOT to the location where I 
> collected all my static files with manage.py and set an alias in my 
> VirtualHost. 
> 
> 
> Here is my Settings.py
> 
> Here is my VirtualHost file
> 
> Here is the 404 file
> 
> 
> 
> 
> and the url it's trying to retrieve them from i
> 
> fixtracker.com/static/BugFixTracker/main.css
> 
> 
> This is running in production with debug set to False, so it shouldn't be 
> relying on Django to distribute the files. Any help is much appreciated. 
> 

How are you referencing the static in your template? Looks like a
mismatch in path. BugFixTracker isn't in /static according to your vhost
file. So shouldn't the url be:

fixtracker.com/static/main.css

Thanks,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/530801F1.5090300%40wildintellect.com.
For more options, visit https://groups.google.com/groups/opt_out.


Apache with mod_wsgi not serving static files

2014-02-21 Thread Bryan P
Hello all,

My Django application is not serving my static files (CSS, JS) and keeps 
returning a 404 error. I have set the STATIC_ROOT to the location where I 
collected all my static files with manage.py and set an alias in my 
VirtualHost. 


Here is my Settings.py

Here is my VirtualHost file

Here is the 404 file




and the url it's trying to retrieve them from i

fixtracker.com/static/BugFixTracker/main.css


This is running in production with debug set to False, so it shouldn't be 
relying on Django to distribute the files. Any help is much appreciated. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1a06619-f388-4b7f-a687-36e4d2fcbd6f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 order are my settings.py file, my urls.py file and finally in my
base.html where i reference these files.


I have no idea why i still get 404 not found errors when the path is
full load as in when i reference in my base.html file {{ Media_Url}} it
actually resolves to /media/ yet the file is still not found.

If anyone can help, please let me know. i have spent way to long on this
small issue.


First STATIC_ROOT setting means location where collectstatic collects 
are your static files using finders. Usually you have two finders used, 
firstone is FileSystemFinder that uses STATICFILES_DIRS to find static 
files. Both settings must be absolute path(s).


Note that STATIC_ROOT is not needed for runserver

And second one is AppDirectoriesFinder that finds static files under 
static/ -folder of your apps (including admin app).


Both are analoguous to template-serving.

MEDIA_ROOT is meant for user uploaded content.

STATIC_URL then gives root URL where static files are served. In testing 
/static/ is good one, in production you might want to do some 
optimizations there.


Now you should be able to get it working.

--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 referencing them, just make sure that you include the directory 
name in the url as well(e.g. localhost:8000/static/styles/style.css). 

I usually setup my staticfiles_dirs to go into project/project/staticdump, 
just make sure you're letting django do all of the collection and you 
aren't placing files in STATIC_ROOT yourself.


On Wednesday, December 26, 2012 11:15:26 PM UTC-6, Mike Dewhirst wrote:
>
> On 27/12/2012 2:03pm, wars...@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 order are my settings.py file, my urls.py file and finally in my 
> > base.html where i reference these files. 
> > 
> > 
> > I have no idea why i still get 404 not found errors when the path is 
> > full load as in when i reference in my base.html file {{ Media_Url}} it 
> > actually resolves to /media/ yet the file is still not found. 
> > 
> > If anyone can help, please let me know. i have spent way to long on this 
> > small issue. 
>
> I remember I found it tricky in the beginning. The way I finally got my 
> head around it was to put print statements in my settings file (if DEBUG 
> of course) to output the paths for static and media dirs. Then I 
> experimented with settings.STATICFILES_FINDERS until I figured out 
> exactly what delivered the goods. 
>
> hth 
>
> Mike 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/django-users/-/r63T5ycQ81MJ. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DxKA3NjpkzUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 order are my settings.py file, my urls.py file and finally in my
base.html where i reference these files.


I have no idea why i still get 404 not found errors when the path is
full load as in when i reference in my base.html file {{ Media_Url}} it
actually resolves to /media/ yet the file is still not found.

If anyone can help, please let me know. i have spent way to long on this
small issue.


I remember I found it tricky in the beginning. The way I finally got my 
head around it was to put print statements in my settings file (if DEBUG 
of course) to output the paths for static and media dirs. Then I 
experimented with settings.STATICFILES_FINDERS until I figured out 
exactly what delivered the goods.


hth

Mike



--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/r63T5ycQ81MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serving static files: Tried 3 ways with no luck

2012-12-26 Thread warsameb0
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 order are my settings.py file, my urls.py file and finally in my 
base.html where i reference these files.


I have no idea why i still get 404 not found errors when the path is full 
load as in when i reference in my base.html file {{ Media_Url}} it actually 
resolves to /media/ yet the file is still not found.

If anyone can help, please let me know. i have spent way to long on this 
small issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/r63T5ycQ81MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Title: {% block title %}Taleebo{% endblock %}






# Django settings for Bixin_Taleebo project.
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'TaleeboBixin',  # Or path to database file if using sqlite3.
'USER': 'postgres',  # Not used with sqlite3.
'PASSWORD': 'f7!83pwu',  # Not used with sqlite3.
'HOST': 'localhost',  # Set to empty string for localhost. Not used with sqlite3.
'PORT': '5432',  # Set to empty string for default. Not used with sqlite3.
}
}

SITE_ROOT = '/'.join(os.path.dirname(__file__).split('/')[0:-2])

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = '%s/media/' % (SITE_ROOT)

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/media/";
MEDIA_URL = '/media/'

ADMIN_MEDIA_PREFIX = '/media/admin/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(SITE_ROOT, 'media/static/')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# Additional locations of static files
#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.
 #   os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'static'),
  #  )

# List of finder classes that know how to find static files in
# various locations.
#STATICFILES_FINDERS = (
#'django.contrib.staticfiles.finders.FileSystemFinder',
#'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
#)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '!^ztby2)y_(kc4#twtf1@x5xh1#kos$g)-*dc)nec(k9-wew$!'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.message

serving static files

2011-07-27 Thread Shawn Milochik

I want to allow certain users to download files uploaded by other users.

I found django-protected-files[1] and django-private-files[2], both of 
which look like they do the job. The latter is more recent and is on 
Read The Docs, so it's probably the way to go.


Before I start reviewing the code and implementing, does anyone have any 
suggestions? Is there a "top dog" for this need?


Thanks,
Shawn


[1] https://github.com/lincolnloop/django-protected-files
[2] https://bitbucket.org/vvangelovski/django-private-files/src

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.
os.path.join(PROJECT_ROOT, 'static'),
)

On Jul 8, 2:47 pm, neridaj  wrote:
> 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
> > > 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.static.serve',
> > > {'document_root': r'media'}),
> > >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > > { 'document_root': r'media/js/tiny_mc' }),
> > > )
>
> > > I then switched it to this:
>
> > >static/
> > > /css
> > > /js
> > > /images
>
> > > with this in my url conf:
> > > if settings.SERVE_MEDIA_FROM_DJANGO:
> > >     urlpatterns += patterns('',
> > >     (r'^static/(?P.*)$', 'django.views.static.serve',
> > > {'document_root': r'static'}),
> > >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > > { 'document_root': r'static/js/tiny_mc' }),
> > > )
>
> > > I don't understand why changing media tostatichas stopped django
> > > fromservingstaticfiles, any ideas?
>
> > settings.MEDIA_URL and MEDIA_ROOT ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> > 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.static.serve',
> > {'document_root': r'media'}),
> >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > { 'document_root': r'media/js/tiny_mc' }),
> > )
>
> > I then switched it to this:
>
> >static/
> > /css
> > /js
> > /images
>
> > with this in my url conf:
> > if settings.SERVE_MEDIA_FROM_DJANGO:
> >     urlpatterns += patterns('',
> >     (r'^static/(?P.*)$', 'django.views.static.serve',
> > {'document_root': r'static'}),
> >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > { 'document_root': r'static/js/tiny_mc' }),
> > )
>
> > I don't understand why changing media tostatichas stopped django
> > fromservingstaticfiles, any ideas?
>
> settings.MEDIA_URL and MEDIA_ROOT ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.static.serve',
> {'document_root': r'media'}),
>     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'media/js/tiny_mc' }),
> )
>
> I then switched it to this:
>
> static/
> /css
> /js
> /images
>
> with this in my url conf:
> if settings.SERVE_MEDIA_FROM_DJANGO:
>     urlpatterns += patterns('',
>     (r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': r'static'}),
>     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'static/js/tiny_mc' }),
> )
>
> I don't understand why changing media to static has stopped django
> from serving static files, any ideas?

settings.MEDIA_URL and MEDIA_ROOT ?




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:
> 
> media/
> /css
> /js
> /images
> 
> with this in my url conf:
> if settings.SERVE_MEDIA_FROM_DJANGO:
>urlpatterns += patterns('',
>(r'^media/(?P.*)$', 'django.views.static.serve',
> {'document_root': r'media'}),
>(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'media/js/tiny_mc' }),
> )
> 
> I then switched it to this:
> 
> static/
> /css
> /js
> /images
> 
> with this in my url conf:
> if settings.SERVE_MEDIA_FROM_DJANGO:
>urlpatterns += patterns('',
>(r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': r'static'}),
>(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'static/js/tiny_mc' }),
> )
> 
> I don't understand why changing media to static has stopped django
> from serving static files, any ideas?
> 
> Cheers,
> 
> J
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serving static files weirdness

2011-07-07 Thread neridaj
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.static.serve',
{'document_root': r'media'}),
(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
{ 'document_root': r'media/js/tiny_mc' }),
)

I then switched it to this:

static/
/css
/js
/images

with this in my url conf:
if settings.SERVE_MEDIA_FROM_DJANGO:
urlpatterns += patterns('',
(r'^static/(?P.*)$', 'django.views.static.serve',
{'document_root': r'static'}),
(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
{ 'document_root': r'static/js/tiny_mc' }),
)

I don't understand why changing media to static has stopped django
from serving static files, any ideas?

Cheers,

J

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 ?
>
> 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
> http://docs.djangoproject.com/en/1.2/howto/static-files/
> >
> > I did everything that the page said to no avail, in the end I changed
> >
> > (r'^site_media/(?P.*)$', 'django.views.static.serve',
> >{'document_root': '/path/to/media'}),
> >
> >
> > to
> >
> > (r'site_media/(?P.*)$', 'django.views.static.serve',
> >{'document_root': '/path/to/media'}),
> >
> > i mean i removed starting ^ in hope that the regular expression will
> > ignore if something is extra in the start and it worked.
> >
> > Can somebody explain to point to somewhere that explains?
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
> http://docs.djangoproject.com/en/1.2/howto/static-files/
>
> I did everything that the page said to no avail, in the end I changed
>
> (r'^site_media/(?P.*)$', 'django.views.static.serve',
>        {'document_root': '/path/to/media'}),
>
>
> to
>
> (r'site_media/(?P.*)$', 'django.views.static.serve',
>        {'document_root': '/path/to/media'}),
>
> i mean i removed starting ^ in hope that the regular expression will
> ignore if something is extra in the start and it worked.
>
> Can somebody explain to point to somewhere that explains?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



serving static files

2011-02-26 Thread 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 http://docs.djangoproject.com/en/1.2/howto/static-files/

I did everything that the page said to no avail, in the end I changed

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/path/to/media'}),


to

(r'site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/path/to/media'}),

i mean i removed starting ^ in hope that the regular expression will
ignore if something is extra in the start and it worked.

Can somebody explain to point to somewhere that explains?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problems with serving static files

2011-02-24 Thread Tom Evans
On Thu, Feb 24, 2011 at 1:39 AM, Roy Smith  wrote:
> I'm running r15624, OSX-10.6.5, Python-2.6.1
>
> In my top-level urls.py, I have:
>
>    # Serve static
> files
>    (r'^static/(?P.*)$',
>     'django.views.static.serve',
>     {'document_root': '/Users/roy/dev/try.django/mysite/static',
>      'show_indexes': True}),
>
> If I go to http://localhost:8000/static/, I see a listing of my only
> static file:
>
> Index of /
> site.css
>
> but when I click on the site.css link, I get a 404 ('site.css' could
> not be found).  Any ideas what might be going wrong?
>

I suspect it is trying to load
/Users/roy/dev/try.django/mysite/staticsite.css'. Try adding a '/' to
the end of your document root, or capturing the initial '/' as part of
the path in your urlconf.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problems with serving static files

2011-02-23 Thread Roy Smith
I'm running r15624, OSX-10.6.5, Python-2.6.1

In my top-level urls.py, I have:

# Serve static
files
(r'^static/(?P.*)$',
 'django.views.static.serve',
 {'document_root': '/Users/roy/dev/try.django/mysite/static',
  'show_indexes': True}),

If I go to http://localhost:8000/static/, I see a listing of my only
static file:

Index of /
site.css

but when I click on the site.css link, I get a 404 ('site.css' could
not be found).  Any ideas what might be going wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: App engine serving static files?

2011-02-16 Thread Eric Chamberlain

On Feb 15, 2011, at 11:44 PM, Praveen Krishna R wrote:

> Hey Guys,
> 
> Does Anyone has experience, serving static content with google app engine?
> Does it make a big difference, than serving it with nginx on the same server 
> as django?
> I currently use a shared hosting, and was just thinking to move the static 
> content to GAE
> I would like to know your thoughts on this

We serve our static content from Amazon S3, it's much easier to setup and use.

--
Eric Chamberlain, Founder
RF.com - http://RF.com/







-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: App engine serving static files?

2011-02-16 Thread rafael.nu...@gmail.com
The 'cold start' could be a problem. But if you pay $9/month to 'AlwaysOn'
feature, it's ok.
I am using without 'AlwaysOn', with a little 'workaround' and with an
agressive cache, it's very good.

On Wed, Feb 16, 2011 at 9:32 AM, Brian Bouterse  wrote:

> I've never used it, but I always wanted to use 
> DryDropto push all my static media over to GAE.
>
> Brian
>
>
> On Wed, Feb 16, 2011 at 2:44 AM, Praveen Krishna R <
> rpraveenkris...@gmail.com> wrote:
>
>> *Hey Guys,*
>> *
>> *
>> *Does Anyone has experience, serving static content with google app
>> engine?*
>> *Does it make a big difference, than serving it with nginx on the same
>> server as django?*
>> *I currently use a shared hosting, and was just thinking to move the
>> static content to GAE*
>> *I would like to know your thoughts on this*
>> *
>> *
>> --
>> Thanks and Regards,
>> *Praveen Krishna R*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Brian Bouterse
> ITng Services
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: App engine serving static files?

2011-02-16 Thread Brian Bouterse
I've never used it, but I always wanted to use
DryDropto push all my static media over
to GAE.

Brian

On Wed, Feb 16, 2011 at 2:44 AM, Praveen Krishna R <
rpraveenkris...@gmail.com> wrote:

> *Hey Guys,*
> *
> *
> *Does Anyone has experience, serving static content with google app
> engine?*
> *Does it make a big difference, than serving it with nginx on the same
> server as django?*
> *I currently use a shared hosting, and was just thinking to move the
> static content to GAE*
> *I would like to know your thoughts on this*
> *
> *
> --
> Thanks and Regards,
> *Praveen Krishna R*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Brian Bouterse
ITng Services

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



App engine serving static files?

2011-02-15 Thread Praveen Krishna R
*Hey Guys,*
*
*
*Does Anyone has experience, serving static content with google app engine?*
*Does it make a big difference, than serving it with nginx on the same
server as django?*
*I currently use a shared hosting, and was just thinking to move the static
content to GAE*
*I would like to know your thoughts on this*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serving static files

2010-07-10 Thread shwetanka
Hi

Below is my code:

settings.py

MEDIA_URL = '/static/'
STATIC_DOC_ROOT = 'C:/djangotest/codificador/static/'

urls.py

urlpatterns = patterns(' ',
  (r'^static/(?P.*)$', 'django.static.views.serve',
{'document_root': settings.STATIC_DOC_ROOT}),
)

base.html
 in style tag:
  

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 which is served
by the media.example.com webserver?  If it does, then just set MEDIA_ROOT to
point to that directory, and any file uploaded for a FileField will be saved
there.

Then configure the media.example.com webserver to serve files from that
directory and all will be well.

You'll end up with:

/a/directory/visible/to/www/and/media - contain the files (point MEDIA_ROOT
here)
www.example.com - Django runs here, will have URLs for any uploaded file
pointing to http://media.example.com/ (from MEDIA_URL)
media.example.com - Apache or whatever serving up files from the directory
above.

Obviously if both servers are on the same box then making a directory appear
in both places is easy.  If not, then you'll have to use some form of
network filesystem to get the files between the boxes.

Hope this helps,

Malcolm
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



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 developed with django atwww.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 output HTML?
>
> If just part of the output HTML, all you need to do is go through your
> templates and change the paths in the URLs to point to
> media.example.comrather thanwww.example.com.  For bonus points, change them 
> to use {{ MEDIA_URL
>
> }}/path/to/image and pass MEDIA_URL into your template functions.
> > I have edited settings.py:
>
> > MEDIA_ROOT = 'http://media.miosito.it'
>
> > MEDIA_URL =  'http://media.miosito.it'
>
> > ADMIN_MEDIA_PREFIX =  'http://media.miosito.it'
>
> MEDIA_ROOT needs to be a directory path, not a URL - it's where Django will
> store uploaded files for any ImageField members.
>
> > And now ? What do I do ?
>
> That depends :)
>
> Malcolm
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




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 output HTML?

If just part of the output HTML, all you need to do is go through your
templates and change the paths in the URLs to point to
media.example.comrather than
www.example.com.  For bonus points, change them to use {{ MEDIA_URL
}}/path/to/image and pass MEDIA_URL into your template functions.


> I have edited settings.py:
>
> MEDIA_ROOT = 'http://media.miosito.it'
>
> MEDIA_URL =  'http://media.miosito.it'
>
> ADMIN_MEDIA_PREFIX =  'http://media.miosito.it'
>
>
MEDIA_ROOT needs to be a directory path, not a URL - it's where Django will
store uploaded files for any ImageField members.


> And now ? What do I do ?
>

That depends :)

Malcolm
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Serving static files from subdomain.

2010-01-16 Thread nameless
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.

I have edited settings.py:

MEDIA_ROOT = 'http://media.miosito.it'

MEDIA_URL =  'http://media.miosito.it'

ADMIN_MEDIA_PREFIX =  'http://media.miosito.it'


And now ? What do I do ?
.

I am using Apache but I could switch to lightpd or ngix ( if there is
a valid reason ).


Thanks ^^
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: apache serving static files

2010-01-07 Thread Mike Dewhirst

On 8/01/2010 2:13am, Stephen Emslie wrote:

Looks like the regular expression of the AliasMatch excludes any '/'
characters in the pattern, so is only going to match the last part of the
path.

Or roughly equivalent to doing path.split('/')[-1].

does the following work?

   AliasMatch /(.*\.js) /srv/www/ccm/htdocs/static/js/$1


Thanks Stephen

I really want the match string to start with a / hence ^/ and then any 
character . (including more slashes) one or more times + and ending in 
\.js  so I reckon it should be ^/.+\.js


AliasMatch (^/.+\.js) /srv/www/ccm/htdocs/static/js/$1

This is now finding tiny_mce according to FireBug BUT it isn't 
displaying the usual editing controls so there must be something else amiss.


Back to the drawing board I guess

Thanks

Mike





On Thu, Jan 7, 2010 at 12:48 PM, Mike Dewhirstwrote:


I want to serve development code from SuSE 11.1 using Apache 2.2 with
mod_wsgi in parallel with the Django server on WinXP.

It works - except I have obviously outsmarted myself configuring Apache to
serve javascript. In particular tiny_mce.js.

As an example, here is part of my
  ../templates/admin/flatpages/flatpage/change_form.html ...
- - - - - - - -

- - - - - - - -

Here is part of my settings.py ...
- - - - - - - -
MEDIA_URL = '/static/'
MEDIA_ROOT = os.path.dirname(PROJECT_ROOT) + '/htdocs/static/'
- - - - - - - -
This PROJECT_ROOT is derived from os.path.dirname(__file__) which makes the
root slightly different between WinXP Django dev server and SuSE Apache
server

Here is part of my Apache conf ...
- - - - - - - -
AliasMatch /([^/]*\.js) /srv/www/ccm/htdocs/static/js/$1
- - - - - - - -
... which I thought would match "/tiny_mce/tiny_mce.js" from the above
changeform.html snippet for Apache to find that script where it actually
lives in
   /srv/www/ccm/htdocs/static/js/tiny_mce/tiny_mce.js
BUT according to the errorlog Apache is actually looking in
   /srv/www/ccm/htdocs/static/js/tiny_mce.js

On the WinXP dev server tiny_mce works fine based on the above MEDIA_URL
and MEDIA_ROOT.

Any hints, pointers or docco links gratefully followed

Thanks

Mike

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.








-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: apache serving static files

2010-01-07 Thread Stephen Emslie
Looks like the regular expression of the AliasMatch excludes any '/'
characters in the pattern, so is only going to match the last part of the
path.

Or roughly equivalent to doing path.split('/')[-1].

does the following work?

  AliasMatch /(.*\.js) /srv/www/ccm/htdocs/static/js/$1



On Thu, Jan 7, 2010 at 12:48 PM, Mike Dewhirst wrote:

> I want to serve development code from SuSE 11.1 using Apache 2.2 with
> mod_wsgi in parallel with the Django server on WinXP.
>
> It works - except I have obviously outsmarted myself configuring Apache to
> serve javascript. In particular tiny_mce.js.
>
> As an example, here is part of my
>  ../templates/admin/flatpages/flatpage/change_form.html ...
> - - - - - - - -
> 
> - - - - - - - -
>
> Here is part of my settings.py ...
> - - - - - - - -
> MEDIA_URL = '/static/'
> MEDIA_ROOT = os.path.dirname(PROJECT_ROOT) + '/htdocs/static/'
> - - - - - - - -
> This PROJECT_ROOT is derived from os.path.dirname(__file__) which makes the
> root slightly different between WinXP Django dev server and SuSE Apache
> server
>
> Here is part of my Apache conf ...
> - - - - - - - -
> AliasMatch /([^/]*\.js) /srv/www/ccm/htdocs/static/js/$1
> - - - - - - - -
> ... which I thought would match "/tiny_mce/tiny_mce.js" from the above
> changeform.html snippet for Apache to find that script where it actually
> lives in
>   /srv/www/ccm/htdocs/static/js/tiny_mce/tiny_mce.js
> BUT according to the errorlog Apache is actually looking in
>   /srv/www/ccm/htdocs/static/js/tiny_mce.js
>
> On the WinXP dev server tiny_mce works fine based on the above MEDIA_URL
> and MEDIA_ROOT.
>
> Any hints, pointers or docco links gratefully followed
>
> Thanks
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



apache serving static files

2010-01-07 Thread Mike Dewhirst
I want to serve development code from SuSE 11.1 using Apache 2.2 with 
mod_wsgi in parallel with the Django server on WinXP.


It works - except I have obviously outsmarted myself configuring Apache 
to serve javascript. In particular tiny_mce.js.


As an example, here is part of my
  ../templates/admin/flatpages/flatpage/change_form.html ...
- - - - - - - -

- - - - - - - -

Here is part of my settings.py ...
- - - - - - - -
MEDIA_URL = '/static/'
MEDIA_ROOT = os.path.dirname(PROJECT_ROOT) + '/htdocs/static/'
- - - - - - - -
This PROJECT_ROOT is derived from os.path.dirname(__file__) which makes 
the root slightly different between WinXP Django dev server and SuSE 
Apache server


Here is part of my Apache conf ...
- - - - - - - -
AliasMatch /([^/]*\.js) /srv/www/ccm/htdocs/static/js/$1
- - - - - - - -
... which I thought would match "/tiny_mce/tiny_mce.js" from the above 
changeform.html snippet for Apache to find that script where it actually 
lives in

   /srv/www/ccm/htdocs/static/js/tiny_mce/tiny_mce.js
BUT according to the errorlog Apache is actually looking in
   /srv/www/ccm/htdocs/static/js/tiny_mce.js

On the WinXP dev server tiny_mce works fine based on the above MEDIA_URL 
and MEDIA_ROOT.


Any hints, pointers or docco links gratefully followed

Thanks

Mike
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Problem with serving static files

2009-11-18 Thread igor
>>> urls.py:
>>> urlpatterns = patterns('',
>>> (r'^polls/', include('mysite.polls.urls')),
>>> (r'^site_media/(?P.*)$', 'django.views.static.serve',
>>> {'document_root': '/mysite/media/'}),
>>> )

Since I always start Django in its "root" directory, I put something like:

import os
urlpatterns += patterns('',
(r'^site_media/(?P.*)$', 'django.views.static.serve',
 {'document_root': os.path.join(os.getcwd(), 'public', 'site_media'}
)

Then I created a "public/site_media" directory in the project's root
directory:

$ mkdir -p public/site_media

And restarted Django.

Hope this helps.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: Problem with serving static files

2009-11-18 Thread Benjamin Wolf
Thanks Jeremy, got it.

jeremyrdavis schrieb:
> The document root specified in urlpatterns should match the directory
> where your files are located.  You have "/mysite/media/" in your
> urlpatterns and "C:\django_projects\mysite\media" in your post.  Make
> sure those match.
>
>
> On Nov 18, 6:56 am, "Benjamin W."  wrote:
>   
>> Hi there,
>>
>> I'm new to django and got my first little problem.
>> I want to use a css file in my template. So I read 
>> this:http://docs.djangoproject.com/en/dev/howto/static-files/
>>
>> I set up everything, but I don't get the file.
>> My config:
>>
>> urls.py:
>> urlpatterns = patterns('',
>> (r'^polls/', include('mysite.polls.urls')),
>> (r'^site_media/(?P.*)$', 'django.views.static.serve',
>> {'document_root': '/mysite/media/'}),
>> )
>>
>> base.html (css include)
>> 
>>
>> Path to media:
>> C:\djanjo_projects\mysite\media
>>
>> When I open the source code of the page and click on the stylesheet, I
>> get this information:
>> Request URL:http://127.0.0.1:8080/site_media/css/design.css
>> /mysite/media/css/design.css does not exist
>>
>> Whats wrong with my pass?
>> Thanks a lot,
>> greets Ben
>> 
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=.
>
>
>   

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: Problem with serving static files

2009-11-18 Thread Denis Bahati
how do you make them similar? because its also a problem to with TinyMCE.

On Wed, Nov 18, 2009 at 4:13 PM, jeremyrdavis wrote:

> The document root specified in urlpatterns should match the directory
> where your files are located.  You have "/mysite/media/" in your
> urlpatterns and "C:\django_projects\mysite\media" in your post.  Make
> sure those match.
>
>
> On Nov 18, 6:56 am, "Benjamin W."  wrote:
> > Hi there,
> >
> > I'm new to django and got my first little problem.
> > I want to use a css file in my template. So I read this:
> http://docs.djangoproject.com/en/dev/howto/static-files/
> >
> > I set up everything, but I don't get the file.
> > My config:
> >
> > urls.py:
> > urlpatterns = patterns('',
> > (r'^polls/', include('mysite.polls.urls')),
> > (r'^site_media/(?P.*)$', 'django.views.static.serve',
> > {'document_root': '/mysite/media/'}),
> > )
> >
> > base.html (css include)
> > 
> >
> > Path to media:
> > C:\djanjo_projects\mysite\media
> >
> > When I open the source code of the page and click on the stylesheet, I
> > get this information:
> > Request URL:http://127.0.0.1:8080/site_media/css/design.css
> > /mysite/media/css/design.css does not exist
> >
> > Whats wrong with my pass?
> > Thanks a lot,
> > greets Ben
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: Problem with serving static files

2009-11-18 Thread jeremyrdavis
The document root specified in urlpatterns should match the directory
where your files are located.  You have "/mysite/media/" in your
urlpatterns and "C:\django_projects\mysite\media" in your post.  Make
sure those match.


On Nov 18, 6:56 am, "Benjamin W."  wrote:
> Hi there,
>
> I'm new to django and got my first little problem.
> I want to use a css file in my template. So I read 
> this:http://docs.djangoproject.com/en/dev/howto/static-files/
>
> I set up everything, but I don't get the file.
> My config:
>
> urls.py:
> urlpatterns = patterns('',
>         (r'^polls/', include('mysite.polls.urls')),
>         (r'^site_media/(?P.*)$', 'django.views.static.serve',
>         {'document_root': '/mysite/media/'}),
> )
>
> base.html (css include)
> 
>
> Path to media:
> C:\djanjo_projects\mysite\media
>
> When I open the source code of the page and click on the stylesheet, I
> get this information:
> Request URL:http://127.0.0.1:8080/site_media/css/design.css
> /mysite/media/css/design.css does not exist
>
> Whats wrong with my pass?
> Thanks a lot,
> greets Ben

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Problem with serving static files

2009-11-18 Thread Benjamin W.
Hi there,

I'm new to django and got my first little problem.
I want to use a css file in my template. So I read this:
http://docs.djangoproject.com/en/dev/howto/static-files/

I set up everything, but I don't get the file.
My config:

urls.py:
urlpatterns = patterns('',
(r'^polls/', include('mysite.polls.urls')),
(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/mysite/media/'}),
)


base.html (css include)



Path to media:
C:\djanjo_projects\mysite\media

When I open the source code of the page and click on the stylesheet, I
get this information:
Request URL:http://127.0.0.1:8080/site_media/css/design.css
/mysite/media/css/design.css does not exist

Whats wrong with my pass?
Thanks a lot,
greets Ben

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




unable to render images in development server despite following instructions on serving static files

2009-07-12 Thread djangonoob

hi all, what i am trying to do is as follows (development server ):
1) upload an image to my media/userimage/ directory and save the
location in mysql ( this is successful )
2) retrive the image by showing on a generated html page. But my image
is not showing as if the tag src url is wrong.

However, if i were to right click and copy the generated url of my
image and paste it on a new browser window, the image shows up.

Details of my code is found here:
http://dpaste.com/66164/

I've followed the instructions on 
http://docs.djangoproject.com/en/dev/howto/static-files/
and tried various methods for images ( in views.y ) such as:

images_to_view.image
images_to_view.image.url
images_to_view.image.path

All three could not work.


Any advice on how i can fix this problem?

Best Regards.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Serving static files with complex auth permissions

2009-06-14 Thread Todd Gardner

Hello django-users!

  I'm making a "google docs"-like service for users to create and
share documents with other users. I'd like to serve the documents
directly from apache authenticating against the django session. I've
read http://docs.djangoproject.com/en/dev/howto/apache-auth/ and the
excellent patch at http://code.djangoproject.com/ticket/3583, but as
far as I understand, the current implementation only allows
authentication based on staff, superuser, or a single static
permission, but as every document would need it's own permission, this
wouldn't work for a more complex auth system.

  So my questions are:
1) Is there a way to do this currently in django? and if not,
2) I've rolled my own (attached below), a modification on the patch on
#3583. It treats the authentication like a view that returns True or
False. So if the patch is installed, you would add:

*mysite/settings.py
ROOT_AUTH_URLCONF = 'mysite.auth_urls'

*create mysite/auth_urls.py:
from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = patterns('',
(r'^media/authorized/mymodule/', include
('mysite.mymodule.auth_urls')),
)

*create mysite/mymodule/auth_urls.py:
from django.conf.urls.defaults import *

urlpatterns = patterns('mysite.mysite.authers',
   (r'^documents/(?P[^/]+)$', 'document_auther'),
)

*create mysite/mymodule/authers.py:
from mysite.mymodule.models import Document

def document_auther(request, filename=None, *args, **kwargs):
  #  Here I can perform any logic like a normal view, with access
to request.user

(trimmed a bit for simplicity, a full solution would probably use
uuids on the filepath). So, is this a good idea/would people be
interested in this?

Thanks for reading,
Todd Gardner

The patch (applied on top of patch for #3583, might need better error
handling, like catching the resolver404):
--- original/modpython.py   2009-05-26 19:35:18.0 -0400
+++ authurl/modpython.py2009-05-26 23:58:16.0 -0400
@@ -16,6 +16,7 @@
 self.permission_name = options.get('DjangoPermissionName',
None)
 self.staff_only = _str_to_bool(options.get
('DjangoRequireStaffStatus', "on"))
 self.superuser_only = _str_to_bool(options.get
('DjangoRequireSuperuserStatus', "off"))
+self.use_auth_urls = _str_to_bool(options.get
('DjangoUseAuthURLs', "off"))
 self.raise_forbidden = _str_to_bool(options.get
('DjangoRaiseForbidden', "off"))
 self.settings_module = options.get('DJANGO_SETTINGS_MODULE',
None)

@@ -49,6 +50,18 @@
 return False
 return True

+def check_auth_url(request):
+from django.core import urlresolvers
+
+auth_urlconf = getattr(request, "auth_urlconf",
settings.ROOT_AUTH_URLCONF)
+
+resolver = urlresolvers.RegexURLResolver(r'^/', auth_urlconf)
+
+callback, callback_args, callback_kwargs = resolver.resolve(
+request.path_info)
+
+return callback(request, *callback_args, **callback_kwargs)
+
 def redirect_to_login(req):
 path = quote(req.uri)
 if req.args:
@@ -131,7 +144,8 @@
 # a response which redirects to settings.LOGIN_URL
 redirect_to_login(req)

-if validate_user(user, options):
+if validate_user(user, options) and (not
options.use_auth_urls
+ or check_auth_url
(request)):
 return apache.OK

 # mod_python docs say that HTTP_FORBIDDEN should be raised if
the user

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 = 'sqlite/mydb' # Or path to database file
if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'America/Los_Angeles'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'mysecretkey+'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

ROOT_URLCONF = 'myproject.urls'

import os.path
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
# "/mypath/"
os.path.join(os.path.dirname(__file__),'templates'),
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'myproject.myapp',
'django.contrib.admin',
'django.contrib.admindocs'
)

On Apr 16, 5:59 am, Les  wrote:
> 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, 4:06 pm, Wayne Koorts  wrote:
>
> > > >> > 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 {
> > >     color: green;
> > >     border: solid red;
>
> > > }
>
> > > 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);".
>
> > > Regards,
> > > Wayne
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 named colors are all specified in 24bit RGB
> values as part of the CSS spec. No renderer deviates from those values.
>
> http://www.w3.org/TR/CSS21/syndata.html#color-units

I see, I was clearly misinformed.  Thanks for the link.

Regards,
Wayne

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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, 4:06 pm, Wayne Koorts  wrote:
>
> > >> > 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 {
> >     color: green;
> >     border: solid red;
>
> > }
>
> > 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);".
>
> > Regards,
> > Wayne
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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: "color: rgb(255, 0, 0);".
> 
> Regards,
> Wayne

That is incorrect, the named colors are all specified in 24bit RGB
values as part of the CSS spec. No renderer deviates from those values.

http://www.w3.org/TR/CSS21/syndata.html#color-units

Cheers

Tom


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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
> >> > 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 {
>     color: green;
>     border: solid red;
>
> }
>
> 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);".
>
> Regards,
> Wayne
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 {
color: green;
border: solid red;
}

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);".

Regards,
Wayne

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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, 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 pic that
> > > > I placed in the media folder, but I can't get the html to use the CSS
> > > > template.
>
> > > >    
> > > >    
> > > >    My Site
> > > >    
>
> > > >    
> > > >    
> > > >    Test paragraph.
> > > >    
>
> > > > My CSS file looks like this:
>
> > > >    P.baseline {
> > > >    color : green;
> > > >    border : solid red;
> > > >    }
>
> > > > The picture shows up, but the text doesn't turn green like I think it
> > > > should.
>
> > > > Any help would be appreciated!
>
> > > Where is your CSS file located?  Specifically is it in the same directory
> > as
> > > the image.
>
> > > Alex
>
> > > --
> > > "I disapprove of what you say, but I will defend to the death your right
> > to
> > > say it." --Voltaire
> > > "The people's good is the highest law."--Cicero
>
> Is the rel="baseline" correct?  I was under the impression that "stylesheet"
> was the correct value.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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
> > > 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.
> >
> > >
> > > >
> > >My Site
> > >
> >
> > >
> > >
> > >Test paragraph.
> > >
> >
> > > My CSS file looks like this:
> >
> > >P.baseline {
> > >color : green;
> > >border : solid red;
> > >}
> >
> > > The picture shows up, but the text doesn't turn green like I think it
> > > should.
> >
> > > Any help would be appreciated!
> >
> > Where is your CSS file located?  Specifically is it in the same directory
> as
> > the image.
> >
> > Alex
> >
> > --
> > "I disapprove of what you say, but I will defend to the death your right
> to
> > say it." --Voltaire
> > "The people's good is the highest law."--Cicero
> >
>
Is the rel="baseline" correct?  I was under the impression that "stylesheet"
was the correct value.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 pic that
> > I placed in the media folder, but I can't get the html to use the CSS
> > template.
>
> >    
> >    
> >    My Site
> >    
>
> >    
> >    
> >    Test paragraph.
> >    
>
> > My CSS file looks like this:
>
> >    P.baseline {
> >    color : green;
> >    border : solid red;
> >    }
>
> > The picture shows up, but the text doesn't turn green like I think it
> > should.
>
> > Any help would be appreciated!
>
> Where is your CSS file located?  Specifically is it in the same directory as
> the image.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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.
>
>
> >
>My Site
>
>
>
>
>Test paragraph.
>
>
>
> My CSS file looks like this:
>
>P.baseline {
>color : green;
>border : solid red;
>}
>
> The picture shows up, but the text doesn't turn green like I think it
> should.
>
> Any help would be appreciated!
> >
>
Where is your CSS file located?  Specifically is it in the same directory as
the image.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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

2009-04-15 Thread Anthony

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.



My Site




Test paragraph.



My CSS file looks like this:

P.baseline {
color : green;
border : solid red;
}

The picture shows up, but the text doesn't turn green like I think it
should.

Any help would be appreciated!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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_indexes':
True })

my css file is at path '/home/amit/analytics/sitemedia/default.css'

my template has the link to css


>
> i know this might be very basic but i have just started to try my hand at
> this .
>



-- 
A-M-I-T S|S

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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, so instead of default.css
you should
instead have (?P.*). This is part of the argument that serve
will take, which
it uses to find the right file to serve. That is why the error is
saying:
erve() takes at least 2 non-keyword arguments (1 given)
the 2nd arguement that it expect is the document root.

Hope this clear things up for you

~Jakob

On 13 Apr., 13:58, amit sethi  wrote:
> Hi , i am new to django and i am trying to serve my css file .
> I followed the instruction to serve  static files in development server and
> made a seperate /media directory
> I copied my css file into it
>
> and changed the url pattern to include:
> (r'^site_media/default.css$', 'django.views.static.serve',
>         {'document_root': '/home/amit/analytics/media', 'show_indexes': 
> True}),
>
> now i get the error
> serve() takes at least 2 non-keyword arguments (1 given)
> i am new to web development please help
> --
> A-M-I-T S|S
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



serving static files

2009-04-13 Thread amit sethi
Hi , i am new to django and i am trying to serve my css file .
I followed the instruction to serve  static files in development server and
made a seperate /media directory
I copied my css file into it

and changed the url pattern to include:
(r'^site_media/default.css$', 'django.views.static.serve',
{'document_root': '/home/amit/analytics/media', 'show_indexes': True
}),
now i get the error
serve() takes at least 2 non-keyword arguments (1 given)
i am new to web development please help
-- 
A-M-I-T S|S

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems serving static files with Apache and mod_python

2008-10-15 Thread bruno desthuilliers



On 15 oct, 17:42, Javi <[EMAIL PROTECTED]> wrote:
> I do tests using development server and everything is OK. But now, the
> app must be available to the users. If I musn't match the content
> static folder with a url, how must I rewrite the href to static file?

The way you should have done it right from the start (but this is not
heaviliy documented): using the media context processors:

http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#django-core-context-processors-media


> I mean, using the development server the href to a css file is as
> follow: . How must I change the href to get the static
> content be loaded?

Install the media context processor, make sure you always use
RequestContext instances in your views, and use 'href="{MEDIA_URL}css/
style.css"' in your templates.

This will also work in development using django.views.static.serve():
http://docs.djangoproject.com/en/dev/howto/static-files/#howto-static-files

HTH
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems serving static files with Apache and mod_python

2008-10-15 Thread Javi

I do tests using development server and everything is OK. But now, the
app must be available to the users. If I musn't match the content
static folder with a url, how must I rewrite the href to static file?
I mean, using the development server the href to a css file is as
follow: . How must I change the href to get the static
content be loaded?

On Oct 15, 12:02 am, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> On 14 oct, 20:28, Javi <[EMAIL PROTECTED]> wrote:
>
> > Dear group,
>
> > sorry for starting another thread on this issue. I've seen loads of
> > messages with similar but particular problems.
> > My system:
> > * apache2 (2.2.9-10)
> > * libapache2-mod-python  (3.3.1-5)
> > * python-django (1.0-1)
>
> > My project is located at:  ~/Desktop/csl2-sdocente/src/candidateTool
> > and the app I'm trying to make work is called assessmentSystem,
> > obviously at ~/Desktop/csl2-sdocente/src/candidateTool/
> > assessmentSystem.
>
> Just for the record : is there any reason you don't use the builtin
> development server ?
>
> > The static files are located at ~/Desktop/csl2-sdocente/src/
> > django_media/ and match with the url 'r'^static/(?P.*)$'
>
> ???
>
> You don't have to do url matching within django to serve static
> content - unless using the development server, that is. Did you try
> commenting out this line from your urls.py file ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems serving static files with Apache and mod_python

2008-10-14 Thread bruno desthuilliers



On 14 oct, 20:28, Javi <[EMAIL PROTECTED]> wrote:
> Dear group,
>
> sorry for starting another thread on this issue. I've seen loads of
> messages with similar but particular problems.
> My system:
> * apache2 (2.2.9-10)
> * libapache2-mod-python  (3.3.1-5)
> * python-django (1.0-1)
>
> My project is located at:  ~/Desktop/csl2-sdocente/src/candidateTool
> and the app I'm trying to make work is called assessmentSystem,
> obviously at ~/Desktop/csl2-sdocente/src/candidateTool/
> assessmentSystem.

Just for the record : is there any reason you don't use the builtin
development server ?

> The static files are located at ~/Desktop/csl2-sdocente/src/
> django_media/ and match with the url 'r'^static/(?P.*)$'

???

You don't have to do url matching within django to serve static
content - unless using the development server, that is. Did you try
commenting out this line from your urls.py file ?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problems serving static files with Apache and mod_python

2008-10-14 Thread Javi

Dear group,

sorry for starting another thread on this issue. I've seen loads of
messages with similar but particular problems.
My system:
* apache2 (2.2.9-10)
* libapache2-mod-python  (3.3.1-5)
* python-django (1.0-1)

My project is located at:  ~/Desktop/csl2-sdocente/src/candidateTool
and the app I'm trying to make work is called assessmentSystem,
obviously at ~/Desktop/csl2-sdocente/src/candidateTool/
assessmentSystem.

The static files are located at ~/Desktop/csl2-sdocente/src/
django_media/ and match with the url 'r'^static/(?P.*)$'

I'd like to display the app at localhost, so my httpd.conf looks like:


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE candidateTool.settings
PythonOption django.root /
PythonDebug On
PythonPath "['/home/peris/Desktop/csl2-sdocente/src/', '/home/
peris/Desktop/csl3-sdocente/src/django_media'] + sys.path"


Alias /static /home/peris/Desktop/csl3-sdocente/src/django_media

Allow from all



SetHandler None



SetHandler None


But there's no way I can't load the css and images files. Any idea?

Thanks in advance!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 and they were
> > very helpful. However, I did not find out through the tutorials alone
> > how to serve CSS files along with my HTML. I was told in IRC that
> > these are not directly handled by django.
>
> > Basically, my main concern is keeping my website source code
> > centralized. At the moment, I keep my django project & respective apps
> > in Subversion, and I want my static files (CSS) to be in there with
> > the rest of the django files.
>
> > Having said this, I'm not sure how to configure apache to look for
> > those CSS files. Say my django project is in /srv/django/myproject,
> > and my document root is in /srv/http, what must be done? If this is
> > covered in the documentation, I apologize for wasting the community's
> > time and would appreciate a direct link to the materials I need to
> > read.
>
> > Thanks in advance.

Thanks for the help guys. I'm guessing javascript files are also
considered static, since they're referenced by the HTML as well?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 tutorials alone
> how to serve CSS files along with my HTML. I was told in IRC that
> these are not directly handled by django.
>
> Basically, my main concern is keeping my website source code
> centralized. At the moment, I keep my django project & respective apps
> in Subversion, and I want my static files (CSS) to be in there with
> the rest of the django files.
>
> Having said this, I'm not sure how to configure apache to look for
> those CSS files. Say my django project is in /srv/django/myproject,
> and my document root is in /srv/http, what must be done? If this is
> covered in the documentation, I apologize for wasting the community's
> time and would appreciate a direct link to the materials I need to
> read.
>
> Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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, basically you need to set the apache directives so that
for static files the handler is set to none, if you read through that
and use the examples (the ones at the bottom, the ones at the top
where my original attempts) I think you will be able to get a feel of
whats going on. If you struggle with anything let me know. You should
know i'm no expert though.

Regards,

Andrew


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Serving static files?

2008-08-31 Thread Robert

Hi,

I just got done reading through the 4 django tutorials and they were
very helpful. However, I did not find out through the tutorials alone
how to serve CSS files along with my HTML. I was told in IRC that
these are not directly handled by django.

Basically, my main concern is keeping my website source code
centralized. At the moment, I keep my django project & respective apps
in Subversion, and I want my static files (CSS) to be in there with
the rest of the django files.

Having said this, I'm not sure how to configure apache to look for
those CSS files. Say my django project is in /srv/django/myproject,
and my document root is in /srv/http, what must be done? If this is
covered in the documentation, I apologize for wasting the community's
time and would appreciate a direct link to the materials I need to
read.

Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 should be symlinked to my apache docroot,
> and got a tool 'junction' for doing that
> on winnt. however, i could not make head or tail of it as the docs are not
> very clear to me
> Can somebody help me please?
> Also have been trying to get #django on ircnode ercently but can't, any

IRC is working fine, there are a bunch of us on there now.  Hop on so
we can walk you through this.

If you still can't get on then please dpaste your httpd.conf, the
whole thing for you django project.  Also we will need your
settings.py file.

Michael Trier
blog.michaeltrier.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Fwd: serving static files with apache on windows with mod_python

2007-12-07 Thread bayo



--- Forwarded message ---
From: bayo <[EMAIL PROTECTED]>
To: django-users@googlegroups.com
Cc:
Subject: serving static files with apache on windows with mod_python
Date: Fri, 07 Dec 2007 14:42:02 +0100

Hi All,
I have been trying to setup django on windowsxp with mod_python.
I have got mod_python3.3.1 running on Apache2.
My django project is also running except for the media files which are
giving me quite a headache
i have added

...
...

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 should be symlinked to my apache docroot,
and got a tool 'junction' for doing that
on winnt. however, i could not make head or tail of it as the docs are not
very clear to me
Can somebody help me please?
Also have been trying to get #django on ircnode ercently but can't, any
reasons?



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread koenb

There already is a ticket: #4783. Just needs volunteers to do the
writing...

Koen

On 3 aug, 10:41, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote:
>
> > My guess is you are interfering with your admin_media (look at the
> > admin_media_prefix setting).
> > Try using something like r'^sitemedia/... and src="/sitemedia/...".
>
> Thanks koen, that did it. I think it could be nice if it was mention
> on the documentation.
>
> cheers,
> james


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027

hi Kai,


> If you do not use it, no.
>

If I use it, how does it affect then?

thanks
james


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027

hi,

On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote:
> My guess is you are interfering with your admin_media (look at the
> admin_media_prefix setting).
> Try using something like r'^sitemedia/... and src="/sitemedia/...".
>

Thanks koen, that did it. I think it could be nice if it was mention
on the documentation.

cheers,
james



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread koenb

My guess is you are interfering with your admin_media (look at the
admin_media_prefix setting).
Try using something like r'^sitemedia/... and src="/sitemedia/...".

Koen

On 3 aug, 09:16, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> I already did the
>
> (r'^media/(?P.*)$', 'django.views.static.serve',
> {'document_root':'d:/private/james/documents/django/ksk/media'}),
>
> in my urls.py
>
> and in my template i have something like this
>
> 
>
> but why is it the image still don't appear?
>
> Thanks
> james


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread Kai Kuehne

Hi,

On 8/3/07, james_027 <[EMAIL PROTECTED]> wrote:
> does it affect the django.views.static.serve?

If you do not use it, no.

Greetings
Kai

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027

hi,

are this settings used when running under development mode?

MEDIA_ROOT
MEDIA_URL

does it affect the django.views.static.serve?

thanks
james


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027

hi,

I already did the

(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root':'d:/private/james/documents/django/ksk/media'}),

in my urls.py

and in my template i have something like this



but why is it the image still don't appear?

Thanks
james


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Explain the template for serving static files?

2007-05-21 Thread Malcolm Tredinnick

On Mon, 2007-05-21 at 19:17 +, Val wrote:
> 
> DEFAULT_DIRECTORY_INDEX_TEMPLATE = """
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
>   
> 
> 
> 
> Index of {{ directory|escape }}
>   
>   
> Index of {{ directory|escape }}
> 
>   {% for f in file_list %}
>   {{ f|escape }}
>   {% endfor %}
> 
>   
> 
> """
> 
> What exactly are the pipes doing in this html?  I am trying to write a
> template that will display information about the files in my DB than
> their names.  For example, I want it to also show the date last
> modified.  I can see in the function that is calling the template that
> it is passing the mod date as well as the size of each file.  For some
> reason, they aren't coded into the template.  I guess what I'm trying
> to say is that I want to show the name, size, and mod date of the
> files in my db, and I don't understand the syntax included in the
> default template (I just ripped the above code from
> django.views.static).  Can someone enlighten me?

It sounds like you haven't read the template documentation:

http://www.djangoproject.com/documentation/templates/

That explains all about variable access, filters and the syntax.

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Explain the template for serving static files?

2007-05-21 Thread Val


DEFAULT_DIRECTORY_INDEX_TEMPLATE = """

http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
  



Index of {{ directory|escape }}
  
  
Index of {{ directory|escape }}

  {% for f in file_list %}
  {{ f|escape }}
  {% endfor %}

  

"""

What exactly are the pipes doing in this html?  I am trying to write a
template that will display information about the files in my DB than
their names.  For example, I want it to also show the date last
modified.  I can see in the function that is calling the template that
it is passing the mod date as well as the size of each file.  For some
reason, they aren't coded into the template.  I guess what I'm trying
to say is that I want to show the name, size, and mod date of the
files in my db, and I don't understand the syntax included in the
default template (I just ripped the above code from
django.views.static).  Can someone enlighten me?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How fix the "feature" of not serving static files?

2006-05-24 Thread [EMAIL PROTECTED]

I think so...

In the other hand, maybe I must borrow other concept from dotnetnuke.

Leveraging the template system, I have:

templates\basetemplateshere.htm
templates\blog\blogtemplateshere.html

Maybe if I go this way:

templates\Site1\customizedbase.html
templates\Site1\blog\customizedblogtemplateshere.html

And this way, I don't need code nothing and need only standarize in
settings that mediaroot include templates (for get css, img). Or if i
need inject something here, I can get anything flexible (anyway, I'm
for a cms for designers)

What think?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



  1   2   >