Questions tagged [cherrypy]
CherryPy is a pythonic, object-oriented HTTP framework. See cherrypy.dev for more information. Ask for interactive help @ https://gitter.im/cherrypy/cherrypy
1,373
questions
0
votes
0
answers
10
views
Is there any library in python 3 which can read cookies from incoming request, remove invalid characters and then proceed with rest of the flow
I am facing a problem in my cherrypy APIs for a web application, where there is a redirection to external site within my primary domain, and it is setting a cookie which is not in valid format and in ...
1
vote
0
answers
37
views
Cherrypy cors - Invalid response header
I've been messing around with webhooks, and while I've had plenty of success using something like curl to send post requests, when I try to use my regular browser, the cors policy has been giving me a ...
0
votes
0
answers
15
views
How to force a redirect upon session timeout in CherryPy AJAX request
I have a CherryPy v 3.7 application. The application uses expiring sessions to maintain login state.
If the session expires and the user attempts to navigate to a different page (or refresh the ...
0
votes
0
answers
77
views
Salt-api auth errors
Im trying to get salt-api working for the first time locally
I've added
rest_cherrypy:
port: 8000
disable_ssl: true
external_auth:
pam:
dave:
- .*
to my master config, stopped both master and ...
0
votes
0
answers
85
views
Salt-api and restcherrypy permission denied error
I am trying to set up a new salt master and want to use salt-api.
I am following the guide here
https://docs.saltproject.io/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#a-rest-api-for-salt
...
0
votes
0
answers
36
views
Unable to send session created in python to react
My backend runs in a docker container and my frontend runs in a different container and this is load balanced by traefik. I am unable to send the session created in the backed to the frontend.
my ...
0
votes
1
answer
183
views
CherryPy server unable to perform proper SSL handshake
I have a CherryPy server listening on port 443 and using an SSL certificate provided by ComodoSSL. However, trying to connect through Chrome gives me "ERR_SSL_PROTOCOL_ERROR".
Note that I am ...
0
votes
1
answer
42
views
How to prevent CherryPy to log to stdout when using the logging module?
I am using the logging module to log in my application:
import logging
logging.basicConfig(level=logging.INFO)
However, this causes CherryPy to log all lines two times (one in stdout, one in the ...
0
votes
0
answers
36
views
How can I set the character set encoding for serving static files?
I am using a simple setup for serving static files in CherryPy:
class StaticServer(object):
pass
config = {
'/': {
'tools.encode.on': True,
'tools.encode.encoding': 'utf-8',
...
0
votes
0
answers
24
views
Information sent in DELETE body is not processed by CherryPy
I have this Javascript (jQuery) code:
$.ajax({
url: `/rest/order`,
type: 'DELETE',
data: { "magentoid": order_id },
success: function(data) {
},
error: function(xhr, ...
0
votes
0
answers
13
views
CherryPy debug is not working but normal is
I'm developping some small web application with CherryPY. I'm using a devcontainer and vscode. Everythong is running well except when I'm trying to run it in a debug mode. It raises an error saying ...
0
votes
0
answers
29
views
How can I "alias" a URL path to a function?
I am using CherryPy, and in my class I have a attribute suppliers, no I also want to have a URL path suppliers that requests that attribute, obviously that doesn't work. But how to "alias" ...
0
votes
1
answer
44
views
set class attribute in cherrypy plugin - AttributeError: 'NoneType' object has no attribute 'bar'
cherrypy: I try to have multiple instances of a plugin. I try to read the class attributes of these instances as following:
class fooPlugin(plugins.SimplePlugin):
def __init__(self, bus, bar):
...
0
votes
0
answers
21
views
Dynamically handle CherryPy expose
I need a web site where instead of using "file.html?q=1", "file.html?q=2", etc... pages rather "file1.html", "file2.html"... ones.
I'm using CherryPy, my ...
0
votes
0
answers
56
views
how to debug ERR_CONTENT_LENGTH_MISMATCH errors
I have a web application that serves images using a cherrypy/Apache back end that I tried moving to a new server. On the old machine, all is fine. On the new one I am sometimes seeing a few ...
0
votes
0
answers
17
views
How to access caller function's return data in CherryPy custom decorators' tools?
I want to write a simple serializer in Cherrypy framework to be called on each hander to process the final result before sending out as a response. With normal decorators you access the return value ...
0
votes
0
answers
63
views
How to calculate time and monitor the memory for an api call in cherry py python
I developed the cherry py application i given task to calculate the time taken for each api calls and monitor its memory, i thought of using the dispatcher but dont know the implementation
to ...
0
votes
1
answer
77
views
cheerypy server is timing out
I am running a CherryPy Local server. But After sometime server is timing out. I am new to CherryPy server and I found in error.log this message and unable to solve this issue.
CherryPy==18.8.0
...
0
votes
1
answer
38
views
CherryPy redirect to root on missing parameters error
I have a web server using CherryPy. I would like for users to be redirected to the root page if they try and access a page which requires parameters to be entered. If a user were to try and directly ...
0
votes
1
answer
82
views
Register Oracle Out Parameters with SQL Alchemy in a Scoped Session safe way for use with Cherrypy Tools/Plugins
I've been chasing this issue for months now. The closest post I could find on my issue is this one
I'm really trying to avoid the "XY" problem with this post. But it's hard to even know what ...
0
votes
1
answer
172
views
CherryPy Python error "No such file or directory"
Im trying to run a python Server using CherryPy for a WebSite but when I run it this error pops up.
During handling of the above exception, another exception occurred:
Traceback (most recent call ...
0
votes
1
answer
399
views
How can I select columns from a table generated in JS from a csv file, to do a further analysis with only the selected columns?
For this project I am using python and JS. The framework I'm using is cherrypy and for html I'm using yattag. (I'm a beginner btw)
I have generated a table from a csv file with the following JS code ...
0
votes
1
answer
225
views
Get user-id from Caddy and CherryPy basic-auth
I'm using Caddy as a reverse proxy, feeding a web app on CherryPy. Caddy is handling basic-auth, and I would like to pass the username to the CherryPy app.
I've modified my Caddyfile like this:
my....
0
votes
1
answer
199
views
Request.Post Method to Web Server using CherryPy
I am following the blog: Build your own Python RESTful Web Service to mock a web server using cherrypy.
The server code is
import cherrypy
class MyWebService(object):
@cherrypy.expose
@cherrypy....
0
votes
1
answer
69
views
Get data from Ajax Get Request in CherryPy for login session
I'm doing an authentication for an web app in which I have the following flow:
After the Login, a POST is sent calling login method and if login successful redirects to /user
@cherrypy.expose
def ...
0
votes
2
answers
118
views
How to add versioning to APIs in cherryPy
I want to version my APIs (written in python: using cherrypy- version 13.1.0), but simply giving the alias as /v1/apiName throws a "path not found" error. Is there any way to do this using ...
0
votes
1
answer
149
views
Cherrypy download serve_file
I am attempting to create a zip file and the allow it to be downloaded from the webpage. I am able to get it to serve the file but instead of downloading in the browser, it makes the call and serves ...
1
vote
0
answers
151
views
Python Win32 service doesnt start except in debug mode
I have a Django app that I'm trying to run via Cherrypy on Windows Server. I have below code in the service creation script.
import os
import sys
service_directory = os.path.dirname(__file__)
...
0
votes
1
answer
1k
views
Module not found error in Visual Studio Code despite the fact that I have just installed it
I want to run a python script with the cherrypy module. I use pip install cherrypy to install it and all looks ok. Then I click the "Run python file" button and I face the error ...
1
vote
0
answers
124
views
How to trigger server side event when testing event-stream using cherrypy.test?
When using cherrypy.test to test server sent event streams:
class Test_BasicPage(helper.CPWebCase):
....
def test_eventSource(self):
self.getPage("/updateSSE")
...
0
votes
1
answer
49
views
How to perform GET and POST requestion on same form
I am working on a web application where I have to use GET request to render checkboxes in a form and then use POST request to return the selected form data back to the server. But I am unable to ...
0
votes
1
answer
81
views
What is the reason for exception thrown on loading large files when using cherrypy with https?
System Info
$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
$ uname -a
Linux lb-cam-11 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ ...
0
votes
0
answers
76
views
connection in a different thread can't read tables created in another thread?
In a testing suite I have a fixture that drop all the tables in an engine, then start fresh and create all the tables. After this fixture logic, my test case runs, using the newly created table.
The ...
0
votes
1
answer
263
views
How to best understand the relationship between cheroot vs cherrypy
I've read the official documentation but didn't find a definite answer. What is the relationship between cheroot and Cherrypy? I see Cherrypy imports a lot of codes from cheroot. Is it another project?...
0
votes
1
answer
173
views
Python Cherrypy DECRYPTION_FAILED_OR_BAD_RECORD_MAC
Good day,
I've an app that is uses Cherrypy to server a simple website. From time to time I get DECRYPTION_FAILED_OR_BAD_RECORD_MAC error. I've never seen an issue my self while testing, this only ...
-1
votes
1
answer
182
views
Cherrypy, REST : how can i pass an optional argument to the GET function that if it isn't given in the URL is set to a specific value?
I am working with CherryPy framework. I am implementing REST and what i want the HTTP Method GET to retrieve some information given a parameter passed in the URL that should be an integer. This ...
0
votes
1
answer
371
views
Why logs are empty after logging.config.dictConfig(...)?
Original title was "How to find a problen in python logging configuration?"
I have quite a large project with a lot of loggers. I have wrapper to run project and it has some logging confid. ...
2
votes
0
answers
125
views
How to forward http to https in cherrypy native web server
I've a Cherrypy website that is running well on https, I can run the same server on http port without forward like this:
from cherrypy._cpserver import Server
server2 = Server()
server2.socket_host = &...
0
votes
0
answers
104
views
Run Python function from within CherryPy webpage with django
My project is a client/server model project with Python, CherryPy and Django.
The Python program has various server like functions (adding/removing/editing stuff from/to the database, running commands,...
0
votes
0
answers
46
views
CherryPy killed itself after I play HTML video element
I create a courses website. Sometimes, when I watch 2 to 3 videos, CherryPy is stopped.
This is my HTML video element:
<video controls controlsList="nodownload" src="${GV_base_url}/...
0
votes
1
answer
255
views
Read From CherryPy Request Body Twice
I am running into an issue where I need to read the body of a cherrypy request a second time if there are any errors while completing the request. The code below shows my problem. I need to be able to ...
1
vote
2
answers
221
views
Cherrypy logingg POST body
I'am using default cherrypy logger.
I have log every access request to my server. For GET request i have full info, like
127.0.0.1 - - [06/Jul/2021:16:10:28] "GET /test/?contract_id=228322 HTTP/1....
0
votes
1
answer
255
views
CherryPy handle pydantic @validate_arguments
I have a CherryPy api server.
I want to validate arguments using pydantic decorator @validate_arguments and if args don't right, function handle that and return
{'error': '*bad_argument* is wrong type'...
-1
votes
2
answers
708
views
How to make a simple Python Text Server
I'm trying to make a webserver that serves string. Yes, that's it, just string, no variables, no CSS. The problem has been the refresh. Assume that the string changes every second, stored in a Python ...
0
votes
1
answer
342
views
How to debug curl request for salt-api?
I have salt masters and salt-api services on Ubuntu servers.
I'm trying to verify connection, using this command:
curl -sSk https://<MY-URL>/login \
-H 'Accept: application/x-yaml' \
-d ...
0
votes
1
answer
471
views
CherryPy performance tuning
CherryPy consumes about 15-20% CPU on a single-core Raspberry Pi 1st generation when idle, i.e. no requests being processed at all. To reduce this, I tried various configuration adjustments, but to no ...
0
votes
0
answers
389
views
Is server.socket_host: '0.0.0.0' necessary?
When configuring my Cherrypy web application, I found out on stackoverflow that the following setting is needed:
[global]
server.socket_host: '0.0.0.0'
This is basically IPv4 INADDR_ANY, meaning &...
1
vote
1
answer
60
views
How to set "no-store" into the response header?
I have set in my cherrypy configuration file:
'tools.expires.on': True,
'tools.expires.secs': 0,
'tools.expires.force': True
This gives me a reponse header like this:
Cache-Control: no-cache, must-...
0
votes
2
answers
132
views
Can't restrict API access by positional args via external_auth SaltStack
I'm trying to restrict the calling state.apply only for specific SLS files via the pam module.
external_auth:
pam:
myuser:
- '@runner':
- jobs.list_job
- '*':
- test....
0
votes
0
answers
259
views
Onion Server with Stem and CherryPy in Python
I want to create an Onion-Website with CherryPy in Python (using Stem to access the Tor network). My problem is the deployment of the site. For that I adopted the example from this article: https://...