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

  • Home
  • SEARCH
  • 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 6253645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:02:23+00:00 2026-05-24T14:02:23+00:00

I have these URLs in my project .urls: urlpatterns = patterns(”, (r’^categories/’, include(‘category.urls’)), )

  • 0

I have these URLs in my project .urls:

urlpatterns = patterns('',
    (r'^categories/', include('category.urls')),
)

In the categroy app, my category.urls:

urlpatterns = patterns('category.views',
    (r'^$', 'category_tree'),
    (r'^add/?$', 'category_add'),)

I have this in my settings.py:

MEDIA_URL = "http://localhost:80/media/"
ROOT_PATH = os.path.normpath(os.path.dirname(__file__))
TEMPLATE_DIRS = (
    os.path.join(ROOT_PATH, 'templates'),
)

In the project templates directory there is a base template “base.html” with this line:

<link href="{{MEDIA_URL}}css/base.css" rel="stylesheet" />

In my “category” app, I also have templates “category_tree.html” and “category_add.html”.
These both extend from base.html:

{% extends "base.html" %}

The blocks in base.html are rendered correctly with content from these two child templates/views.
But the css and images of category_add.html aren’t found.

There is a link on categroy_tree.html like this:

<div><a href="add">Add category</a></div>

This points to the correct view if clicked. But then the css MEDIA_URL request changes from

http://localhost/media/css/base.css
// (Correct)

to

http://localhost:8000/categories/css/base.css
// (Incorrect)

Why is this happening and what do I have to do to fix this?

  • 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-24T14:02:26+00:00Added an answer on May 24, 2026 at 2:02 pm

    The add category view isn’t using a RequestContext to render the page, so MEDIA_URL is not sent to the template context.

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

Sidebar

Related Questions

In one application's urls.py I have: urlpatterns = patterns('app.views', url(r'^products/$', products, name=products), url(r'^$', index,
I have already have this code to force these URLs to HTTPS: RewriteCond %{HTTPS}
I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults
About the system I have URLs of this format in my project:- http://project_name/browse_by_exam/type/tutor_search/keyword/class/new_search/1/search_exam/0/search_subject/0 Where
I've seen somewhere a urls.py construct like this: from project.f import SomeClass urlpatterns =
We have a fairly large MVC project with a large number of views and
I have an ASP.NET MVC project containing an AdminController class and giving me URls
My project requires me to validate a large number of web URLs. These URLs
In my Django project, I used to have a single URLConf, urls.py at the
I have a CakePHP project where I modified app/config/routes.php so that the root points

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.