Questions tagged [turbogears2]

TurboGears 2.x is a "best-of-breed" full stack rapid development web framework written in Python.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

How to intercept POST request in TurboGears/repoze.who to invalidate user session when hitting the login_handler url

For a TurboGears 2 web application, when the login form is submitted it POST's to /login_handler. If a user session already exists it will reuse the session id and set that as the cookie. If a session ...
Alternate's user avatar
-1 votes
1 answer
996 views

raise sa_exc.ArgumentError( sqlalchemy.exc.ArgumentError: Mapper mapped class car->car could not assemble any primary key columns for mapped table

I am busy with learning turbogears, which i find a very good and easy to work framework in compare with Django, that gave me many problems with the imports. i have a .py file which i wrote a code, but ...
Alex_Pat's user avatar
0 votes
1 answer
331 views

TurboGears2: TypeError: redirect() got an unexpected keyword argument 'pagename'

This error occurs when following the TG2 wiki20. I could not see an easy answer on here that was related to TG2, and this issue could be quite confusing, as it occurs during the official tutorial. The ...
nihilok's user avatar
  • 1,435
2 votes
1 answer
38 views

Turbogears2: App not starting as sub-package

I'm trying to deploy TurboGears as the sub-package frontend of my main application MainApp. Following, the structure of my project: . ├── MainApp │   ├── MainApp.egg-info │   ├── backend │   ├── ...
ckdo's user avatar
  • 21
0 votes
1 answer
26 views

Turbogears: duplicate controller method for filtered objects

If you have a controller method like so: @expose('example.templates.example.index') def index(self, *args, **kw): fruits=session.query(model.Fruit).all() # some code working on fruits ...
Admed's user avatar
  • 61
0 votes
1 answer
36 views

How to paginate when page using POST requests, in turbogers?

I've been trying to paginate a search results page. Which uses POST requests to submit my search form. I just included the parameters in the pager function and it uses GET method as default. "<a ...
Jayashankar Nair's user avatar
0 votes
1 answer
71 views

Turbogears2 with MySQL db not update tables in multi threads

I am using turbogears2 with MySQL db. With the same code, single thread case can update/write to the tables. But thread thread has no error, however, no write is successful. Outside turbogears2, ...
Simon Wu's user avatar
0 votes
2 answers
40 views

turbogears2 multiply price and cost from rows of query

I know this question has been asked already, but i couldn't really grasp the idea behind the answers as i am a beginner in programming and pretty much everything seems new to me. I am trying to ...
Cami's user avatar
  • 15
0 votes
1 answer
52 views

Using Kajiki & Jinja together in Turbogears doesn't work

I've configured Jinja ( base_config.renderers.append('jinja') ) and used in a controller as follows @expose('jinja:a.b.c.templates.y') def action(self): I've two master layouts "abc.xhtml" and "abc....
5r33naDh's user avatar
1 vote
1 answer
896 views

Suppress 'None' in Jinja2 in TurboGears using Environment.finalize

I've integrated Jinja2 in TurboGears 2.3.12 and in my template file, I have used the following code <input type='text' value='{{ obj.attr }}' /> I got None in the textbox as the object was new....
5r33naDh's user avatar
0 votes
1 answer
92 views

How to create edit forms in Turbogear

How to create edit forms. For url edit?id=1121 I want to display pre-filled data EditForm(twf.Form): class child(twf.TableLayout): name= twf.TextField(name="name",value=DBSession....
user2764578's user avatar
0 votes
1 answer
46 views

Turbogears Toscawidget not working

I searched in this guide and this guide, and I followed the examples. This is my controller in controllers/root.py: @expose('rubrica.templates.submitForm') def add(self, *args, **kw): return ...
JungleFever's user avatar
0 votes
0 answers
133 views

Internal Server Error 500 on my server due to DistributionNotFound who_ldap>=3.2.2

I'm trying to run a Turbogears2 application on WSGI mod under Apache 2.4.25: My virtualhost seems to be ok: /etc/apache2/sites-available/site.conf <VirtualHost *:80> ServerName www....
Dimitri's user avatar
  • 33
0 votes
1 answer
205 views

Python with Turbogears2 : ValueError: invalid literal for int() with base 10: 'DONE'

I'm installing a project. I run theses commands but the 4th always give me this error... python setup.py develop python setup.py bdist_egg (create .egg) paster setup-app development.ini (create ...
Dimitri's user avatar
  • 33
0 votes
1 answer
55 views

How to call foreign relation model Pluggable to other model Pluggable in turbogears 2.3.11?

I used Turbogears 2.3.11. I have 1 application and 2 Pluggable Applications with TurboGears. In Pluggable Applications have own models. How to call model in one Pluggable Application from two ...
padungrat's user avatar
13 votes
1 answer
13k views

Alembic, How to alter a ForeigenKey Column

I'm using Alembic 0.8.9, SQLAlchemy 1.1.4 and my database is a MySQL database. I'm in the process of altering a table and a Foreign column: In my database, I'm renaming 'organs' table to be named '...
A-Palgy's user avatar
  • 1,351
2 votes
3 answers
937 views

debugging containerised python web app

I have made this first docker container, and it works as per the Dockerfile. FROM python:3.5-slim RUN apt-get update && \ apt-get -y install gcc mono-mcs && \ apt-get -y ...
Ciasto piekarz's user avatar
0 votes
1 answer
786 views

dukpy build fails while trying to build container

I am trying to build docker container with following in Dockerfile FROM python:3.5-slim WORKDIR /opt COPY requirements.txt /opt/requirements.txt RUN pip install -r /opt/requirements.txt and ...
Ciasto piekarz's user avatar
1 vote
1 answer
160 views

Simultaneous requests with turbogears2

I'm very new to web dev, and i'm trying to build a simple Web interface with Ajax calls to refresh data, and turbogears2 as the backend. My Ajax calls are working fine and makes periodic calls to my ...
TamTamHero's user avatar
0 votes
1 answer
91 views

Optimizing POSTs-per-second in Turbogears2

In a web game built on Turbogears v2.1.5, logged-in users POST a 16-byte message periodically. The server CPU reaches 100% when the POST rate is 60 POSTs-per-second. (For testing, we have removed ...
web20's user avatar
  • 3
0 votes
1 answer
127 views

Turbogears2 session management

In theory i did what i'm supposed to do in order to store some data in session variables but my controllers can't reach them. Here's the code: @expose('') @require(predicates.not_anonymous()) ...
eeeee's user avatar
  • 3
-2 votes
2 answers
63 views

How to make TurboGears treat '%2F' differently from '/' when routing?

I have a simple TurboGears 2 script, named app.py: #!/usr/bin/env python3 from wsgiref.simple_server import make_server from tg import expose, TGController, AppConfig class RootController(...
Alex Henrie's user avatar
0 votes
1 answer
345 views

problematic dot in url

I got a url parameter which contains 3 dots named token. suppose it is 'boo.foo.joo'. my controller's method which is supposed to handle request only takes the first two parts ('boo.foo'). however I ...
Amin Etesamian's user avatar
1 vote
1 answer
67 views

Which characters does TurboGears replace in the URL?

I have a simple TurboGears 2 script, named app.py: #!/usr/bin/env python3 from wsgiref.simple_server import make_server from tg import expose, TGController, AppConfig class RootController(...
Alex Henrie's user avatar
0 votes
1 answer
113 views

How to consume api rest using TurboGears2?

I want to show the data in the view r = requests.get('https://jsonplaceholder.typicode.com/posts') print(r) print(r.headers) print(r.encoding) data = r.json() log.debug(data) log.debug(r) for post ...
Alex's user avatar
  • 615
1 vote
1 answer
154 views

TypeError is raised when using `abort(404)`

When I use abort(status_code=404, detail='No such user', passthrough='json') This exception is raised: TypeError: 'NoneType' object is not iterable This is the traceback: File "/home/jugger/....
Amin Etesamian's user avatar
0 votes
1 answer
88 views

slqlachemy joined load by variable declaration

Suppose I got two models. Account and Question. class Account(DeclarativeBase): __tablename__ = 'accounts' id = Column(Integer, primary_key=True) user_name = Column(Unicode(255), unique=...
Amin Etesamian's user avatar
0 votes
1 answer
65 views

Require JS and running a command in the baseUrl

So I have narrowed down my problem and was wondering if there was a solution to this or a way to get around it. The code I have been working on in HTML uses a web frame work called turbogears. To ...
Suliman Sharif's user avatar
0 votes
1 answer
114 views

Turbogears integration with Require JS

So I have never used turbogears before but the company I am interning at has turbogears to run their JS files. I am trying to integrate my new JS code into their files but running into repeated errors ...
Suliman Sharif's user avatar
0 votes
2 answers
199 views

Unique ID in html for generating Buttons

sorry if the title is misleading. I'm having the following problem. I am creating multiple rows in HTML using Genshi. For each row I have a button at the end of the row for delete purposes. The ...
Ron's user avatar
  • 165
0 votes
1 answer
192 views

redirect is throwing a "Resource was found at " exception in turbogears 2.3

When a user is accessing a certain controller and if a condition is met, then i want to redirect user to some other page but when I'am trying that it throwing "Resource was found at exception". Below ...
neeraj's user avatar
  • 89
0 votes
1 answer
47 views

ToscaWidgets2 Capture Data from GrowingGridLayout

Currently working on a project with TurboGears2 and ToscaWidgets2. I have a form setup with a few static fields, name, date, and point of contact information. Inside this form I have added a sub form ...
Jason Fisher's user avatar
0 votes
1 answer
51 views

How to disable Logging when start turbogear2?

I would like to disable the logging in this picture (in the red box): I use turbogears 2.3.7. When I start gearbox server and access my url http://localhost:8778. in log will show access url. For ...
padungrat's user avatar
2 votes
1 answer
188 views

TurboGears and backlash: How to add extra, per-request context to Raven for more informative Sentry reports?

Through backlash, TurboGears supports error reporting to Sentry via Raven. Enabling the error reporting is quite easy, just add the appropriate setting in the .ini configuration file, for example: [...
Martin Thorsen Ranang's user avatar
0 votes
1 answer
48 views

Disabling tgscheduler while running nosetests

I have a TurboGears 2.3.6 project that I've been working on for quite some time. In my project I'm using tgscheduler. I want to learn how to use tests, and I have some difficulties starting. When I ...
A-Palgy's user avatar
  • 1,351
0 votes
2 answers
418 views

Formencode OneOf validator with dynamic list to test against

I'm using formencode 1.3.0a1 (and turbogeras 2.3.4) and run into a problem with the validator OneOf. I want to validate some input according to a list in the Database. Here is my validation schema ...
A-Palgy's user avatar
  • 1,351
0 votes
1 answer
98 views

ToscaWidgets - customize form

I'm using https://pypi.python.org/pypi/tgapp-resetpassword/0.1.5 which allows you to override the template used for the reset password page. Unfortunately, the actual form itself is included as a '...
EoghanM's user avatar
  • 25.7k
1 vote
1 answer
95 views

How can I return JSON output when repoze.who authentication fails?

I'm writing a repoze.who plugin and want to return JSON from the repoze.who authentication middleware and still controll the HTTP status code. How can this be done?
Martin Thorsen Ranang's user avatar
1 vote
1 answer
59 views

Turbogears nostests results in OperationalError when using SQLAlchemy-FullText-Search

I recently installed SQLAlchemy-FullText-Search dependency in (https://github.com/mengzhuo/sqlalchemy-fulltext-search), but since that I get unexpected results. When I run nosetests -v An ...
LuEn's user avatar
  • 11
0 votes
1 answer
62 views

stroller (turbogears) not working

I'am trying to build an e-commerce website using turbogears. Initially I modified the tgapp-photos to make the items come on the page properly. But then I find it difficult to make cart from the ...
neeraj's user avatar
  • 89
0 votes
1 answer
267 views

Turbogears with gevent-socketio: request Key Error

I try to use gevent.socketio with my TurboGears 2 Website: in the ini-file i use [server:main] use = egg:gevent-socketio#paster transports = xhr-multipart, xhr-polling, websocket host = 0.0.0.0 ...
Doomsel's user avatar
0 votes
1 answer
820 views

Cannot insert an image into HTML document

I know this is a very basic question, but it is driving me crazy. I am trying to insert an image ("logo_footer.png") in an HTML document that I am working on. It is a Python web app and I am using ...
Xar's user avatar
  • 7,654
18 votes
1 answer
322 views

Logout fails in Turbogears 2.2.2

I have app written in TG 2.2.2 with default authentication. Last days, I have problem with logging in and out. In safari, two authtkt cookies are created, one as "beta.domain.com", other ".beta.domain....
tomis's user avatar
  • 1,883
1 vote
1 answer
113 views

How automate using sh scripting

I'm a beginner with sh scripting and I need some help, can someone help me to convert this command lines extracted from Turbogears page to an sh script, thanks in advance. $ virtualenv --no-site-...
Red Diesel's user avatar
0 votes
1 answer
104 views

Data is missing after using @validate with Schema

I'm working on validating my webapp, which is using Turbogears 2.3.3 and formencode 1.3 I want to validate a dynamic form that the user has created through a form creation process. I'm sending the ...
A-Palgy's user avatar
  • 1,351
0 votes
1 answer
285 views

Turbogears response - sending a utf-8 filename

I'm working on a webapp using Turbogears 2.3.3 In my app the users will get a set of directions and they will need to download some files accordingly. It is important that they will be able to ...
A-Palgy's user avatar
  • 1,351
1 vote
1 answer
170 views

Angular.js and Genshi - conflicts using $

Hi I'm writing a WebApp using python, turbogears 2.2, and Genshi for my view\templates. On the view side, I'm also using Angular.js. most of the time it they work together. My problem is – when I ...
A-Palgy's user avatar
  • 1,351
2 votes
2 answers
2k views

Access the interactive backlash/Werkzeug debugger in a failed AJAX request against a TurboGears server

TurboGears features backlash, a great interactive debugger in the browser, based on the Werkzeug Debugger. When debugging is turned on in the server configuration, if a request fails, the server ...
Martin Thorsen Ranang's user avatar
0 votes
1 answer
72 views

turbogears querying the database for file

I am using the Turbogears-2.3 framework and now I know how to upload the files in the database using the tgext.datahelpers. I understand that the file gets uploaded in the disk and in the database ...
neeraj's user avatar
  • 89
0 votes
1 answer
62 views

TurboGears 2.3 @validte in two steps

I'm using TurboGears 2.3 and working on validating forms with formencode and need some guidance I have a form which covers 2 different objects. They are a almost the same, but with some difference ...
A-Palgy's user avatar
  • 1,351