Local Development
Note
The instructions on this page assume you’ve followed the Deploy Flask on Upsun guide. You may need to adjust the steps for your specific Flask implementation.
Now that your Flask app is deployed on Upsun, you need a local environment to be able to make quick changes. You can use the built-in Flask development server.
To do so, follow these steps:
-
To allow your virtual environment to communicate with your database, run the following command:
Terminalupsun tunnel:open -yAn SSH tunnel to all the services for your app is open. To verify it’s open and working, run the following command:
Terminalupsun tunnel:info -
To instruct Upsun to prepare everything your Flask development server needs to start, run the following commands:
Terminalnpm install npm run build -
To start your server, run the following command:
Terminalnpm run startYou can now view your local instance at
http://127.0.0.1:5000.Note
You are now connected to your production database. Therefore, changes you make locally in the interface (such as adding a new user) are being added to production. To make changes without affecting production, see how you can set up a local development environment that creates copies of your database.