turbogears

good beginner tutorial for turbogears 2

I find myself struggling to do simple things that would normally take me about 5 minutes to do in PHP. At the moment, I'm trying to create a basic form which will print the details on another page when you click submit. Looking at the documentation, I find examples but none explaining why it works in such a way. ...

Can Core Data be used on Linux?

This might be a stupid question, but I was wondering whether or not you can use the Core Data libraries on Linux at all? I'm planning how to build the server side of an iPhone app that I'm working on, and have found that you can use PyObjC to get access to Core Data in a Python environment, e.g. use Core Data in a TurboGears web applica...

TurboGears 2.1 @expose renderer with custom mime type

We have a TurboGears 2.1 application where we have added several renderers, but I'm having trouble getting them to set the correct MIME type. In config/app_cfg.py we enable the renderers: class LITSAdminConfig(AppConfig): def setup_csv_renderer(self): self.render_functions.csv = render.render_csv def setup_pdf_renderer(...

Serving files with Turbogears2

How do I serve files from an arbitrary directory with Turbogears2? I have a database with the local path, e.g. /home/myuser/tg2env/MyProject/myproject/files/somefile.jpg tg.url seems to only be able to serve things from the public directory. Is there a widget available, or do I need to write some sort of DownloadController? ...

Returning Database Blobs in TurboGears 2.x / FCGI / Lighttpd extremely slow

Hey everyone, I am running a TG2 App on lighttpd via flup/fastcgi. We are reading images (~30kb each) from BlobFields in a MySQL database and return those images with a custom mime type via a controller method. Caching these images on the hard disk makes no sense because they change with every request, the only reason we cache these in...

Redirect to home when a 403 error occoured in Turbogears 3

I am in a standard paster-generated turbogears 2 project. I am using: allow_only = not_anonymous(msg=l_(u'You must be logged in')) And I am using generated error.py controller. The issue is that I want to redirect the user to the front page('/') when the error controller identifies and 403 error. Then I have tried tg.redirect(url('...

Return another controller method inside a controller method in turbogears 2

In turbogears 1 that was easy: Class controller(Controller) @expose() def method1(self, **kw): print 'bla' return self.method2(**kw) @expose('template2') def method2(self, **kw): print 'bli' return dict(**kw) when I call method1, what I got was the template2 called by method2. but in t...

Simple ascii url encoding with python

look at that: import urllib print urllib.urlencode(dict(bla='Ã')) the output is bla=%C3%BC what I want is simple, I want the output in ascii instead of utf-8, so I need the output: bla=%C3 if I try: urllib.urlencode(dict(bla='Ã'.decode('iso-8859-1'))) doesn't work (all my python files are utf-8 encoded): 'ascii' codec can't ...

Log controller requests to syslog in tg2

Is there any built-in automate way to log controller request events to system log? ...

Any good client-server data sync frameworks available for iPhone?

I'm just getting into the client-server data sync stage of my iPhone app project, and have managed to get my CoreData data model loading on both the iPhone client and my TurboGears server (which is good). I'm now beginning to tackle the problem of sync'ing data between the server and multiple clients, and while I could roll my own, this...

Am I supposed to directly modify User models in auth modules in frameworks?

I am new to using Frameworks for web development and I have noticed that frameworks like django, turbogears etc come with auth packages which contains user models. Am I supposed to directly modify these and use them as my User models or am I supposed to associate my own user models to these and use them just for authentication? ...

How will Turbogears reach the critical mass of Ruby on Rails?

I've been using Turbogears since I have a Python background, but I can't help feeling a pang of jealously seeing all the Ruby on Rails resources available. For example, for a crude comparison of the volume of resources, check out http://www.google.com/trends?q=turbogears%2C+ruby+on+rails What would it take for Turbogears to reach the c...

How do I Handle Database changes and port my data?

Example, for web applications using Turbogears and SQLAlchemy. Every time I update my data model, I need to delete my database and recreate it. Is there an easy way to update the production database? Do I have to write a custom script that transfers all the production data into a new database model? Or is there an easier way to upgra...

turbogears and mobile site

is it possible to develop mobile versions of webpages using turbogears.can someone please show me an example and how it is done.need it urgently.thanks ...

Saving RAM on Shared Hosting with persistent process web service (e.g. Ruby on Rails, Turbogears, etc.)

I use Turbogears on my shared hosting for one-off applications, but I don't need these applications active all the time. Is there a way to start the service when I request it, and then kill the process when it's idle? For example, Turbogears will have a persistent process: "paster serve production.ini" that I would like killed if there...

Psycopg2 under osx works on commandline but fails in Aptana studio

Howdy, I have been developing under Python/Snowleopard happily for the part 6 months. I just upgraded Python to 2.6.5 and a whole bunch of libraries, including psycopg2 and Turbogears. I can start up tg-admin and run some queries with no problems. Similarly, I can run my web site from the command line with no problems. However, if I tr...

Django, Turbo Gears, Web2Py, which is better for what?

I got a project in mind that makes it worth to finally take the plunge into programming. After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experiment...

How to let actions support more parameters?

I'm using pylons, and my action of controller is: class UserController(BaseController): def create(self): name = request.POST['name'] email = request.POST['email'] password = request.POST['password'] ... But I found in turbogears, I can do like this: class UserController: de...

How to use mod_passenger for Turbogears 2?

What do I put in passenger_wsgi.py for a Turbogears2 site? Since it's possible for Django to use mod_passenger, I'm trying to use mod_passenger with Turbogears2. So far, I've found a passenger_wsgi.py for Turbogears1, but I don't know where to start to make a passenger_wsgi.py for a Turbogears2 site. Here's the Turbogears1 example: ht...

Turbogears2 and py.test

I'm switching our testing environment from Nose to py.test for testing a Turbogears2 web application. Currently, when Nose runs it gathers information from a testing configuration file (test.ini) that holds all the testing variables the application needs. And it seems to do so in an automatic way (I'm simply running nosetests and everyt...