Django StaticFiles

17 views
Skip to first unread message

Omar

unread,
Apr 28, 2016, 11:28:13 AM4/28/16
to django...@googlegroups.com

Hello I am new in Django in Linux, I have already config the apache2 server to run Django and it works but It does’nt load me the static files, when I open the Django’s Admin it just plane text (just html). I need to know how config it. thanks

Mike Dewhirst

unread,
Apr 28, 2016, 7:54:02 PM4/28/16
to django...@googlegroups.com
Here is a working Apache 2.2 example.

NB: I cannot vouch for the security of this setup so I hope someone more
knowledgeable than me can comment.

# lock the public out
<Directory /var/www/xxdx/>
AllowOverride None
Order deny,allow
Deny from all
</Directory>

# serve collectstatic stuff from here
<Directory /var/www/static/xxdx/>
AllowOverride None
Order deny,allow
Allow from all
</Directory>

# show apache where to find static files
<IfModule mod_alias.c>
Alias /static/ /var/www/static/xxdx/
</IfModule>

Mike


>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/57222bf6.8758810a.6a6a0.4768SMTPIN_ADDED_MISSING%40gmr-mx.google.com
> <https://groups.google.com/d/msgid/django-users/57222bf6.8758810a.6a6a0.4768SMTPIN_ADDED_MISSING%40gmr-mx.google.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages