Re: Django not showing css - static files

58 views
Skip to first unread message

Mike Dewhirst

unread,
Mar 13, 2014, 6:57:36 PM3/13/14
to django...@googlegroups.com
On 14/03/2014 9:05am, Luggaz wrote:
> Good day,
>
> My static files are not showing on production, they show when I run them
> development mode. I am running Django1.6 on apache,mod_wsgi. I get the
> not found error on the files.

Have you copied all your static files into STATIC_ROOT ??

>
> I have been on it for hours and have tried changing and tweaking
> STATIC_ROOT and STATICFILES_DIR
>
> I have attached 3 images, the apache file, and the difference between
> the dev and the production screenshot.
>
> Regards
> Lunga
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto: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/dcfa6c8e-9183-45ec-bfcf-74b5db3910c9%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/dcfa6c8e-9183-45ec-bfcf-74b5db3910c9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Lunga Baliwe

unread,
Mar 14, 2014, 2:08:29 PM3/14/14
to django...@googlegroups.com
Good day Mike,

I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
website being the app name


On Fri, Mar 14, 2014 at 12:57 AM, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
On 14/03/2014 9:05am, Luggaz wrote:
Good day,

My static files are not showing on production, they show when I run them
development mode. I am running Django1.6 on apache,mod_wsgi. I get the
not found error on the files.

Have you copied all your static files into STATIC_ROOT ??


I have been on it for hours and have tried changing and tweaking
STATIC_ROOT and STATICFILES_DIR

I have attached 3 images, the apache file, and the difference between
the dev and the production screenshot.

Regards
Lunga

--
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

To post to this group, send email to django...@googlegroups.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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Tom Evans

unread,
Mar 14, 2014, 2:18:39 PM3/14/14
to django...@googlegroups.com
On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe <lung...@gmail.com> wrote:
> Good day Mike,
>
> I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
> website being the app name

STATIC_ROOT has nothing to do with apps, it is where the files are
copied to (by django) and served from (by your webserver).

Assuming staticfiles works for you in development, there are very few
things that you can do wrong, so (in turn):

Have you run collectstatic to copy files from your static folders
(application static folders and folders listed in STATICFILES_DIRS) to
your STATIC_ROOT?

Have you configured your webserver to serve files in the folder
indicated by STATIC_ROOT at the URL indicated by STATIC_URL?

Cheers

Tom

Lunga Baliwe

unread,
Mar 14, 2014, 2:29:39 PM3/14/14
to django...@googlegroups.com
yes I think I have on apache I got it like this.

Alias /static/ /home/project_name/website/static
<Directory /home/project_name/website/static>
    Order allow, deny
    Allow from all
</Directory>
 
I did run collecstatic aswell

--
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.

Lunga Baliwe

unread,
Mar 14, 2014, 2:34:22 PM3/14/14
to django...@googlegroups.com
I just put on the last forward slash on 
Alias /static/ /home/project_name/website/static/

And it worked, yho thanks Mike...

Lunga Baliwe

unread,
Mar 14, 2014, 2:35:37 PM3/14/14
to django...@googlegroups.com
Really appreciate it

Lunga Baliwe

unread,
Mar 14, 2014, 2:42:25 PM3/14/14
to django...@googlegroups.com
And thank you Tom as well
Reply all
Reply to author
Forward
0 new messages