fergalwalsh / pico

Pico is a very small web application framework for Python.
http://pico.readthedocs.io/
186 stars 41 forks source link

Pico cannot find module #2

Closed crystalq closed 12 years ago

crystalq commented 12 years ago

I am not having any success calling the example module, provided by the example. Is there a specific directory I should place the example.py in? I get the following error: "GET /pico/call/?_module=pico.server&_function=load&module_name=%22example%22&_callback=jsonp14922499508 HTTP/1.1" 500 426"

fergalwalsh commented 12 years ago

Any module that you wish to load from pico must be on the python path or in the directory that you started pico from. It just does import example internally.

crystalq commented 12 years ago

I am calling python -m pico.server in a folder with both index.html and example.py and am still getting this same error.

fergalwalsh commented 12 years ago

Ok, that is correct. Can you please post the error message that appears in the Javascript console in your browser? Also please verify that your module (example.py) includes import pico.

crystalq commented 12 years ago

Yes, example.py includes import pico. The error console says "Example is not defined." My index.html and example.py files are exactly like your Example 1: Hello World ones.

fergalwalsh commented 12 years ago

Ok it turns out I introduced a bug into the latest version a few days ago that I somehow missed. I am very sorry for the hassle. If you clone the latest version it should work. Please let me know how it goes.

crystalq commented 12 years ago

Great, it works now. Thanks!