Debugger in python for Google App Engine and Django - django

I am having a problem that has baffled me for over a week. I have a project that is written in python with Django on Google App Engine. The project has a login page and when I run the application in Google App Engine or from the command line using dev_server.py c:\project, it works fine. When I try to run the application through a debugger like Wing or Pycharm, I cannot get past the login page. After trying to login, it takes me back to the login screen again. When I look at the logs, it shows a 302 (redirect) in the debugger but normally it shows a 200 (OK). Could someone explain why this would be happening?
Thanks
-Dimitry

This isn't really a great answer since I don't know much about Wing or Pycharm. But dev_appserver reroutes stdin and stdout to the WSGI handler. If you hit a breakpoint set by pdb.set_trace(), the breakpoint usually drops you to a shell that uses stdin/stdout, but with dev_appserver, you'll see the debugger shell piped to your HTTP, and there's no input available.
I'm not sure how Wing/Pycharm handle this. Pydev with eclipse works with dev_appserver, but that might be because of the GAE eclipse plugin.
I find myself often embedding breakpoints in my code and debugging manually at the shell, mostly because it runs way faster than in the pydev debugger. I do this be rerouting stdin/stdout back to the terminal when I hit a breakpoint. http://eatdev.tumblr.com/post/12076034867/using-pdb-on-app-engine
I'm on a linux environment. I did work with the GAE app launcher on Windows for a little bit, but not recently. I think I recall the app launcher hiding the original terminal that launches dev_appserver, so you might have to launch dev_appserver from the command prompt for this to work. I suspect you may need similar hacks if Wing or Pycharm use pdb underneath.

After a week of racking my brain, I finally figured out the problem. The gaesessions code was the culprit. We put DEFAULT_LIFETIME = datetime.timedelta(hours=1) and originally it was DEFAULT_LIFETIME = datetime.timedelta(days=7). Not sure why running it through any debugger such as wing or pycharm would prevent the browser from getting a session. The interesting thing is the code change with hours=1 works fine on linux with wing debugger. Very Strange!

Related

Conemu recommends using Admin mode, when it's already being used

I'm running it as an Admin, but it's saying.
"Possible cause in case you did not touch the mouse while script was running:
Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin."
So not sure how to disable this feature as it's definitely running as an Admin.
As mentioned in comments, this is not a ConEmu message, this is SikuliX message. To confirm this, you can try running your script from Windows command line while launching the cmd terminal as Admin. This will both, ensure that you are running as Admin and verify the actual reason why you are getting this message.

Calabash how to speed up execution time

I have a Android device connected to my PC.
Running a calabash test I use the following command:
calabash-android run <NAME>.apk features/<NAME>.feature
Now before running a feature Calabash always uploads the application again witch takes time.
How can I disable this?
Any help would be appreciated!
Thank you!
You can control the reinstallation of the app using the hooks file. This contains the cucumber hooks for before and after scenario. If you didn't make the hooks file that you are running then it's probably one from a sample project.
The bit you're looking for is the 'reinstall_apps' command. If you remove it completely then your app won't ever be reinstalled, which can be a bad thing as it's sometimes necessary to reset the app completely. The way I handle it is to tag the features where I do want the app reinstalled with #reinstall_app and then
Before do |scenario|
puts "Starting scenario - #{scenario.name}"
reinstall_app if scenario.source_tag_names.include?('#reinstall_app'))
...
end

Ember-cli: Stop or restart server

Is there a quick way to stop or restart the server in ember-cli? Specially, when you've hit an error and need to restart it. Currently, I just close the window and reopen it, but that gets tedious when I'm making large changes to my Brocfile.js and such. Thanks.
I think it's important to note that This has nothing to do with ember.js or ember CLI. This is an issue with your terminal.
control + C
will terminate the current process in your terminal shell.
If it doesn't, then you should be checking your OS, or the type of terminal you are using.

Unable to debug glassware- Google glass

I am unable to debug glassware.I have tried the solution in this thread How to debug Google Glass GDK application?
This application uses voice commands, It gets installed but doesn't start the default activity.I am unable to find any classes to select in the run configurations.But messages are logged in Log cat.
Update:By activating DDMS I am able to debug.. But its strange that after few times of debugging, app stops working .. I dont get any exceptions logged.
You generally don't setup a default activity for Glass since there's not a way to "run" a specific application. You will likely want to set up a voice command and add a listener for that voice command. This is how your application will launch.
Even with no exceptions, could you post your LogCat output? This might help to shed a little more light on the issues you're having. I've been able to debug applications without any issues, so I know it's possible.

NACL Isn't Loading Modules?

I'm wanting to start developing with NaCl / Pepper and I've gotten my build environment working great, but I can't seem to use any of the examples in my browser.
I've enabled Native Client, debugging, etc. But none of the modules seem to trigger the 'loaded' event, so I have no idea what is going on. This goes for .pexe and .nexe
I have the git here, and I honestly have no idea if there's a problem with my build process, my browser configuration, or what. Has anybody got a clue what's going on here?
This is the closest I've gotten to an error message, and apparently this is a chrome runtime flag, but running chrome with this flag has no effect, and now instead of working, no messages are output.
Try disabling debugging. Enabling debugging means that the NaCl loader will start the Native Client module, and then immediately suspend it and wait for the debugger to connect (then you can resume it with the debugger). So if you don't connect a debugger it will just wait forever. Also if you want to use the debugger on Windows, you need to disable Chrome's sandbox to allow the local TCP connection (for the record, the error message that gets cut off in the screen shot links to the following chrome bug)