python - Heroku instance generated missing some attributes -
python newbie here! i'm having trouble deploying script on heroku - works fine locally, once on heroku gives me log:
2015-04-28t09:48:43.362570+00:00 heroku[web.1]: state changed crashed starting 2015-04-28t09:48:47.047556+00:00 heroku[web.1]: starting process command `python reddit_bot2.py` 2015-04-28t09:48:49.458189+00:00 app[web.1]: :0: userwarning: keyword `bot` in user_agent may problematic. 2015-04-28t09:48:50.075734+00:00 app[web.1]: logging in reddit... 2015-04-28t09:48:58.757114+00:00 app[web.1]: accessing subreddit... 2015-04-28t09:48:58.757095+00:00 app[web.1]: logging goodreads api... 2015-04-28t09:49:03.040120+00:00 app[web.1]: grabbing submission 1 2015-04-28t09:49:05.056468+00:00 app[web.1]: grabbing comment 1 2015-04-28t09:49:05.056661+00:00 app[web.1]: querying: disappearing spoon 2015-04-28t09:49:05.056790+00:00 app[web.1]: file "reddit_bot2.py", line 119, in <module> 2015-04-28t09:49:05.056785+00:00 app[web.1]: traceback (most recent call last): 2015-04-28t09:49:05.056885+00:00 app[web.1]: main() 2015-04-28t09:49:05.056956+00:00 app[web.1]: file "reddit_bot2.py", line 76, in main 2015-04-28t09:49:05.057002+00:00 app[web.1]: rating, desc, link, authors = query_goodreads(comment_text) 2015-04-28t09:49:05.057035+00:00 app[web.1]: file "reddit_bot2.py", line 93, in query_goodreads 2015-04-28t09:49:05.057071+00:00 app[web.1]: query = gc.search_books(q, page= 1, search_field= 'all') 2015-04-28t09:49:05.057111+00:00 app[web.1]: attributeerror: goodreadsclient instance has no attribute 'search_books' 2015-04-28t09:49:06.022454+00:00 heroku[web.1]: state changed starting crashed 2015-04-28t09:49:06.005309+00:00 heroku[web.1]: process exited status 1
the main error being attributeerror.
searching around, others encounter error on django, solutions seem django, , script doesn't use - use python api wrapper goodreads (found here). modified code bit try list down instance's attributes.
print(dir(gc))
gc being goodreadsclient instance, , prints list of attributes
['doc', 'init', 'module', 'auth_user', 'authenticate', 'author', 'base_url', 'book', 'book_review_stats', 'client_key', 'client_secret', 'find_author', 'find_groups', 'group', 'list_comments', 'list_events', 'owned_book', 'query_dict', 'recent_reviews', 'request', 'request_oauth', 'review', 'search_books', 'user']
which consistent documentation of api wrapper. once deployed, prints
['doc', 'init', 'module', 'auth_user', 'authenticate', 'author', 'base_url', 'book', 'book_review_stats', 'client_key', 'client_secret', 'find_groups', 'group', 'list_comments', 'list_events', 'owned_book', 'query_dict', 'recent_reviews', 'request', 'request_oauth', 'review', 'user']
which missing 'find_author' , 'search_books' attributes (search_books being attribute giving error once on heroku). what's causing these attributes go missing? there workaround?
my script, if helps.
Comments
Post a Comment