Fixing Django admin style

I was trying out django tutorial. It works fine when I use the webserver provided by django. But when I tried to deploy on an Apache server. The admin page has lost its style. I tried to google around, and show suggestion to set Apache Alias for media to redirect to the media folder for django. But I couldn’t find media folder for django. It turns out that from django 1.4 onwards we should refer to static folder instead. So this is the modification that I made:

On /etc/apache2/apache2.conf:

<pre>

Alias /static/admin /home/ubuntu/websenv/lib/python2.7/site-packages/django/contrib/admin/static/admin/

</pre>

to point to the location of the static files for admin page. And that solves my problem.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: