primaryobjects / Python-React-Starter-Template

Python Flask React 4 Single Page App Starter Template with Bootstrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Bootstrap Flask React Starter Template

A quick and easy Python + Flask + React template project, using Twitter Bootstrap 5.0 and React Router for creating a simple single page application.

Python Flask, React Router, Twitter Bootstrap template screenshot.

Usage

  • Clone repository.
  • Open a command prompt, navigate to the folder, and enter: npm install
  • Next, run a build of the React client by entering: npm run dev

Development Usage

You can make changes to the pages in /src/components and see them update live.

Demo:

http://pythonbootstrapper.herokuapp.com

Contents:

  • /src/index.js
  • /src/App.js
  • /src/components/Header/index.js
  • /src/components/Footer/index.js
  • /src/components/Home/index.js
  • /src/components/About/index.js
  • /src/components/Contact/index.js
  • /src/components/NotFound/index.js

Editing Pages:

Edit /src/components/Home/index.js to add your content to the Home page. The default contents include:

class Home extends Component {
  render() {
    return (
      <h1>Home</h1>
      <div>{this.state.time}</div>
    )
  }
}

Deploying on Heroku

After creating the application on Heroku, click Settings, under Buildpacks, add heroku/nodejs and heroku/python.

This will allow Heroku to build the react static files and serve the Python Flask app.

Author

Kory Becker http://www.primaryobjects.com/kory-becker

About

Python Flask React 4 Single Page App Starter Template with Bootstrap


Languages

Language:JavaScript 65.5%Language:HTML 23.3%Language:CSS 5.6%Language:Python 5.2%Language:Shell 0.5%