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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:39:31+00:00 2026-05-28T05:39:31+00:00

I made a mistake while writing my Django application in hard coding all the

  • 0

I made a mistake while writing my Django application in hard coding all the URLs in my templates.

For instance, my links look like:

<a href="/course/63/">Advanced Basketweaving</a>

Now, my client adamantly wants me to change all instances of links akin to this one to

<a href="/class/63/">Advanced Basketweaving</a>

where “class” replaces “course”.

In the words of Emerson, a foolish consistency is the hobgoblin of little minds, so I must pay for my mistake by undertaking a painstaking find and replace operation.

What was the right thing to do here?

  • 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-28T05:39:31+00:00Added an answer on May 28, 2026 at 5:39 am

    Assuming your urls.py had an entry like this:

    url(r'^course/(?P<course_id>\d+)/$', view_course, name='view_course')
    

    You could have used the url template tag in your template:

    <a href="{% url view_course course.id %}">Advanced Basketweaving</a>
    

    Then when your client asked you to change the urls, you would have to make only one change in your urls.py.

    url(r'^class/(?P<course_id>\d+)/$', view_course, name='view_course')
    

    No change would be required in the templates.

    Happy search and replacing — now you know for next time 😉

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

Sidebar

Related Questions

I am an intermediate C programmer. If you have made any coding mistake that
While building a program, I made a mistake and chose do not ask again
I have made the mistake when starting the coding an iPhone App of not
I made the mistake of modifying my original source after importing it into subversion.
EDIT: I had made a mistake during the debugging session that lead me to
-edit- nevermind, i made a mistake in my select statement. Update was working correctly.
I've made the same mistake many times: I've tried to use a Stream that
I do not mean the compile errors because I made a syntax mistake or
IMPORTANT EDIT: Sorry everyone, i made a big mistake in the structure. char *name;
A while ago, I wrote a web-based guestbook application that wrote it's own database.

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.