> turbogears+unsubscribe@googlegroups.com.
Hi
Which version of turbogears? My solution is explicitly only for turbogears2. That might be the reason TGController is not available
Hi, Alessandro!
I'm trying to use Your solution.
I've got a question:
from ???? import TGController
import TGController does not work...
Best regards.
Maxim.
вторник, 19 июня 2012 г., 0:28:58 UTC+4 пользователь Alessandro Molina написал:
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/groups/opt_out.
# -*- coding: utf-8 -*-
from tg.controllers.tgcontroller import TGController
from tg.predicates import not_anonymous
from tg import expose, config
import os
try:
from tg.controllers import WSGIAppController
except ImportError:
from tg.controllers.wsgiappcontroller import WSGIAppController
try:
from paste.urlparser import StaticURLParser
except ImportError:
from webob.static import DirectoryApp as StaticURLParser
class PrivateStatics(TGController):
@expose()
def lookup(self, *args):
site_dir = os.path.join(config.get('here'), '/myapp/private')
return WSGIAppController(StaticURLParser(site_dir), allow_only=not_anonymous()), args
_lookup = lookupwhat am I doing wrong or how can I set this option ?
# -*- coding: utf-8 -*-
from tg.controllers.tgcontroller import TGController
from tg.predicates import not_anonymous
from tg import expose, config
import os, tg
try:
from tg.controllers import WSGIAppController
except ImportError:
from tg.controllers.wsgiappcontroller import WSGIAppController
from paste.urlparser import StaticURLParser
from webob.static import DirectoryApp
class PrivateStatics(TGController):
@expose()
def lookup(self, *args):
site_dir = os.path.join(config.get('here'), 'myapp/private')
# return WSGIAppController(StaticURLParser(site_dir), allow_only=not_anonymous()), args
return DirectoryApp(site_dir)(tg.request)
_lookup = lookupreturn DirectoryApp(site_dir)(tg.request), args
adding args on the end of line results as 404 error,return DirectoryApp(site_dir)(tg.request), args
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.