I have a web app made with Flask and I want to host it on GitHub pages. However, GitHub pages can't run Python apps, and I can't use something like Frozen-Flask because my app is dynamic.
Related
I've developed Django as backend with ReactJS as frontend being served on Django server (127.0.0.1:8000) by putting frontend folder inside backend folder and using static files with path to build/static of frontend in settings.py. So I'm able to run reactjs app on localhost:8000. That's fine.
Now question is if it's possible to dockerize only Django backend, which will have everything including frontend contents and run single docker container opening react js app? Or shall I dockerize frontend as well separately?
Looking forward to your inputs.
Regards
Please note that I've also done with both backend and frontend running separately on 2 servers (localhost:8000 and localhost:3000), used docker-compose to build 2 dockerfiles and them talking each other. So my above q is about possibility to dockerize only backend as a single container image which has frontend static files inside.
I wrote flask web which I was testing by running the server like ‘python src/run.py’
Now recently I decided to use flask cli approach.
So I did ‘export FLASK_APP=src/run.py‘
then ‘flask run‘ it work starts web app at 5000 by default but nothing opens in browser.
I do not get any error. Do I have to create FlaskGroup to create flask cli run command explicitly?
I'm new to web development and deployment however I developed a web site using Python 2.7 and Flask. I can't get the site to load when the user hits the site. When testing on the server using SSH the program starts like it did on my development PC but does not render the first template and shows this error: WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
In researching that error I found an article that says Flask is not meant for a multi-user public web environment. Further investigation said: If you want to run Flask in production, be sure to use a production-ready web server like Nginx, and let your app be handled by a WSGI application server like Gunicorn.
I think what this is telling me is:
Find a provider that supports Nginx.
Install Gunicorn and then configure it to run on that host.
Doing that should allow my program to run on the host server and be accessible to the world.
Would folks with experience with Python/Flask web apps please confirm the direction I should be heading as I can't afford to go down the wrong path again.
I'm building an app with a django backend and a jquery mobile frontent. I am trying to figure out how to view what I'm building. What I mean is, to date, when I build my web apps (regular django powered websites) I do it all locally and use the django testing server (python manage.py runserver) to test what I'm building, viewing my results at 127.0.0.1:8000/.
If I'm building an app for our iPhones, how can I view my web app on my phone while I'm testing? If I fire up the django test server, I can navigate to my app on my laptop and it looks like an app. However, I want to open up my phone's web browser to see the same app page.
On my laptop I navigate to: 127.0.0.1:8000/m/ and I assume that on my iPhone I would navigate to my laptop's IP address, so: 192.168.1.103:8000/m/
I think I'm missing something here conceptually... any ideas?
try
python manage.py runserver 0.0.0.0:8000
By using 0.0.0.0, you will be able to serve files up to external computers and your iphone
Can anyone let me know how to deploy a flask app on a personal website using CPanel
I have tried running it through the virtualenv but did not work
Flask is a micro framework that runs in a Python instance, and not as a set of files that are served from a web server, like HTML or PHP. Most likely you will need another hosting provider that hosts web applications like Heroku or use a VPS instead.
On the other hand, most shared hosting providers do not allow you to install custom libraries that need to be compiled.