GithubHelp home page GithubHelp logo

modularflask's Introduction

ModularFlask

Greetings und willkommen to ModularFlask, a collection of files that aim to help you create a modular Flask application. Usually I don't mind writing boilerplate for Flask projects, however I really like this project structure and wanted to share it. I tried to not make it too bloated, so don't expect your templates to be set up and everything. This is to simply be able to define your routes, logging settings, etc. in different files like a sane person.

Installation

All the packages required for its use can be found within requirements.txt. If the thought of opening this file scares you, you can alternatively do the following:

pip install flask flask_assets

As I didn't want to name your project for you, the main folder of code is named appname. If you wish to change it (which... you probably should) you will need to change the import statements in the following files:

run.py
appname/__init__.py
appname/views/__init__.py
appname/views/users.py

The last of these is technically just an example file, so really you could just delete it, but you seem like a smart person so I'm sure you'll figure it out.

As for other bits of configuration, the only thing there really is for you to change is the name of the logging file in config.py.

Usage

  • Put your classes in appname/models.py
  • Create your pages in appname/views/
  • Import your page blueprints in appname/views/__init__.py and attach them to the app.
  • $ python run.py

Credits

  • I originally organized these files for Sue.
  • A good deal of inspiration for code structure came from the Nyaa project.
  • To Jeff for irritating me with his daily creation of boilerplate projects.

Todo

  • I want to add boilerplate for setting up a database. I think that'd be nice.

modularflask's People

Contributors

manwholikespie avatar

Watchers

 avatar  avatar

modularflask's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.