Does main() need to be in every script containing handlers?
- by Will Merydith
Experienced Java programmer trying to learn Python. I have an applicaiton on Google App Engine and want to move my admin Handlers to a separate file. So now I have main.py and admin.py. I've set up app.yaml to route traffic properly, and have added the call to WSGIApplication() in each file to route to the appropriate Handler.
My question is does each script file need def main() and the corresponding if statement:
application = webapp.WSGIApplication([(r'/admin/(.*)', Admin)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()