This is a minimal sample Flask and React starter code that demonstrates how both frameworks can be used together in a single page web Application.
The code is based on https://github.com/dternyak/React-Redux-Flask.
- Clone the reponsitory
git clone [TODO INSERT URL]
cd flask-react-postgres
- Install requirements.txt
pip install -r requirements.txt
- Import the project folder into VS Code
code .
- Build the react.js front-end.
npm install
npm run build
- Create the PostgreSQL database
python manage.py create_db
- Start the Flask server
python manage.py runserver
- Check
localhost:5000
in your browser to view the web application.
-
Go to the extensions tab on VS Code
-
Install the recommended extensions that show up
-
Access Azure through (1) Guest Mode, (2) Creating a free Azure account or (3) signing into Azure with an existing account
-
Create an App Service instance
-
Create a PostgreSQL database with Azure Database for Postgres and connect it to the App Service instance
-
Deploy the code to your newly created App Service instance
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
- Request a new feature on GitHub.
- File a bug in GitHub Issues [TODO FIX LINK].
- Tweet us with any other feedback.
The code ships with a set of recommended Visual Studio Code extensions that will empower the developement process of your Flask + React web application. These extensions include rich language support (code completion, go to definition) for both Python and JavaScript, as well as quick deploy to Azure from within VS Code. When the project is imported into VS Code, a notifcation will appear giving you the option to install these extensions.
List of bundled extensions:
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.