Python RQ not working with frappe commands

http://python-rq.org/docs/
A RQ program , which works fine in my server.

success = q.enqueue(count_words_at_url, ‘http://nvie.com’)

But when I given any frappe command to ‘count_words_at_url’, its showing up error.
I just add a ‘frappe.msgprint’ in ‘count_words_at_url’ , getting error:

‘RuntimeError: no object bound to flags.’

If given db commands like,
‘frappe.get_doc’ in ‘count_words_from_mydb’

failed = q.enqueue_call(func=count_words_from_mydb, args=(‘any_args’,),timeout=30,result_ttl=50000)

Getting error:
‘RuntimeError: no object bound to db.’

You have to pass the sitename (frappe.local.site)

and then init the site frappe.init(site)

share your code, we can help