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 811181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:00:13+00:00 2026-05-15T01:00:13+00:00

in my settings.py I have the following: PROJECT_DIR = os.path.dirname(os.path.realpath(__file__)) MEDIA_ROOT = os.path.join(PROJECT_DIR,’templates’) MEDIA_URL

  • 0

in my settings.py I have the following:

PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
MEDIA_ROOT = os.path.join(PROJECT_DIR,'templates')
MEDIA_URL = '/templates/'

In urls.py I have (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),

And my base.html has the following directive:

<link media="screen" href="site_media/bat/design/css/bat.css" type="text/css" rel="stylesheet" />

Upon first entry into the application (i.e. http://localhost) this stylesheet gets loaded just fine. However, on a subsequent http request (in urls.py it is (r'^assist/bat/', include('assist.bat.urls')), to another template this directive results in the following error:

The stylesheet http://localhost/assist/bat/site_media/bat/design/css/bat.css was not loaded because its MIME type, “text/html”, is not “text/css.”

As you can see, this css directive gets morphed into a relative url which is completely incorrect. If I remove /assist/bat from that url, then it works just fine. So how can I set up my app to not morph url’s this way?

Thanks,
Igor

  • 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-15T01:00:14+00:00Added an answer on May 15, 2026 at 1:00 am

    Wild guess: href="site_media/bat/design/css/bat.css" should be href="/site_media/bat/design/css/bat.css", urls starting without slash in front of them are resolved relatively to the current url.

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

Sidebar

Related Questions

I have the following code in settings.py #EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER
I have created a sitecollection and in AAM I have made following settings for
I have a settings bundle in my iPhone app, with the following PList: Type:
If I have a photoshop drop shadow with the following settings Blend Mode -
I have a working Flex/BlazeDS application (for simple AMF remoting) with the following settings:
I have a table with sets of settings for users, it has the following
I have a Spring application deployed in JBoss EAP server, using the following settings:
Moved to ef 4.3 with AutomaticMigrationsEnabled = true; In web.config have the following settings:
I have the following path to my asp.net (with mvc) project: D:\testAppMvc\testAppMvc.sln I have
I want to download source code for android core apps like Settings.I have following

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.