Questions tagged [pylons]
Pylons is a lightweight web framework emphasizing flexibility and rapid development.
832
questions
1
vote
0
answers
226
views
CKAN Error: Process completed but unable to post to result_url
I'm using CKAN 2.9.4 when I click Upload to DataStore button, I got this error
Error: Process completed but unable to post to result_url
My ckan system is already running at
http://mindset.ccgeo.info:...
1
vote
0
answers
105
views
How to mock an authentication decorator with Pytest?
I am going to mock an authentication decorator with Pytest. The framework is Pylons.
Can you please let me know if you have any experience?
Please help me! It's very important to me.
api.py
@...
1
vote
0
answers
78
views
How to validate one key based on another in Colander Python?
I am using Colander for validation, and would like to validate one key based on another.
e.g:
I would like to validate field value based on entity value:
class ValidationSchema(Validator.MappingSchema)...
0
votes
1
answer
269
views
What is this ZopeTransactionEvents error with SQLAlchemy while updating a Pyramid application?
I'm updating Pyramid/SQLAlchemy legacy code to Python 3.8 from an app working fine under Python 2.7, and running it locally. All the necessary requirements are pip installed and setup.py runs without ...
0
votes
1
answer
96
views
How to set a timeout to terminate nginx workers?
I would like to set a duration for Nginx to terminate the workers after the timeout. I am looking for a feature like "Ping Maximum Response Time" in IIS. I am using uWSGI, Nginx, and Pylons ...
-1
votes
1
answer
45
views
Deserialize Multidict using Colander
On a website I have a <select> element with multiple attribute like so:
<select value="name" multiple>
<option value="willi">Willi</option>
<option ...
0
votes
1
answer
71
views
How to port /{controller}/{action}/{id} routes in Pylons to Pyramid
So I'm porting some old Py2/Pylons app, which has the routes defined as in https://docs.pylonsproject.org/projects/pyramid-cookbook/en/latest/pylons/examples.html section #3 which isn't possible in ...
1
vote
1
answer
339
views
pyramid pserve appears multithreaded (?)
I'm hoping to multithread pyramid 1.10.4 requests ... but it appears that pserve is already multithreaded. The Pyramid docs seems to say pserve is single threaded, but when I put
sleep(10)
in my ...
0
votes
3
answers
549
views
How to customize ckan header site navigation tabs
I would like to add extra header site navigation tabs to the default ones.
I have tried working with the solution given here but it is not working for me. I am getting Exception: menu itemapicannot ...
1
vote
1
answer
154
views
pyramid_mailer `Message` and `Content-Transfer-Encoding`
I'm sending emails with pyramid_mailer and found this weird issue that when I use Office365 as my SMTP server it adds random = characters into my message. I don't get that issue with any other mail ...
0
votes
1
answer
225
views
Pylons Pyramid failing to install
I'm following this tutorial but when I get to the $VENV/bin/pip install "pyramid==1.10.1" waitress it gives me the following error:
Could not find a version that satisfies the requirement pyramid==1....
1
vote
1
answer
51
views
Why tracking number get from resource API is different from the tracking number recorded in database?
I used resource_show in CKAN 2.7.3 API docs to get metadata from specific resources. In my tracking_summary table, I have some resource which has tracking number larger than 0. However, when I use ...
1
vote
1
answer
295
views
How to make customized middleware in CKAN
I've met a scenario which I have to override a common middleware in CKAN. And in CKAN default plugins/interface.py:
class IMiddleware(Interface):
u'''Hook into CKAN middleware stack
Note that ...
1
vote
0
answers
22
views
In pylons how do I force user to download a file?
From a pylon controller action, instead of rendering a template, I want to send a file to the user to download. In languages like PHP, I can do the this thing like following. How can I do this in ...
1
vote
0
answers
67
views
What would cause an infinite redirect on the /group route?
I'm running CKAN 2.6.3 locally on my mac. I've tried replicating this instance from a database dump on the remote instance. The rest of the site seems to work just fine, but hitting /group leads to an ...
2
votes
1
answer
468
views
Python Pylons/Pyramid Cookies
What is the best way to set and get cookies in pylons/pyramid?
Response.set_cookie('example_cookie_name', 'example', max_age=180*24*3600)
returns the error
File "/usr/local/lib/python3.5/dist-...
1
vote
2
answers
1k
views
Make exe file of python pypylon project using pyinstaller spec file
In my python project, I used Basler GigE Vision ethernet cameras, because of the pylon doesn't support python then I used pypylon.pylon wrapper to open it in python. This is my class to open the ...
0
votes
1
answer
528
views
CKAN - Custom Dataset/Resource Fields
I am following this tutorial concerning adding custom dataset/resource fields for CKAN: http://docs.ckan.org/en/latest/extensions/adding-custom-fields.html
I have successfully added custom fields for ...
0
votes
1
answer
192
views
CKAN Project - Web Framework
Quick question. What web-app framework is CKAN using? I saw Pylons but that project is now deprecated for Pyramid. Can anyone shed some light on this?
Additionally, what framework does CKAN use to ...
0
votes
1
answer
26
views
Pylons logging for 500 after failed shell call in view
I am new to pylons and I want a web page to request and process JSON that is emitted by a perl script on the server. This isn't working as below but I can find no logs for either errors or requests ...
0
votes
1
answer
95
views
Where is the Salt key in a Pylons/Pyramid app?
I have a legacy 2010 Pylons app I want to replace with a newer Django one.
In Django, it is my understanding that the Salt that is used in hashing passwords is the SECRET_KEY in the config file. ...
1
vote
1
answer
43
views
Pylons routing, what is the location attribute?
I'm looking at the reddit source code and ran into a route that looks like the following:
mc('/prefs/:location', controller='forms', action='prefs', location='options')
Searching the documentation ...
0
votes
2
answers
92
views
How to put sessions on all pages without putting the session code on all views in pyramid?
I think my problem is related on the way I structured my pyramid project.
What I want to accomplish is to make my code runs on all views, I don't want to paste same codes on all views. Its like I will ...
0
votes
1
answer
73
views
Websauna threading runtime signal error with pdb.set_trace()
I want to debug the runtime of a websauna app, so I set a
pdb.set_trace()
in
system/admin/views.py:87 like so,
@view_config(context=ModelAdmin.Resource, name="show", renderer="crud/show.html", ...
1
vote
1
answer
447
views
Markers on the Line
I have a list of lists consisting of two different data for plotting 2 lines and another list of lists consisting of markers on these respective lines. but the list of list of markers can have empty ...
1
vote
0
answers
209
views
Mako: How to access loop variable in tag?
I cannot figure out how to access the loop variable blog_post_uri inside a tag so that I can dynamically load content defined in another template.
% for blog_post_uri in blog_post_uris:
<div ...
0
votes
0
answers
30
views
Pyramid + pserve occasional delay in response
I'm running a pyramid web server. 99% of the time it works great. However randomly, as I try to reach an URL, the request just waits a random amount of time, a few seconds to a few dozens of seconds, ...
2
votes
1
answer
67
views
How do I upgrade from a previous version of websauna?
I have a websauna project which I created using this command:
pip install -e "git+https://github.com/websauna/websauna.git@master#egg=websauna[celery,utils,notebook]"
this is found in the ...
2
votes
2
answers
433
views
Checking CSRF with multiple gunicorn workers in Pyramid
I'm using Pyramids for my web app, which requires an csrf check for each request. During ajax-calls the csrf-token is set into the header for each request. Everything works fine for 1 thread with 1 ...
47
votes
5
answers
49k
views
sqlalchemy existing database query
I am using SQLAlchemy as ORM for a python project. I have created few models/schema and it is working fine. Now I need to query a existing MySQL database, no insert/update just the select statement.
...
2
votes
1
answer
72
views
pyramid.util.Request source code
I'm new to Python and I am studying Pyramid to learn how to write good code. I wrote this root factory code:
class RootFactory(object):
def __acl__(self):
return [
(Allow, '...
1
vote
1
answer
865
views
Pyramid pserve.exe syntax error
I have created a pyramid application using pcreate, now when I try to run it using pserve with --reload, I get following error
SyntaxError: Non-ASCII character '\x90' in file <path>\pserve.exe ...
3
votes
3
answers
473
views
Pyramid debug toolbar serving static content over HTTP instead of HTTPS
On our test servers, we're using the Pyramid debug toolbar, however, it generates http:// links to static content (like its CSS and JavaScript files), while the rest of the content is served over ...
2
votes
2
answers
165
views
Trying to make a development instance for a Python pyramid project
So I have this Python pyramid-based application, and my development workflow has basically just been to upload changed files directly to the production area.
Coming close to launch, and obviously ...
1
vote
0
answers
128
views
Running Pyramid app in Jython + pserve (waitress)
I installed Pyramid, SQLAlchemy and waitress running in virtualenv on Jython 2.7 (platform: Linux x64). Unfortunately pserve cannot start:
% pserve development.ini
Traceback (most recent call last):
...
-1
votes
2
answers
121
views
pylon pyramid class function definition indentation
Going through the documentation of pylon project wiki2 tutorial found this codes and What I know is a class has a function definition defined with indentation after class declaration. Checked the ...
1
vote
1
answer
221
views
Disabling logging in 'transaction' package (Pyramid app)
When debugging level of main logger in Pyramid app is set to DEBUG, transaction is spewing lots of pointless debug messages.
In Nosetests I can disable that this way:
from transaction._compat import ...
2
votes
0
answers
724
views
UndefinedError: 'pyramid.util.Request object' has no attribute 'user'
I am doing a simple authentication in python pyramid here is the security.py where am doing the authentication part.
security.py
from pyramid.authentication import AuthTktAuthenticationPolicy
from ...
0
votes
2
answers
176
views
Redirecting to a cutted URL in Pyramid
I got an URL like: http://localhost:4284/?session_expired=true
Now I'm sending and AJAX-Request for something and the return should be a HTTPFound with 'http://localhost:4284/'.
Cutting the URL is not ...
1
vote
1
answer
513
views
Logging to SQLAlchemy logger in Pyramid app
I have defined SQA logger in development.ini to log SQA queries to a separate file like this:
[handler_sqa]
class = FileHandler
args = ('%(here)s/log/sqlalchemy.log','a')
# "level = INFO" logs SQL ...
-1
votes
1
answer
533
views
Which I must learn? Pylons vs Pyramid? [closed]
Which framework is better pyramid vs pylons? what similarities do they have? which of them must I learn. I learn django actively and I want to learn pyramid or pylons also.
0
votes
1
answer
89
views
Apache 2.4 proxy requests to web app not working
We migrated our web hosting to a newer server running Apache 2.4.6, Plesk 12.5, and CentOS7.2. The web app is written in the Python Pylons framework. It utilizes paster to serve the web application. I ...
1
vote
2
answers
152
views
Migrated web server to newer OS and Python version cant get Pylons web app to run
We migrated our hosted web server from an older centos 5.5, apache 2.2, python 2.5 or 2.6 to latest version centos, apache 2.4, python 2.7. Our main web app was written in pylons with python 2.6. And ...
-1
votes
1
answer
69
views
not able to get list of all models in a pyramid project
I am trying to write admin console for my pyramid project.
I am trying to get a list of all classes defined in models. Is there any way to get these?
3
votes
3
answers
1k
views
How to add your app specific settings in pyramid rest framework?
I am new to pyramid.
The Issue is I am not able to figure out how app specific settings (key value pairs) work in pyramid.
This is what I have done after various google searches and other ...
1
vote
1
answer
444
views
Dynamic forms with deform
Making form with deform and whould like to change the pageShema class depending on the choices made by the user.
Ex. if he selects option 1 from selectwidget, show him one set of fields, if case of ...
1
vote
1
answer
148
views
SQLAlchemy Core inserts make (Pyramid) scoped session hanging
I have lots of child objects to add to a parent SQA object, sometimes 10,000 or so. The code runs in Pyramid app, which makes use of scoped session and ZopeTransactionExtension:
DBSession = ...
2
votes
1
answer
534
views
python+pyramid getting every time HTTP_REFERER as empty or none
In my pyramid view i want to get HTTP_REFERER so first i tried self.request.environ.get('HTTP_REFERRER') in first time it was working fine but letter it start giving me empty/none.
then i tried all ...
0
votes
1
answer
89
views
Is there any CKAN extension for Google Tag Manager?
I want to add my Google Tag Manager script to my CKAN-2.4 instance. I can manually add it by changing the template, but I want to keep it separate from CKAN code, so I was thinking separate extension ...
7
votes
4
answers
3k
views
Gettings settings and config from INI file for Pyramid functional testing
In a real Pyramid app it does not work per docs http://docs.pylonsproject.org/projects/pyramid//en/latest/narr/testing.html :
class FunctionalTests(unittest.TestCase):
def setUp(self):
...