login community faq

Is there any definitive documentation for setting up the Django 1.3 admin?

I tried following the Django setup video, which isn't updated for changes to the 1.3 settings.py file - it shows how to enter the MEDIAROOT and MEDIAURL, but doesn't show the STATICROOT and STATICURL lines. The written tutorial below the video has the opposite problem - STATIC options but not MEDIA.

I ended up able to access the admin, but it doesn't have any styling. I've found others on the forums here who have had the same problem and I've tried the offered solution, but nothing seems to work. Frankly, at this point I think I've tried so many permutations that I'm sure I've been within a leading or trailing slash of success. What I really want/need at this point is a step-by-step guide to show how my static apps are supposed to be set up and what needs to go into the settings.py file.

Does that exist somewhere that I'm missing?

asked Mar 14 '12 at 16:14

bwareham's gravatar image

bwareham
1

Thanks. I submitted a support ticket and got my answer. I was missing a /admin/ pointer in my symlink.

(Mar 16 '12 at 11:53) bwareham bwareham's gravatar image

Further in the docs this process is explained.

If you have any issues you may submit a support ticket and we will explain what is missing from your current setup and how to correct it.

answered Mar 14 '12 at 22:25

johns's gravatar image

johns ♦♦
340427

to get the admin styled correctly:

  1. create a symlink in your directory from where you serve your static files (images, css, js, etc.). The symlink points to /home/yourhome/webapps/yourapp/lib/python2.7/django/contrib/admin

  2. fire up your browser and make sure you can access the admin dir through the web.

  3. Copy the url (better only the relative portion of the path), open settings.py, look for ADMIN_MEDIA_PREFIX and paste your url there.

  4. restart apache

answered Mar 15 '12 at 02:28

markusbarth's gravatar image

markusbarth
112

edited Mar 15 '12 at 02:29

That's actually the old way. The new way is to use the collectstatic management command to get all of your static assets into one location, and then serve them from there (as described in our current docs).

(Mar 15 '12 at 08:35) seanf ♦♦ seanf's gravatar image

Thanks for the hint, I have just had a look at https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/

(Mar 15 '12 at 11:15) markusbarth markusbarth's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×643
×34
×14

Asked: Mar 14 '12 at 16:14

Seen: 682 times

Last updated: Mar 16 '12 at 11:53

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited