Комментарии:
Request: Please create a video on migrating the DB to PostgreSQL. In the initial videos of this series, you mentioned that you will show how to use Postgres. Eagerly waiting for this :D
Ответитьtbh, this dude's voice is like a calm Trump
Ответитьtbh, this dude's voice is like a calm Trump
ОтветитьOh my God it's working, thank you, thank you.
ОтветитьI appreciate your thorough guide and doing everything the right way. So many tutorials skip over every other detail and just show the bare minimum. I like how your video shows all the best practices. Thank you!
Ответитьdoing a cloud engineering final project at the moment and needed a guide for NGINX configurations. i did mine on an EC2 and it works!! tq
Ответитьi cannot get my env. I'm missing this part. It returns none
Ответитьthank you for this awesome content. you wouldn't believe how many times I came back to this video for reference.
ОтветитьOkay so I faced some weird error. I'm on AWS t2.mirco Ubuntu and I checked that I have one core. I setup gunicorn just as mentioned but then when I started testing my website, it started acting strange. For instance when I click on the username from homepage multiple times, it automatically logged me in and then when I clicked on Account page, it displayed that I need to login but still had me logged in.
I changed the number of workers to one and that worked for me. Not sure what this is.
I had a lot of trouble with the server configuration and SSH. Even after disallowing password login in /etc/ssh/sshd_config, if i delete my local .ssh folder, it still asks me for a password and lets me log in with password to the Linode server.
I got stuck at this command: sudo systemctl restart sshd
Seems the command is either outdated or just doesn't work. So i attempted to re-install SSH on the cloud server, but the command still did not work. It did cause a whole mess of re-configuring the SSH files though, which i did. But i was very concerned that it just let me log in to the server without a password or anything, all i had to do was delete my local .ssh folder... seems like a gaping hole in the security.
403 forbidden for static file
ОтветитьThis video has helped me soooo much, thank you Corey!
Ответить2023 and this series is still relevant thank you, Corey.
ОтветитьCan we get a flask-react application
ОтветитьThis may be an old tutorial but, I have my css in a similar file structure, and put that pathway into the /etc/nginx/sites-enabled/flaskblog. However my ngnix cannot bring up any custom css only the bootstrap, as I get a 403 badgateway on the css. Was there no permissions we needed to give?
ОтветитьHey .
What is best practice for deploying react(Frontend) + flask(Backend) application on production?
i know im late to the party, but this is as much as you can learn in an hour about a linux backend/deployment. it was usefull to me 4 years later, thanks a lot!
ОтветитьSo I was able to pass Supervisor step.
here what worked for me
We need to set software called SuperVisor
Under (venv) YOUR_USER@flask-server:~/YOUR_PROJECT$
Type: sudo apt install supervisor
Uninstall supervisor:
sudo apt-get remove supervisor
sudo apt-get purge supervisor
Installed pip for python3:
sudo apt update && sudo apt install python3-pip
Install supervisor using pip:
pip install supervisor
Install supervisor again using apt-get:
sudo apt-get install supervisor
Setup config file for SuperVisor
Type: sudo nano /etc/supervisor/conf.d/flaskapp.conf
And add following text:
[program:flaskapp]
directory=/home/YOUR_USER/YOUR_PROJECT/
command=/home/YOUR_USER/YOUR_PROJECT/venv/bin/gunicorn -w 3 my_app:app
user=YOUR_USER
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/flaskapp/flaskapp.err.log
stdout_logfile=/var/log/flaskapp/flaskapp.out.log
startsecs=1
Note, there is closing back slash at the end of path to your project for directory=
under command= is a place where gunicorn is located. To double-check it run in bash: whereis gunicorn. See where it is located and check with what you have in command=
my_app:app , where my_app is the folder if you use package content. Inside of that folder you will have a __init__.py file. Inside that file you will have app. Where app = Flask(__name__). If you dont use packaged structure, then just a filename where this code is located app = Flask(__name__).
user=YOUR_USER is your ubuntu user that you created after root.
CTRL+X, Y, Enter to save
We want to create log files quick:
Under (venv) deadok@flask-server:~/Interactive_brokers_PIT38$
Type: sudo mkdir -p /var/log/flaskapp
Type: sudo touch /var/log/flaskapp/flaskapp.err.log
Type: sudo touch /var/log/ flaskapp /flaskapp.out.log
Restart our Supervisor:
Type: sudo supervisorctl reload (Restarted supervisord)
You need to wait 10-20 seconds and check your site. Should work.
Corey, thank you so much for your videos. More than helpful.
Ответитьlike man i respect you so much
Ответитьspend white day fighting and reading dogshit articles only to see the of made this vids
ОтветитьHas anyone else had trouble with 502 bad gateway errors after deploying updates? I can't seem to get it back up and running :(
ОтветитьI've seen using "--daemon" optional parameter when running gunicorn instead of Supervisor. Any thoughts on differences anybody?
ОтветитьThere are so many short "to the point videos" out there but I really appreciate what you did Corey, for us new guys it's helpful how you show best practices and all the little details. This is so helpful, especially for those that are not familiar with linux
ОтветитьThis video is like the bible. To follow step by step when launching a Flask app! Thanks man!
ОтветитьReally wish you would do this same tutorial with a postgres database. SQLite is pretty impractical for any application with intention of actually reaching users and getting the postgres to work on the remote is giving me so much trouble.
Ответитьyou are owwwwe
some
Can you make a video on deployment using heroku for flask ? I tried to follow along your django heroku deployment video but flask does not really have anything like django storage so I am not really getting how to store uploaded files on s3
ОтветитьI can't believe you're providing this high quality content for free! I'm supporting your channel to Patreon and recommend others to do so too!
Ответить@Corey Schafer, many thanks for the time and effort put into the tutorial, I have a question though. Did you exclude the venv from your local system while moving the file to the linux server and did we have to recreate the venv folder on linux if there is already a working version from the local system
ОтветитьI am getting a 403 nginx error when accessing static folder (minute 56-57)
ОтветитьAfter many hours searching for how to deploy my project, I find everything I need right here.
Amazing work Corey :D
This Video is intresting already => shows how configuring your servers and the connectivity between the two securely as much as permissions work but it needs the ACL ones.... as well as deploying your web application ,, Good job and nice video
ОтветитьAnyone else having problems getting nginx to restart? I just keep getting failures. I've been asking over the interwebs and unable to find a solution yet
ОтветитьHow common is it to use supervisor? What viable alternatives are there for this? E.g. would it be common to use docker to run this?
ОтветитьI dont say that alot, thank you for doing this
the extra stuff that I don't need right now might be useful in the future but it didn't bother me at all, I just skipped it
Corey, Thank you isn't enough to express my acknowledgement of this video, and how do you explain this topic.
ОтветитьI deployed to google cloud platform and when a user tried to create an acount on the deployed version there is an error "OperationalError: attempt to write a readonly database". Does anyone know how deal with this or what is going on?
ОтветитьGreat job. Question at 17:xx you issue a ssh-keygen and overwrite your existing id_rsa file. Won't that now invalidate any other systems that you used that id_rsa file in because you overwrote it, thus locking you outout of other servers? Why would you not use your existing id_rsa file?
ОтветитьCorey, just wanted to say I think you're the best Python teacher out there and I really appreciate all your videos (and I'm supporting via Patreon - although in small amounts - to show my appreciation). Take it easy and come back when you're ready to come back.
ОтветитьI'm running into a litany of complications with Nginx permissions. My site works perfectly on 5000 in dev then starts running into 403 errors once on 8000, and I can't seem to pass the login page. The stderr and stdout files aren't very clear either. This whole tutorial is amazing... but I'm really struggling to walk away from it knowing what Nginx is actually doing, especially after hours of external research to no avail. I think I've become a bit spoiled with your quality of teaching and am struggling to get answers elsewhere. Would love to see a video from you on Nginx permissions, and maybe just server/user permissions in general. Thank you so much, Corey!!!!
Ответить