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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:38:37+00:00 2026-05-21T14:38:37+00:00

I have the following custom inclusion tag: from django.template import Library from django.db.models import

  • 0

I have the following custom inclusion tag:

from django.template import Library
from django.db.models import Count

register = Library()

@register.inclusion_tag('projects/work_part.html', takes_context=True)
def project_list(context):
    return {'projects':context['projects']}

My settings look like this:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'context_processors.default_processors',
    )

I need to access MEDIA_URL within the work_path.html template but it seems the context processors are not applied to custom templates.

How do I access MEDIA_URL within my template tag? I saw this post: Access STATIC_URL from within a custom inclusion template tag but I am not using STATIC_URL, is there another set of tags I should be loading?

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

    You can do the same (as with STATIC_URL) using the tempatetag {% get_media_prefix %}

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

Sidebar

Related Questions

I have written the following custom field: from django.core.urlresolvers import reverse from django.db import
I have the following custom event: package com.un.photoManager.events { import flash.events.Event; import mx.collections.ArrayCollection; public
I have defined following control template for my custom control. <ControlTemplate TargetType={x:Type local:CustomControl}> <Grid
Say I have the following custom component: <s:Group xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx> <fx:Script> <![CDATA[ [Bindable]
I have created the following custom tooltip with the custom template. <ToolTip x:Class=FireFly.Controls.CustomToolTip xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
Updated I have the following custom field class: class Binary(models.Field): __metaclass__ = models.SubfieldBase def
I have the following custom query: @initial_matches = Listing.find_by_sql([SELECT * FROM listings WHERE industry
I have following markup, <div custom=> <div> <template> <a custom=> (anything inside template should
I have the following custom observable collection (The code is taken in parts from
I have following code using hibernate to throw a custom exception on error and

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.