1

I am trying to run the example:

https://github.com/litl/rauth/blob/master/examples/facebook/facebook.py

so I run this example from the command line and the output says:

* Running on http://127.0.0.1:5000/
* Restarting with reloader

and the program runs in the foreground. Now I thought let's see what happens when type the url in the browser:

http://127.0.0.1:5000/

and it shows:

jinja2.exceptions.TemplateNotFound

So I thought let's take a closer look into the source code and this is what I found:

Please note: you must do `from facebook import db; db.create_all()` from
the interpreter before running this example!
Due to Facebook's stringent domain validation, requests using this app
must originate from 127.0.0.1:5000.

So I thought may be I have to run this from the python shell. So I type the commands in python shell:

from facebook import db; db.create_all()

Now I get error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named facebook

So I thought may be I should install facebook. So I install it:

pip install facebook

which is a success. So then I run the command again from python shell:

from facebook import db; db.create_all()

now I get error:

Downloading/unpacking facebook.db
  Could not find any downloads that satisfy the requirement facebook.db
No distributions at all found for facebook.db

Now what? I am stuck. Please help someone.

Thanks

user285825
  • 475
  • 4
  • 13
  • Two questions - 1) Have you got the [`templates` folder](https://github.com/litl/rauth/tree/master/examples/facebook/templates) checked out as well? 2) Were you running Python from the same directory that you had `facebook.py` checked out it? (`pip` most likely installed [this library](https://pypi.python.org/pypi/Facebook) which won't know how to do what you are trying to do. – Sean Vieira Jun 25 '13 at 01:15
  • You don't need a "facebook" module: that's a reference to the Flask application itself which happens to be named "facebook". Ensure you have a "templates" directory and that you run the db setup from the top-level facebook directory. – maxcountryman Jun 25 '13 at 01:30
  • Awesome. Thanks for the pointer and quick response. – user285825 Jun 25 '13 at 02:11

0 Answers0