Hi all, am wondering if I'm doing this right.

I want to split a huge py file into ten parts ( or controllers, if you
will). The reason being it's neat, each part will serve a certain
function. But I worry if I am taxing the app engine server bcos the
imports in each part are repetitive.

*****app.yaml*****
handlers:
- url: /part1
  script: controllers/part1.py
- url: /part2
  script: controllers/part2.py

# this goes on until part10.py


*****part1py (this is the entry point of the application)*****

# all required imports ( about 20 imports, some from app engine, some
from external libs )

class Part1(webapp.RequestHandler):

  # a lot of code here

  # point to template
  path = os.path.join(os.path.dirname(__file__), 'templates/
part1.html')

  template_values = { 'variable ':variable }

  # render template
  self.response.out.write(template.render(path, template_values))

# the standard WSGI calls
application = webapp.WSGIApplication([('/part1', Part1)],debug=True)
def main(): run_wsgi_app(application)
if __name__ == "__main__": main()

***************************************************

for part2.py until part10.py, it follows the exact same format as
part1.py. It's been working for me.

so the question is, can I keep doing this as my application grows ( as
I add more code/functionality) ? Is this the way to expand all the way
up to N numbers of .py files? What are the drawbacks?


Hope you guys can give some insights on this.
Been thinking about this for weeks.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to