I'm new to python and started out by having everything in one big
file.

/gae
 app.yaml
 main.py
 templates/

I'm using template_file = os.path.join(os.path.dirname(__file__),
'templates',  "index.html") to find the template directory.

I was able to move my models out of the big file into /gae/models/
db.py

I use:

import from models.db model1, model2, etc.

I'm now trying to cut up the big file into modules.  Say that
displaying classes all go into one module.

When I try putting them into /gae/controllers, I've got several
problems:

1. files don't know where to find the templates

2. I have some variables that I used as globals.  For example:
now=datetime.datetime.today() and today=datetime.date.today()    even
if I use global now, today they aren't accessible via a different
module.  I could put them into memcache but there's not that many and
they are constants  With the obvious exception of now and today, of
course.

3. nagging concern over functions working.   If I have a def SendMail
function that just takes to, subject and the message body, does it
belong in main.py?  Or can it go anywhere?

I'd be fine with

/gae
   app.yaml
   controllers/
     1.py
     2.py
     main.py
     templates/
         index.html
   main.py
   models/
     db.py

Meaning that if templates is under controllers, fine.   Or if it's
moving to /gae/app/controllers instead of gae/controllers

Thanks for any suggestions.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to