FastAPI - Deploy your App in 2 minutes on Deta Space - FASTEST API DEPLOYMENT!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi in this video I'm gonna show you the fastest way to deploy a fast API application the whole process is completely for free and gives you an https URL if you're interested in fast API in general I've also published a crash course on this topic on YouTube first you need an account on data.space and there you click on sign up and pick a username your email address and a password and very important click here on enable developer mode after signing up you have to sign in with the email address and password then you click on sign in after signing in you will see this area here and this is the place where you can manage your applications after creating our data space account we have to install the data space CLI we can install it on windows with the Powershell with this command and on Linux and Mac with this command so you just press enter and then you install the CLI on your computer after installing it we run space minus minus help to see all the available commands here and as you can see we can log in we can push our project we can create a new project and so on and so on so this is the CLI we will use to manage our project and the first thing what we're going to do is running space login and then we have to enter an access token and we get the access token here on our UI just click here then go to settings and then on generate token and then you can just copy the token and just copy paste it inside the terminal and we can see we are logged in successfully before we create a new space project I will just walk you through the code here as you can see this is a very simple fast API application with some to-do endpoints where you can make a post request get request and put and delete so this is a simple crud application and we also have a requirements.dxt this is very important to make a space no what requirements we have to install on the server so this are the two files we need and now we can run space new and we can just select the project name here I will call it fast API one two three four and then press yes and after that we will see a new file dot get ignore a DOT space folder which we don't have to open this this just includes some meta text we don't have to know about the space file here contains some information about our project for example the source which is our current directory the name of our deployment and also the engine as you can see we use Python 3.9 here but this is not enough to make it work we also have to include our entry point and to run a fast API application you normally run UV according as web server and here we just run ubicon and then app this is the name of the file app.pi and then the app object here which is referenced with the second app here so we run uicon app and dot dot app and this is the entry point we Define here okay so now we have a working solution but this is not a public endpoint it will just be a private endpoint to make it a public endpoint we have to add public routes here and here we can Define which routes we want to make public this is a list and we just have to use a little space here and then write for example a slash and then if you want to make all worlds public we can just add a white card here and then all of our routes in the API will be public after doing this we can just run space push and now our app gets deployed with this space file and also the app.pi and the requirements.txt will be installed on the server okay as we can see everything works as expected we can just copy this URL now and update it here the code and go to slash docs to see our application everything runs as expected okay that's it the app works and we've got an https endpoint that was quite easy wasn't it if you liked the video feel free to subscribe to my channel and give the video a thumb up thank you very much bye bye
Info
Channel: Coding Crashcourses
Views: 5,890
Rating: undefined out of 5
Keywords: fastapi, deployment, https
Id: 1HvnuY5BC8U
Channel Id: undefined
Length: 4min 10sec (250 seconds)
Published: Thu Jun 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.