Thursday, April 28, 2016

Re: Django StaticFiles

On 29/04/2016 1:24 AM, Omar wrote:
> 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

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

--
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-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/8f9816b6-a315-a013-0fa6-8936e3edfc57%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment