Developer server experiencing CSS issues in Django admin interface

Experiencing some odd issues with the Django admin application here. I've got everything up and running on the manage.py runserver development server, but for some reason it looks like this:

This obviously isn't what I want, so I'm trying to figure out how to fix it. I have the staticfiles app enabled, which might be causing the problem, although I can't say for sure. Any insights into what mistakes might have been made?

The admin site appears to be referencing these CSS stylesheets that are not being located:

<link rel="stylesheet" type="text/css" href="/media/css/base.css" />
<link rel="stylesheet" type="text/css" href="/media/css/dashboard.css" />

Answer №1

It appears that you are utilizing the staticfiles contrib package within Django 1.3. In this case, all you require is:

ADMIN_MEDIA_PREFIX = STATIC_URL+'admin/'

Answer №2

Go into your settings.py file and make sure to uncomment the line or add 'django.contrib.staticfiles',. Then, restart the server to apply the changes. Hopefully this resolves the issue.

Answer №3

Your ADMIN_MEDIA_PREFIX may be causing the issue.

Consider updating it to:

ADMIN_MEDIA_PREFIX = "/admin-media/"

Give this a try and see if it resolves the problem.

Additionally, here are three more things to review:

  1. Double check if the admin stylesheets generating 404 errors actually have the correct prefix of /admin-media/.
  2. Ensure that there are no conflicts with your custom URL handlers. For example, check for any instances of url(r'^admin-media/', …) in your main urls.py.
  3. Although rare, consider the possibility of a broken Django installation. Confirm if the .css files exist within
    …/site-packages/django/contrib/admin/static/admin
    .

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Combining django-admin-sortable2 and the django-import-export package in the admin panel: A step-by-step guide

I am trying to integrate the django-admin-sortable2 and django-import-export packages in the admin panel simultaneously. Below is the code snippet: class University(models.Model): name = models.CharField(max_length=50, help_text="University or Ins ...

The 'CompanyUser' class does not have a method named 'all'

When making a Get request using TastyPie, I encountered the following error: Error message: "'CompanyUser' object has no attribute 'all'", /resources.py\", line 832, in full_dehydrate\n bundle.data[field_name] = field_o ...

Tips for styling an inline list using CSS before revealing it with jQuery's .show method:

In my project, I want to display a row of 'cells' which are simply images of black or white squares based on their ID. The issue I am facing is that when the button is clicked, the row list is shown without the CSS applied, and then after a brief ...

Error TS2307: Module './tables.module.css' or its type declarations could not be located

Currently utilizing CSS modules within a create-react-app project and encountering an error within Google Chrome browser: https://i.stack.imgur.com/0ItNM.png However, the error appears to be related to eslint because I am able to close the warning modal i ...

Automatically select and pre-fill a list item based on its value using jQuery

I'm a beginner in JQuery. In my application I have the following: Here is my HTML code: <ul id="list"> <li> <a class="selected" value="0" href="#" id="sel">ALL</a> </li> <li> <a hre ...

Footer that sticks to the bottom of the page across various pages

Having trouble printing a 2-page document on Chrome. The first page has fixed content while the second page has dynamic content in an extended table. The problem I'm facing is keeping the footer at the bottom of the second page. The CSS code below wo ...

Show button image beyond the limits of the hyperlink

Is it possible to create a button with a background image that changes on hover and when active, while also having the active state display an image that extends beyond the anchor's bounds? Check out my sprite here: The top half of the sprite represe ...

Nested Classes in JQuery

Looking for help with fading in text using jQuery. Despite setting everything up, it doesn't seem to be working. Can someone assist me with this issue? Here is my current code: .nav ul li { opacity: 0; padding: 0px 50px; transition: opacity 2s ease-i ...

Switch between display modes by clicking using collections

I am trying to figure out how to create a function that will only show content for the specific element in which my button is located. Currently, when I click the button it shows content for all elements with the 'one' class, but I want it to dis ...

Using a repeating background in CSS with overflow displayed at the top rather than the bottom

Does anyone know how to make the repeating background 'start' fixed at the bottom of the div and overflow on the top? I want it to be the opposite of the default behavior. Let me illustrate what I'm trying to achieve with a small example. I ...

Comparing django's objects.all() and objects.filter() functions

Queryset.objects.all() fetches all objects from the database, Queryset.objects.filter() also retrieves all objects based on certain criteria. I have two queries that employ Queryset.objects.filter() and I'd like to use them to retrieve all objects. ...

Tips for adjusting the height of a selection box in jQuery Mobile

I am trying to make the select box height the same as the label (模板分類:). <select id="TamplateClass" style="height:1.5em">...</select> you can use CSS #TamplateClass{height:1.5em;} However, no matter what I try, the results are all th ...

css problem with stacking order of child elements

Trying to arrange 3 HTML elements on the z-plane: .bank { width: 200px; height: 200px; background-color: grey; position: absolute; z-index: 100; transform: translateY(10%); } .card { width: 100px; height: 100px; background-color ...

Picture featuring a right-angled triangle on the right side

I have been experimenting with creating a complex image effect using CSS only, without any JavaScript. Despite several attempts, I haven't been able to achieve the desired outcome yet. CSS .container{ width: 500px; background-color: #0c2f45; ...

Adjust the height of images to be consistent

I'm currently working on creating a grid layout with 4 images in a row using DaisyUI card component. However, I've run into an issue where there is white space at the bottom of some images due to varying image heights. Is there a solution that wo ...

Email authentication complications causing routing issues

My goal is to authenticate users using their email addresses instead of usernames. Utilizing django-userena and following its documentation, I have configured everything accordingly. For example, including USERENA_WITHOUT_USERNAMES = True in the settings. ...

Guide on emphasizing a div when the page's validity is not true

Is there a way to highlight a specific div when the page.isvalid=false? I can display the error message on page load, but struggling to highlight the required control. I have a JavaScript function that applies an error class to the div, which works fine w ...

The 'Espece' object does not have the 'esp_id' attribute assigned to it

Hi there, I'm currently in the process of learning how to use Django. I'm having some trouble saving data into my database from a form - each time I attempt it, I encounter this error: Request Method: POST Request URL: localhost:8000/espece/ D ...

Help required - modeling creation

Seeking advice before implementing this code in production. I have a base class called Asset, which serves as the parent class for other classes such as Photo, Question, and Video using Multiple Table Inheritance. The goal is to retrieve all posts or user ...

Utilizing Django's LayerMapping to Refine Shapefile Data Before Database Import

Looking to import a shape-file into a Django database using the Django-LayerMapping module, which converts spatial data into GeoDjango models. When following the tutorial, the typical method involves saving the entire file to the database: lm = LayerMappi ...