Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#14961 closed (fixed)

Cannot load admin interface static files when doing tutorial

Reported by: harriv+django@… Owned by: Jannis Leidel
Component: Contrib apps Version: 1.3-alpha
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Version is actually 1.3 beta 1

I started to explore Django by going thru the tutorial ( http://docs.djangoproject.com/en/dev/intro/tutorial01/ ).

However when I activated the admin interface (tutorial part 2) and opened the admin interface in browser, it looks pretty ugly. I poked a little and found out that no css file cannot be loaded. Both css files referenced in the 127.0.0.1:8000/admin/ page give 404 error. Urls for css files:

/static/admin/css/base.css
/static/admin/css/dashboard.css

Attachments (2)

urls.py (490 bytes ) - added by Harriv 13 years ago.
settings.py (4.8 KB ) - added by Harriv 13 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by Jannis Leidel, 13 years ago

1.3 adds the new staticfiles app to serve static app files. When creating a new project with django-admin.py startproject mysite it should contain the django.contrib.staticfiles in INSTALLED_APPS. Can you check if that works for you (it does for me)?

comment:2 by Harriv, 13 years ago

django.contrib.staticfiles is there by default. I created the project following the steps in tutorial.

comment:3 by Harriv, 13 years ago

Component: Uncategorizeddjango-admin.py runserver

More information:

  • OS: Windows XP
  • Python version 2.7
  • Python installed in c:\python27\
  • Tutorial project in d:\harriv\djangotest\mysite\

comment:4 by Ramiro Morales, 13 years ago

Have by chance you set the DEBUG variable in setting.py to False?

comment:5 by Harriv, 13 years ago

DEBUG is True.

I tried minimal test case and just enabled the admin interface, no difference in results. I'll attach settings.py and urls.py.

by Harriv, 13 years ago

Attachment: urls.py added

by Harriv, 13 years ago

Attachment: settings.py added

comment:6 by mlangley, 13 years ago

I am also experiencing this issue when running 1.3 beta1 on Windows 7. I am new to Django and have not diverged from the steps in the tutorial.

Confirming the specific questions asked earlier:

  • django.contrib.staticfiles is enabled in INSTALLED_APPS
  • DEBUG variable in setting.py is set to True

comment:7 by Jannis Leidel, 13 years ago

Component: django-admin.py runserverContrib apps
milestone: 1.3
Owner: changed from nobody to Jannis Leidel
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:8 by Jannis Leidel, 13 years ago

OK, I was able to reproduce the bug, thanks for the report.

comment:9 by Jannis Leidel, 13 years ago

Seems like https://gist.github.com/d2b873845d5a49627f8e fixes the issue for me. Going to add tests tomorrow.

comment:10 by Harriv, 13 years ago

I can confirm that patch by jezdez fixes the problem. However there's another similar case in the same file, class AppDirectoriesFinder, method find_in_app.

comment:11 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: assignedclosed

(In [15119]) Fixed #14961 -- Revised staticfiles's prefix handling to make sure it runs on Windows. Also revised staticfiles tests to pass on Windows.

comment:12 by Ramiro Morales, 13 years ago

In [16285]:

Changed a bit the strategy used to test staticfiles finders so they can cope with even more differences in case of paths under Windows. Refs #14961

comment:13 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top