Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A great starting point to build your SaaS in Flask & Python, with Stripe subscription billing 🚀

License

NotificationsYou must be signed in to change notification settings

alectrocute/flaskSaaS

Repository files navigation

License

A fork ofMax Halford'sflask-boilerplate. I've noticed SaaS bootstraps/boilerplates being sold upwards of $1,000 per year and I think that's fucking ridiculous. This project will be my attempt to make a great starting point for your next big business as easy and efficent as possible.

If you're here because of Siraj'svideo, welcome!

Features

  • User account sign up, sign in, password reset, all through asynchronous email confirmation.
  • Form generation.
  • Error handling.
  • HTML macros and layout file.
  • "Functional" file structure.
  • Python 3.x compliant.
  • Asynchronous AJAX calls.
  • Administration panel.
  • Logging.
  • Stripe subscriptions. (WIP)
  • RESTful API for payments.
  • Simple RESTful API to communicate with your app.

Libraries

Backend

Frontend

Structure

I did what most people recommend for the application's structure. Basically, everything is contained in theapp/ folder.

  • There you have the classicstatic/ andtemplates/ folders. Thetemplates/ folder contains macros, error views and a common layout.
  • I added aviews/ folder to separate the user and the website logic, which could be extended to the the admin views.
  • The same goes for theforms/ folder, as the project grows it will be useful to split the WTForms code into separate files.
  • Themodels.py script contains the SQLAlchemy code, for the while it only contains the logic for ausers table.
  • Thetoolbox/ folder is a personal choice, in it I keep all the other code the application will need.
  • Management commands should be included inmanage.py. Enterpython manage.py -? to get a list of existing commands.
  • I added a Makefile for setup tasks, it can be quite useful once a project grows.

Setup

Vanilla

  • Install the requirements and setup the development environment.

    make install && make dev

  • Create the database.

    python manage.py initdb

  • Run the application.

    python manage.py runserver

  • Navigate tolocalhost:5000.

Configuration

The goal is to keep most of the application's configuration in a single file calledconfig.py. I added aconfig_dev.py and aconfig_prod.py who inherit fromconfig_common.py. The trick is to symlink either of these toconfig.py. This is done in by runningmake dev ormake prod.

I have included a working Gmail account to confirm user email addresses and reset user passwords, although in production you should't include the file if you push to GitHub because people can see it. The same goes for API keys, you should keep them secret. You can read more about secret configuration fileshere.

Readthis for information on the possible configuration options.

License

The MIT License (MIT). Please see thelicense file for more information.

About

A great starting point to build your SaaS in Flask & Python, with Stripe subscription billing 🚀

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp