Re: static files and DEBUG = False

2015-04-24 Thread Florian Schweikert
On 21/04/15 23:49, egon.frer...@gmx.de wrote:
> settings.py contains ALLOWED_HOSTS with the host in the form
> ".example.com". With DEBUG = True I get the complete page. But if I set
> DEBUG = False the static files are not found so I get only the content.

Django does not serve static files if DEBUG=False, and you really don't
want to do that.

> If DEBUG = True  the apache access log the static files are shown with
> HTTP-code 200. If DEBUG = False Apache is looking for the static files
> two times. The first try gives  status code 301, the second try gives 
> status code 500.
> 
> Any idea why this happens?

It's a bad idea to serve statics with Django.
It's ok for debugging, but not for production.
If you already use apache serve static files with Apache directly.

--
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/553B3300.8040108%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


static files and DEBUG = False

2015-04-21 Thread egon.frer...@gmx.de
Hi,

settings.py contains ALLOWED_HOSTS with the host in the form 
".example.com". With DEBUG = True I get the complete page. But if I set 
DEBUG = False the static files are not found so I get only the content.

If DEBUG = True  the apache access log the static files are shown with 
HTTP-code 200. If DEBUG = False Apache is looking for the static files two 
times. The first try gives  status code 301, the second try gives  status 
code 500.

Any idea why this happens?

Egon

-- 
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/510d7903-db17-4763-b9d5-fe879b8240a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.