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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:25:44+00:00 2026-05-15T02:25:44+00:00

Heyy there, i have for example a view function like this: def profile_view(request, id):

  • 0

Heyy there,
i have for example a view function like this:

def profile_view(request, id):
    u = UserProfile.objects.get(pk=id)
return render_to_response('profile/publicProfile.html', {
    'object_list': u,

    }, 
    context_instance=RequestContext(request)) 

and the url:
url(r’^profile_view/(?P\d+)/$’,
profile_view,
name=’profile_view’),

my problem is that i want to use the function’s url in another template too, for example
in the search in blog template, where people see the posts of some persons, and they want to navigate to their profile.
the search view may look like that:

def searchn(request):
query = request.GET.get('q', '')
if query:
    qset = (
        Q(post__iexact=query) 
            )
    results = New.objects.filter(qset).distinct()
else:
    results = []
return render_to_response('news/searchn.html',{        
'results': results,
'query': query},
context_instance=RequestContext(request))

and the template:

{% if query %}

Results for “{{ query|escape }}”:

{% if results %}
  <ul>
  {% for object in results %}
    <li>{{ object.post }} <a href='../../accounts/profile_view/{{object.id}}/'>  {{ object.created_by }} </a> {{object.date}} </li> 
  {% endfor %}
  </ul>
{% else %}
  <p>No posts found</p>
{% endif %}

{% endif %}

there, in created_by, i’d like to put a link to my user profile, but the user profile view doesn’t ‘point’ to this template.
What shoul i do?
Thanks!

  • 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-15T02:25:45+00:00Added an answer on May 15, 2026 at 2:25 am

    You usually don’t call model or view functions from a template, you link to URLs which in turn be dispatched to view functions.

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

Sidebar

Related Questions

Heyy can somebody help me ? i have this issue that still do know
heyy there i want to parse a text,let's name it 'post', and 'urlize' some
heyy guys.... i know this is probably a silly error but i really tried
I have this table: id track_name datetime weight 1 aName 2010-06-01 09:00:00 1 2
Heyy guys, i have one short question: What programming language/framework do you think is
Heyy Everybody! I am trying to create a memory management system, so that a
I have a really simple chat application on a site which works pretty good.
Is there a bug to tag a photo on sdk? Because I read something,
Heyy guys, please help me. I am from 4 days on dreamhost setting up
I'm facing this abnormal situation. The following code doesn't work properly: string temp =

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.