3

I'm working on a python app that will run on top of Google App Engine. I setup my app up with the following directory structure:

approot/
  app.yaml
  index.yaml
  myapp.py
  controllers/
   some_controller.py
   some_controller1.py
  models/
  views/

...etc...

My problem is that the development server will not always automatically reload my code when I make changes even though Google's documentation says it will.

The only time it does reload my code is when the change I make is in the top level directory of my app. Anything in a subdirectory (e.g. controllers) is ignored. I have to stop and start the server every time a change is made.

I find this really impedes my progress in development, especially since there is no restart button, you actually have to hit stop and then start.

Is there a remedy for this or am I just doing it wrong? I really like having a well organized project and would rather not dump all my files in the top level directory.

joshwbrick
  • 5,882
  • 9
  • 48
  • 72
  • Please file a bug report at: http://code.google.com/p/googleappengine/issues/list – Michael Aaron Safyan Apr 01 '11 at 02:50
  • I'm hesitant to file a bug as I don't know if I'm doing something incorrectly or if this is an actual bug. Heck it may even be a feature request for all I know :) – joshwbrick Apr 01 '11 at 02:55
  • If it's not doing what you want it to do, it's a short coming. If nobody has reported something similar, then it's not a duplicate. Even if the project owners disagree with your opinion of how it should work, that should be documented. File a bug report! – SingleNegationElimination Apr 01 '11 at 03:05
  • OK, bug filed: http://code.google.com/p/googleappengine/issues/detail?id=4830 – joshwbrick Apr 01 '11 at 03:36
  • @macinhosh I am using pydev plugin in eclipse and i don't have any problem in seeing the changes without restarting the server even in the sub directory. Which os you are using? – Abdul Kader Apr 01 '11 at 04:27

2 Answers2

1

The reload mechanism is likely tied to the default import mechanism and builtin __import__ function. If you (or your framework) load your modules in some other, clever way, the reloader might not notice. A possible workaround is to explicitly import key modules in your myapp.py module.

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
  • I'm using from ... import ... would that fall under the default import mechanism? I'm still pretty new to Python so pardon my ignorance :) – joshwbrick Apr 01 '11 at 02:53
  • Are the modules that you are changing being imported in that way, in `myapp.py`? – SingleNegationElimination Apr 01 '11 at 03:06
  • Yes in myapp.py I have something like: "from SomeController import SomeController" SomeController is a class declared in controllers/SomeController.py with the path being relative to myapp.py – joshwbrick Apr 01 '11 at 03:17
  • If you're interested you can download some sample code that replicates this issue from my bug report: http://code.google.com/p/googleappengine/issues/detail?id=4830 – joshwbrick Apr 01 '11 at 03:37
0

double check that you have installed pyobjc

the dev server will complain like this:

UserWarning: Detecting source code changes is not supported because your Python version does not include PyObjC (http://pyobjc.sourceforge.net/). Please install PyObjC or, if that is not practical, file a bug at http://code.google.com/p/appengine-devappserver2-experiment/issues/list.

sebastian serrano
  • 1,047
  • 12
  • 12