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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:13:24+00:00 2026-05-31T11:13:24+00:00

Django has two template tags with and url. It would be handy to be

  • 0

Django has two template tags “with” and “url”. It would be handy to be able to combine the two:

{% with view=really.long.path.to.some.view.somewhere %}
    {% url view.foo %}
{% endwith %}

But if you try doing that, you find out that the “with” isn’t getting applied inside the “url” tag (as you get an error about there not being a “view.foo”).

So, my question is, am I just missing some flag/option/alternative format that would make the above work, or is truly impossible to simplify “url” tags using “with”?

  • 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-31T11:13:25+00:00Added an answer on May 31, 2026 at 11:13 am

    It is possible in Django 1.3 if you’re willing to use a future compatibility library.

    See the section Forwards compatibility at https://docs.djangoproject.com/en/dev/ref/templates/builtins/#url (just above the discussion on widthratio) for an explanation and examples.

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

Sidebar

Related Questions

Suppose you have a Django view that has two functions: The first function renders
I have a model in Django 1.2.4. It has two fields that I would
I has a Django view which is accessed through an AJAX call. It's a
I have problem about django template-db query relationship. For example, I created two tables
My Django urls.py has: from django.conf.urls.defaults import patterns, include, url import admin import settings
I have two models in Django: groups and entries. Groups has a many-to-many field
I've got a large Django app. It has two Apache virtual hosts pointing to
I have a Django project which has two apps (one created as debug test).
I am developing a user profile page, which has two modes - view and
My django project has two environments - development and test. Today I carelessly overwrote

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.