Giter Site home page Giter Site logo

flask-custom-base-project's Introduction

Flask Custom Base Project

build-status

Create base project or frame for new project Flask with Authorization User

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

How to use ?

  1. Install the requirements library pip install -r requirements.txt
  2. Migrate the database, this project using MySQL Database. flask db init && flask db migrate
  3. Edit first migration file, add following codes then call seed_data() into def upgrade():
    from datetime import datetime
    def seed_data():
        app_user = sa.sql.table('app_user',
                                sa.Column('id', sa.Integer()),
                                sa.Column('created_at', sa.TIMESTAMP()),
                                sa.Column('created_by', sa.Integer()),
                                sa.Column('username', sa.String(length=255)),
                                sa.Column('password', sa.String(length=255)),
                                sa.Column('email', sa.String(length=255)),
                                sa.Column('full_name', sa.String(length=255)),
                                sa.Column('enabled', sa.Boolean()),
                                sa.Column('role', sa.String(length=255)))
        op.bulk_insert(app_user,
                       [
                           {
                               'id': 1,
                               'created_at': datetime.today(),
                               'created_by': 0,
                               'username': '<CHANGE_TO_YOUR_USERNAME>',
                               'password': '<CHANGE_TO_YOUR_HASH_PASSWORD_BASE64>',
                               'email': '<CHANGE_TO_YOUR_EMAIL>',
                               'full_name': '<CHANGE_TO_YOUR_NAME>',
                               'enabled': True,
                               'role': 'SUPERUSER'
                           }
                       ])
  4. Update src/core/config/DatabaseConfig.py with your database.
  5. Upgrade your migration into MySQL Database flask db upgrade
  6. Run the application python Application.py for debug or flask run for deployment.

Built With

Clone or Download

You can clone or download this project

git clone https://github.com/piinalpin/flask-custom-base-project.git

Authors

flask-custom-base-project's People

Contributors

piinalpin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.