I followed Heroku's guide to using its websockets to implement a real-time chat app using Python, Flask, redis, and Heroku. However, I none of the messages that I enter appear in the designated div container. When I check the console from firefox firefly, I constantly get
cannot connect to ws://host_url/submit server
cannot connect to ws://host_url/receive server
You can see the same error from Heroku's official demo as well. I even clone the provide github repository, but it also had the same error, and none of the messages appeared. I am not sure if there is a problem with Heroku, or I have some misunderstanding. Could anyone give me some guidance?
Related
I am new to NameCheap and I need help deploying a Django application. I just tried installing python on Namecheap's Cpanel using Python 3.7.12 with the desired Application URL, but I get the Error 503. Service Unavailable when I visit the Application URL after creating the python app. From the resources I have seen, I am supposed to get a python signification that the python app works and not an error. Thanks in advance.
python app setup on Namecheap's Cpanel
error page when i visit the application's Url
In my experience, Why does it appear?
The Webserver is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server.
Also among reasons can be:
inodes/disk overusage
irrelevant php.ini/htaccess directives
incorrect PHP version used
lack of memory
Solution:
Switch PHP versions;
Check disk space and inodes usage, etc.;
Check error logs and the latest error messages to find which script, plugin, etc. causes the issue;
ensure the server is up and running.
I’ve recently tested and deployed a flask app as the minusthemiddleman website. All of the functions tested and worked in the sandbox by multiple testing methods before deployment to nginx and uwsgi in production. For some reason page 2 of the search function causes a resource problem in app as deployed. I’ve had a chance to monitor the redis directly using $redis-cli monitor and check my pip list to make everything is installed in production correctly.
The specific error is:
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Does anybody have ideas as to why this is malfunctioning? Thanks,
I've set up a Flask server which is hosted on Firebase integrated with Cloud Run, I'm only making changes to html at the moment and using the command "firebase serve" with my localhost, however when I refresh the window and when I stop the server and restart it, my changes are still not showing up. I must be googling wrong because I can't find what I'm looking for: is there some sort of an update command, or do I need to re-build and re-deploy every time?
If the Firebase emulator suite isn't proxying the request to Cloud Run in the way you expect, you should open an issue on the firebase-tools GitHub and provide reproduction steps so they can diagnose. You should make sure that your installation of firebase-tools is fully up to date.
Note that the CLI will not deploy any new code to Cloud Run. You still have to run gcloud to update the backend.
I am setting up a test server at home. The web app is built with flask and python 3.6. For setting up the web server with nginx and gunicorn I followed the guide Real Python Tutorial. This use supervisor for the final management engine.
The problem is I don't know where to start looking to find the cause of my issue. The app has a file upload form which when submitted gets 502 bad gateway if the server is start with supervisor. But if you start gunicorn directly the app works with no issues and uploads the files as expected.
Any help on how to debug this would be great. I don't know what information to share so just ask and I will get what ever you if I can. The server is Ubuntu 16.04.
I spent some days with a similar issue, but with a Django app. Basically, the Bad Gateway problems with Nginx have to do with permission issues for the connection between Nginx and Gunicorn. I suggest you look at your nginx.conf file, and check the user used. The user must be the one that administrates the system (have the necessary permisions for executing/reading). Also, check that you include the configuration files contained in sites-enabled/ (in my case I don't have this directory, but directly overwrote the nginx.conf file). Then, check that you have the #proxy_to_app, location / , and upstream blocks like explained here https://rukbottoland.com/blog/django-gunicorn-nginx-supervisor/
Hope this helps!
Tip: check the nginx logs at /var/log/nginx/ for any error message. That helps debugging.
I'm learning Django and working on sample sites.. I registered at alwaysdata but am unable to view the site after I go 'manage.py runserver' in the SSH (this is after I've created the project and navigated to the appropriate directory, of course).
I appreciate any help.
Thanks
Have you taken a look at the wiki entry regarding the django dev server? Google translate seems to indicate that you need to request some ports open first, and that once you've got them assigned you can pass in one of those port numbers to runserver to run it on that port.
If you need the translated-to-English version, here's a link
I am also an alwaysdata customer. Daniel DiPaolo gave you the right links to get it working on ssh with the dev server. The google translation seems correct to me. You need to request a port range in order to use the dev server on ssh.
But this is intended only for debugging purpose and should run for a short while.
Here is how to deploy with fastCGI which is the regular way to deploy a Django site on alwaysdata.
http://wiki.alwaysdata.com/wiki/D%C3%A9ployer_une_application_Django.
Google give a decent translation
AlwaysData is running a forum at http://forum.alwaysdata.com/ mostly in French but questions in English are welcomed.
The devserver included with django is for testing purposes, only on your local machine and should not be used on a web host. From the docs:
DO NOT USE THIS SERVER IN A PRODUCTION
SETTING. It has not gone through
security audits or performance tests.
(And that's how it's gonna stay. We're
in the business of making Web
frameworks, not Web servers, so
improving this server to be able to
handle a production environment is
outside the scope of Django.)
If i have somehow misinterpreted your question, i apologise.
When you enter manage.py runserver you're running the development web server on the loopback interface (127.0.0.1). You could test this out by running wget 127.0.0.1 on the same server that the development web server is running.
If you want it to be on the internet so you could access it from outside that server, you'd have to specify your public ip. For example, to run the web development server on ip 1.1.1.1 and port 8080 (personally recommend using a non-standard port):
manage.py runserver 1.1.1.1:8080
To find out your public ip, try running ifconfig on SSH.
Also, you might have to check out the firewall settings with your ISP/server provider.