Questions tagged [turbogears2]
TurboGears 2.x is a "best-of-breed" full stack rapid development web framework written in Python.
152
questions
0
votes
1
answer
83
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 ...
2
votes
1
answer
29
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
│ ├── ...
0
votes
1
answer
20
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
...
0
votes
1
answer
33
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 ...
0
votes
1
answer
58
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, ...
-2
votes
2
answers
807
views
Python Web Frameworks For Production Level
I have been using Flask for Building REST API on the development level. I want to create REST API at Production Level. So which Python web framework would be Best?
These frameworks I saw while ...
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 ...
0
votes
1
answer
45
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....
1
vote
1
answer
666
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....
0
votes
1
answer
84
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....
0
votes
1
answer
44
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 ...
0
votes
0
answers
99
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....
0
votes
1
answer
190
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 ...
0
votes
1
answer
51
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 ...
11
votes
1
answer
9k
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 '...
2
votes
3
answers
812
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 ...
0
votes
1
answer
594
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 ...
0
votes
1
answer
131
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 ...
0
votes
1
answer
85
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 ...
0
votes
1
answer
99
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())
...
-2
votes
2
answers
53
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(...
0
votes
1
answer
228
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 ...
1
vote
1
answer
62
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(...
0
votes
1
answer
100
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 ...
1
vote
1
answer
146
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/....
0
votes
1
answer
29
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=...
0
votes
1
answer
55
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 ...
0
votes
1
answer
101
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 ...
0
votes
2
answers
141
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 ...
0
votes
1
answer
165
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 ...
0
votes
1
answer
46
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 ...
0
votes
1
answer
46
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 ...
2
votes
1
answer
173
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:
[...
0
votes
1
answer
47
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 ...
0
votes
2
answers
337
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 ...
0
votes
1
answer
93
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 '...
1
vote
1
answer
85
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?
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 ...
0
votes
1
answer
57
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 ...
0
votes
1
answer
253
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
...
0
votes
1
answer
739
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 ...
18
votes
1
answer
309
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....
1
vote
1
answer
101
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-...
0
votes
1
answer
71
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 ...
0
votes
1
answer
256
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 ...
1
vote
1
answer
167
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 ...
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 ...
0
votes
1
answer
64
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 ...
0
votes
1
answer
59
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
...
2
votes
1
answer
69
views
Turbogears2 AdminController throwing an error with a many-to-many relationship
I'm having an issue with turbogears admin controller throwing an error when I try to edit the User, ShoppingItem or ShoppingList items (code below). The error coming up is AttributeError: 'function' ...