I got a simple test to work when deployed, but I get the following error from the development server:
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 301, in MakeSyncCall
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "rdbms"
Tried sample app given at https://code.google.com/apis/sql/docs/developers_guide_python.html
I tried to replicate this, and got the following warning when starting the SDK dev server:
WARNING 2011-12-27 03:50:59,069 rdbms_mysqldb.py:90] The rdbms API is
not available because the MySQLdb library could not be loaded.
What this means is that the Python-MySQL connector library is not installed on my computer.
Here's a write up on stackoverflow for how to install it: No module named MySQLdb
Related
I use python3 -m http.server --bind localhost to quickly host local versions of web content for testing.
I was using this to host a web version of a game I was working on and ran into this error:
Uncaught ReferenceError: SharedArrayBuffer is not defined
The engine I'm using has advice for this error:
Enable the following HTML response headers on the website you're hosting your project on:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
But I don't understand how to set these headers. Do I need to implement my own subclass of BaseHTTPRequestHandler (and how)? Or do I call send_header on... something?
I want to deploy my flask-restx application on a shared hosting. Since I am beginner in deployment, I followed a video tutorial from youtube.
I did step by step by following this tutorial.
For those who do not want to go through the tutorial, I am writing the steps:
I created an application from the Python cPanel
Initial set up in Cpanel
Then I opened terminal and changed my venv and installed flask by "pip install flask"
Project Structure
filas_folder/
├──public
├──tmp
│ └──restart.txt
├──app.py
└──passenger_wsgi.py
app.py looks like
from flask import Flask
app = Flask(__name__)
#app.route("/")
def main_():
return "flask is running"
#app.route("/user")
def main_2():
return "user is running"
if __name__ == "__main__": app.run()
Restart app from cpanel
passenger.py looks like
import imp
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
wsgi = imp.load_source('wsgi', 'app.py')
application = wsgi.app
when I open www.example.com
flask is running
But when I open www.example.com/user
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster#example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
My system has cloudlinux and uses apache server. This is not the first deployment. Many wordpress and static websites are running on the server.
I opened apache logs at /usr/local/apache/logs/error_log
I get the error "Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer" http://example.com/user"
Add the following to the top of your .htaccess file:
RewriteEngine on
RewriteRule ^http://%{HTTP_HOST}%{REQUEST_URI} [END,NE]
Got this info from: https://stackoverflow.com/a/63971427/10122266
I need solution to the 403 error I'm getting after successfully deploying flask app on AWS elasticbeanstalk. After deploying a flask application developed in visual studio it gives 403 forbidden error. I've tried different searches to solve the problem but they haven't resolved it.
For example, it was suggested somewhere the start-off python file should be named - application.py, which I did and redeployed but it still didn't work. It was also mentioned in another example that the deployed solution was pointing to a folder instead of the start-off file, which is not the case in my situation.
Possible problems pointed at include the inability of subdomains to work with flask host or the need to make adjustment to the code below in my runserver.py for production environment of AWS.
if __name__ == '__main__':
HOST = environ.get('SERVER_HOST', 'localhost')
try:
PORT = int(environ.get('SERVER_PORT', '5555'))
except ValueError:
PORT = 5555
app.run(HOST, PORT)
I am trying to start my app using the new cloud SDK preview (gcloud preview app run DIRNAME) and the response is:
INFO: Starting API server at: http://localhost:51695
INFO: Starting module "api" running at: http://localhost:8080
INFO: Starting module "default" running at: http://localhost:8081
INFO: Starting admin server at: http://localhost:8000
The dispatcher is not running and I can't get a dispatcher service URL as described
here.
The dispatcher is fully function on production, but I just can't get it started via dev server.
How can i make Google Cloud SDK recognize dispatch.yaml?
The dispatch.yaml looks like this:
application: my-super-secret-app-id
dispatch:
- url: "*/"
module: default
- url: "*/_*"
module: api
The goal is to server all "regular" requests from the default module, and request begins with underscore to the "api" module.
Removing Google Cloud SDK completely and re-installing it's latest version solved the problem.
I am trying to run gae app without dev_appserver.py, and have following error
AssertionError: No api proxy found for service "xmpp"
room = webrtc.Room.get_by_key_name(room_key)
I found in the app.yaml inbound_services:
- channel_presence
How to enable channel_presence directly in application.py
Unless otherwise specified, libraries included with the App Engine SDK are expected only to work within the App Engine environment. You cannot just import the XMPP library included with the App Engine SDK and expect it to work in a non-GAE application.