I've run into what strikes me as an odd exception when using the gdata-
python-client library in Django 1.0 on Python 2.5 and the dev
environment server.
For context, this is a very simple sandbox app for playing with the
picasa web album API. It contains no data models. I have my urls set
up to match the "blah" part in
http://project/app/blah/ and send it to
the view function as the "bla_id" param, which is used to specify
which picasa photos are retrieved by tag.
The view looks a little like:
#
def app_view(request, blah_id):
gd_client = gdata.photos.service.PhotosService()
photos = gd_client.GetFeed('/data/feed/api/user/%s/albumid/%s?
kind=photo&tag=%s' % ('username', 'album id', blah_id)
return render_to_response('/app/app_view.html', {'photo_list':
photos.entry})
#
and python throws:
Exception Type: AttributeError at /app/blah/
Exception Value: 'NoneType' object has no attribute 'rfind'
The line at fault appears to be the one with the GetFeed query.
While shuffling the code around, I can return a HttpResponse(blah_id)
and it will display the text I've fed the url. I can also hard code
"blah" in the GetFeed call and it will function as desired, which
makes me think it may have to do with some type conversion gotchas
involving the blah_id param I am not up to speed on or something.
I've googled this exception and few of them are specific to django. So
I am not sure if what I am looking at is a problem with my mad python
skillz (which it very well could be) or a problem with Django or what.
Any advice?