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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:57:52+00:00 2026-06-18T12:57:52+00:00

Sorry to post yet another question related to the error: ‘WSGIRequest’ object has no

  • 0

Sorry to post yet another question related to the error:

‘WSGIRequest’ object has no attribute ‘find’

But I really can’t find the answer anywhere.

I’m trying to use the django_model_comments app, which extends django’s included comment app.
Did everything the page tells, however when running the server, I get the following:

Environment:

Request Method: GET
Request URL: http://localhost:8000/feed/1

Django Version: 1.4.3
Python Version: 2.7.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'model_comments',
 'django.contrib.comments',
 'pinax_theme_bootstrap_account',
 'pinax_theme_bootstrap',
 'django_forms_bootstrap',
 'account',
 'metron',
 'user_app',
 'feed_app']
Installed Middleware:
['django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware']

Template error:
In template D:\Docs\Work\repo\project\feed_app\templates\feed.html, error at line 10
   'WSGIRequest' object has no attribute 'find'
  1 : {% load model_comment_tags %}
  2 : {% get_comment_form for feed as post_form %}             
  3 : {% render_comment_form post_form %}

Traceback:
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\core\handlers\base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "D:\Docs\Work\repo\project\feed_app\views.py" in get_user_feed
  37.                     'feed': private_feed})
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\base.py" in render
  140.             return self._render(context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\base.py" in _render
  134.         return self.nodelist.render(context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\base.py" in render
  823.                 bit = self.render_node(node, context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\debug.py" in render_node
  74.             return node.render(context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\defaulttags.py" in render
  281.                 return nodelist.render(context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\base.py" in render
  823.                 bit = self.render_node(node, context)
File "D:\Docs\Work\repo\so_virtual_env\lib\site-packages\django\template\debug.py" in render_node
  74.             return node.render(context)
File "D:\Docs\Work\repo\project\model_comments\templatetags\model_comment_tags.py" in render
  26.         return self.func(context)
File "D:\Docs\Work\repo\project\model_comments\templatetags\model_comment_tags.py" in wrap
  75.         form.set_request(request)
File "D:\Docs\Work\repo\project\model_comments\forms.py" in set_request
  106.             self.fields['from_url'].initial = unicode(Url(request))
File "D:\Docs\Work\repo\project\model_comments\url_util.py" in __init__
  11.         self.scheme, self.netloc, self.path, self.params, self.query_string, self.fragment = urlparse.urlparse(url)
File "C:\Python27\Lib\urlparse.py" in urlparse
  134.     tuple = urlsplit(url, scheme, allow_fragments)
File "C:\Python27\Lib\urlparse.py" in urlsplit
  173.     i = url.find(':')

Exception Type: AttributeError at /feed/1
Exception Value: 'WSGIRequest' object has no attribute 'find'

And the error happens when a templatetag is used:

html = "{% load model_comment_tags %} \
        {% get_comment_form for feed as post_form %}\
        {% render_comment_form post_form %}"
t = template.Template(html)
html = t.render(RequestContext(request, {'feed': private_feed}))

I’ve checked all my middleware, the order of apps, deleted .pyc files, and made all sorts of experiments in the template.

  • 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-06-18T12:57:53+00:00Added an answer on June 18, 2026 at 12:57 pm

    There’s a bug in the django_model_comments library, because here they pass the HttpRequest object, not a string which is what the Url class here is expecting, so instead it should call the build_absolute_uri() method on the request object and then pass the string to the Url class.

    So basically replace

    unicode(Url(request))
    

    with

    unicode(Url(request.build_absolute_uri()))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry but yet another question on JavaScript. From my previous post, I was able
I am sorry to post question hich was here before, but this is driving
Sorry for this long post. The question is however small but requires full detail.
I'm sorry if this subject has already been answered, but I couldn't find what
I'm sorry to post a question that's already been posted many times. But I
Sorry for the double post, I will update this question if I can't get
Sorry to put a post up about something so simple, but I don't see
Sorry is this is not the correct forum to post this, but I'm running
sorry for the long question. I am trying to ajax post to collect a
Sorry guys, I can't post images yet, so if it's not too much trouble,

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.