Note that there are some explanatory texts on larger screens.

plurals
  1. POError from python-oauth2: "TypeError while rendering: must be string or buffer, not None"
    primarykey
    data
    text
    <p>I'm trying to get my Twitter timeline on my website which I'm making in Django. To do so, I've found a nice piece of code on <a href="http://www.pixeldonor.com/blog/2010/aug/15/create-simple-twitter-app-django/" rel="nofollow">http://www.pixeldonor.com/blog/2010/aug/15/create-simple-twitter-app-django/</a> which I implemented on my local development copy of the website. Locally everything works perfectly! The tweets are shown and I get no errors what so ever.</p> <p>Now that I've deployed my website online, I seem to have run into an error which I can't solve. </p> <p>This is the error I get:</p> <hr> <pre><code>TemplateSyntaxError at / Caught TypeError while rendering: must be string or buffer, not None Request Method: GET Request URL: http://marcostrijker.com/ Django Version: 1.3 Exception Type: TemplateSyntaxError Exception Value: Caught TypeError while rendering: must be string or buffer, not None Exception Location: /home/mstrijker/lib/python2.7/oauth2-1.5.170py2.7.egg/oauth2/__init__.py in sign_request, line 493 Python Executable: /usr/local/bin/python Python Version: 2.7.1 Python Path: ['/home/mstrijker/webapps/django/vorm4ufolio', '/home/mstrijker/webapps/django', '/home/mstrijker/webapps/django/lib/python2.7', '/home/mstrijker/lib/python2.7/oauth2-1.5.170-py2.7.egg', '/home/mstrijker/lib/python2.7/httplib2-0.6.0-py2.7.egg', '/home/mstrijker/lib/python2.7/pip-1.0.1-py2.7.egg', '/home/mstrijker/lib/python2.7', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages/PIL'] Server time: Thu, 12 May 2011 21:05:17 +0200 </code></pre> <hr> <p>After that it displays the following: </p> <blockquote> <p>Template error</p> <p>In template /home/mstrijker/webapps/django/vorm4ufolio/templates/index.html, error at line 85</p> <p>Caught TypeError while rendering: must be string or buffer, not None</p> </blockquote> <pre><code>&lt;div id="twitter"&gt; &lt;a href="http://twitter.com/#!/Octopixell"&gt;&lt;img src="{{ STATIC_URL }}images/twitter_icon.png" alt="twitter_logo"&gt;&lt;/a&gt; &lt;div id="tweetcontainer"&gt; {% get_tweet_list 5 as tweets %} {% for tweet in tweets %} &lt;div class="tweettop"&gt;&lt;/div&gt; &lt;div class="tweet"&gt; {{ tweet.text|safe|twitterize }} &lt;br /&gt; {{ tweet.created_at|date:"M d, Y" }} &lt;/div&gt; &lt;div class="tweetbottom"&gt;&lt;/div&gt; {% endfor %} &lt;/div&gt; &lt;/div&gt; </code></pre> <p><code>{% get_tweet_list 5 as tweets %}</code> is line 85</p> <hr> <p>Also here is the traceback of the error:</p> <pre><code>Traceback: File "/home/mstrijker/webapps/django/lib/python2.7/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/home/mstrijker/webapps/django/vorm4ufolio/portfolio/views.py" in index 17. return render_to_response('index.html', {'new_list': new_list,}, context_instance=RequestContext(request)) File "/home/mstrijker/webapps/django/lib/python2.7/django/shortcuts/__init__.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/home/mstrijker/webapps/django/lib/python2.7/django/template/loader.py" in render_to_string 188. return t.render(context_instance) File "/home/mstrijker/webapps/django/lib/python2.7/django/template/base.py" in render 123. return self._render(context) File "/home/mstrijker/webapps/django/lib/python2.7/django/template/base.py" in _render 117. return self.nodelist.render(context) File "/home/mstrijker/webapps/django/lib/python2.7/django/template/base.py" in render 744. bits.append(self.render_node(node, context)) File "/home/mstrijker/webapps/django/lib/python2.7/django/template/debug.py" in render_node 73. result = node.render(context) File "/home/mstrijker/lib/python2.7/oauth2-1.5.170-py2.7.egg/oauth2/__init__.py" in request 662. req.sign_request(self.method, self.consumer, self.token) File "/home/mstrijker/lib/python2.7/oauth2-1.5.170-py2.7.egg/oauth2/__init__.py" in sign_request 493. self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest()) Exception Type: TemplateSyntaxError at / Exception Value: Caught TypeError while rendering: must be string or buffer, not None </code></pre> <p>I hope this will provide you guys with the necessary information required to help me solve this problem. If you guys need more info or code just ask me and I'll provide it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload