Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14961 closed (fixed)

Cannot load admin interface static files when doing tutorial

Reported by: harriv+django@… Owned by: jezdez
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: UI/UX:


Version is actually 1.3 beta 1

I started to explore Django by going thru the tutorial ( ).

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 page give 404 error. Urls for css files:


Attachments (2) (490 bytes) - added by Harriv 6 years ago. (4.8 KB) - added by Harriv 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 6 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

1.3 adds the new staticfiles app to serve static app files. When creating a new project with 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 Changed 6 years ago by Harriv

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

comment:3 Changed 6 years ago by Harriv

  • Component changed from Uncategorized to runserver

More information:

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

comment:4 Changed 6 years ago by ramiro

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

comment:5 Changed 6 years ago by Harriv

DEBUG is True.

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

Changed 6 years ago by Harriv

Changed 6 years ago by Harriv

comment:6 Changed 6 years ago by mlangley

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 is set to True

comment:7 Changed 6 years ago by jezdez

  • Component changed from runserver to Contrib apps
  • milestone set to 1.3
  • Owner changed from nobody to jezdez
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:8 Changed 6 years ago by jezdez

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

comment:9 Changed 6 years ago by jezdez

Seems like fixes the issue for me. Going to add tests tomorrow.

comment:10 Changed 6 years ago by Harriv

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 Changed 6 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 Changed 5 years ago by ramiro

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 Changed 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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