Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:14:12+00:00 2026-05-28T00:14:12+00:00

I am having a peculiar issue with CSS in Django. Please see my code

  • 0

I am having a peculiar issue with CSS in Django.

Please see my code below.

    from django.conf.urls.defaults import patterns, include, url
    from Search import settings
    from django.contrib import admin
    admin.autodiscover()

    urlpatterns = patterns('Search.views',
        # Examples:
        url(r'^$','select_project'),
        url(r'^(?P<Project_Name>[\w \s]*)$','home'),
        url(r'^(?P<Project_Name>[\w\s]*/+\w*)$','Management'),

        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
        url(r'^admin/', include(admin.site.urls)),
    )

    if settings.DEBUG:
        urlpatterns += patterns('',
            (r'^(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}),
            (r'^(?P<Project_Name>[\w\s]*/+[\w]*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}),
    )

When my url is --http://127.0.0.1:8000 or --http://127.0.0.1:8000/xxxxx/, my CSS is loading properly.
However, when I navigate from http://127.0.0.1:8000/xxxxx/ to http://127.0.0.1:8000/xxxxx/abcd, then my css will not load. Please help

My Settings looks like this:

    MEDIA_ROOT=os.path.join(os.path.dirname(__file__), 'templates')

    MEDIA_URL = '/home/'

Also, my net console says:

[06/Jan/2012 08:56:51] "GET /xxxxx/css/main.css HTTP/1.1" 404 1797
[06/Jan/2012 08:56:51] "GET /xxxxx/css/skin.css HTTP/1.1" 404 1797
[06/Jan/2012 08:56:51] "GET /xxxxx/javascript/cufon-yui.js HTTP/1.1" 404 1830
[06/Jan/2012 08:56:51] "GET /xxxxx/javascript/font.font.js HTTP/1.1" 404 1830
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:14:13+00:00Added an answer on May 28, 2026 at 12:14 am

    Don’t use relative urls for css (e.g. /your-page/css/main.css).

    Use absolute (e.g. /static/css/main.css) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a peculiar issue. I'm reading the HTML from a div contenteditable, and
Having a problem getting a TreeView control to display node images. The code below
I am having a peculiar problem with getting an integer from an ajax response.
I am having a peculiar problem with the order in which FlowLayoutPanels are added
I am having a really peculiar case. I want to return some data -
Having the following code: int main(int argc, char* argv[]) { // program code std::cout
I'm having the most peculiar problem, and I was hoping I someone could point
Having the following code: template<typename T, typename OutStream = std::ostream> struct print { OutStream
I have a peculiar issue I'm dealing with. I'll start off vague and if
I am having a peculiar problem with the order in which TextBox controls are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.