static files in Django 1.7 ; Anything was change?

239 views
Skip to first unread message

Fellipe Henrique

unread,
Sep 14, 2014, 9:02:17 PM9/14/14
to django...@googlegroups.com
Hi everybody!

I have my old project in Django 1.6, and works fine in development... when DEBUG=True.. but when I update to 1.7, stop to serving static files.

Here is my files:


What I missed?

Thanks, 

regards,
Fellipe H.

Mario Gudelj

unread,
Sep 15, 2014, 12:55:22 AM9/15/14
to django...@googlegroups.com
What are you using to serve static files? You normally setup your server e.g. Nginx to take care of this. 

Here's an example of Nginx setup file which serves static files from /webapps/hello_django/static/:

server {
 
    listen   80;
    server_name example.com;
 
    client_max_body_size 4G;
 
    access_log /webapps/hello_django/logs/nginx-access.log;
    error_log /webapps/hello_django/logs/nginx-error.log;
 
    location /static/ {
        alias   /webapps/hello_django/static/;
    }
    
    location /media/ {
        alias   /webapps/hello_django/media/;
    }
    ...

That was taken from this awesome article on deploying Django http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8690ea0f-35d9-49f2-b4e4-34bb80bdeb28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Chukharev

unread,
Sep 15, 2014, 7:41:13 AM9/15/14
to django...@googlegroups.com
Yes,  there are some changes, see release notes. In particular, you probably need to run 'django-admin collectstatic'.

Fellipe Henrique

unread,
Sep 15, 2014, 1:28:17 PM9/15/14
to django...@googlegroups.com
I in development mode, DEBUG = True. using the django server.

I already run './manage.py collectstatic'  they create all my static in my path.. but don't work...

T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

2014-09-15 8:41 GMT-03:00 Vladimir Chukharev <vladimir....@gmail.com>:
Yes,  there are some changes, see release notes. In particular, you probably need to run 'django-admin collectstatic'.

--
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/ExbIrYMBKhs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

Ricardo Daniel Quiroga

unread,
Sep 15, 2014, 2:20:34 PM9/15/14
to django...@googlegroups.com
hi

in you setings.py add 

in INSTALLED_APPS  add   'django.contrib.staticfiles',


STATIC_URL = '/media/'


STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "media"), #you template path
)




--
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 http://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.



--
------------------------------------------------------------
Ricardo Daniel Quiroga - L2Radamanthys

   Msn: l2rada...@gmail.com
           ricard...@hotmail.com

   Email: l2rada...@gmail.com
           l2rada...@saltalug.org.ar
           ricardoqu...@gmail.com
 
   sitio Web: http://www.l2radamanthys.com.ar
                   http://github.com/L2Radamanthys
   Twitter:    @l2Radamanthys
---------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages