Giter Club home page Giter Club logo

flaskbootstrapsecurity's Introduction

Flask Heroku Boilerplate Project

This is a fork of the original https://github.com/hansonkd/FlaskBootstrapSecurity with a SQLAlchemy backend. http://flask.pocoo.org/

This project is meant to be helpful for those who want to quickly jump into a new flask project. UserAccounts, Caching, Mail, User Registration, Roles, Python Script Commands, and Twitter Bootstrap are already configured.

The Flask Boilerplate Project consists of many projects merged into one to provide the most flexible boilerplate for your flask project.

It is pre-configured for a production Heroku environment, but can be adjusted to suit your needs.

Installation

  1. Download via git:

     git clone git://github.com/robinedwards/FlaskBootstrapSecurity.git
    
  2. Change into the cloned directory

     cd FlaskBootstrapSecurity
    
  3. Get VirtualEnv and VirtualEnvWrapper set up. See here for further details: http://www.doughellmann.com/docs/virtualenvwrapper/

  4. Create a virtualenvironment

     mkvirtualenv environment
    
  5. Install the required python dependancies:

     pip install -r requirements.txt
    
  6. Edit flask_application/config.py to change your mail server, password salt and other settings:

     class Config(object):
         SECRET_KEY = '{SECRET_KEY}'
         SITE_NAME = 'Flask Site'
         SITE_ROOT_URL = 'http://example.com'
         LOG_LEVEL = logging.DEBUG
    
         SQLALCHEMY_DATABASE_URI = 'sqlite:///../database.db'
         MEMCACHED_SERVERS = ['localhost:11211']
         SYS_ADMINS = ['[email protected]']
    
         # Configured for Gmail
         DEFAULT_MAIL_SENDER = 'Admin < [email protected] >'
         MAIL_SERVER = 'smtp.gmail.com'
         MAIL_PORT = 465
         MAIL_USE_SSL = True
         MAIL_USERNAME = '[email protected]'
         MAIL_PASSWORD = '*********'
    
         # Flask-Security setup
         SECURITY_EMAIL_SENDER = 'Security < [email protected] >'
         SECURITY_LOGIN_WITHOUT_CONFIRMATION = True
         SECURITY_REGISTERABLE = True
         SECURITY_RECOVERABLE = True
         SECURITY_URL_PREFIX = '/auth'
         SECUIRTY_POST_LOGIN = '/'
         SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
         # import uuid; salt = uuid.uuid4().hex
         SECURITY_PASSWORD_SALT = '2b8b74efc58e489e879810905b6b6d4dc6'
    
         # CACHE
         CACHE_TYPE = 'simple'
    
  7. Run a development server:

     python manage.py runserver
    

Credit

####Required Python Projects:

  • unittest2
  • Flask
  • Flask-Assets
  • cssmin
  • Flask-WTF
  • Flask-Script
  • Flask-Mail
  • Flask-Cache
  • python-memcached
  • Flask-Security
  • Flask-SQLAlchemy

####Non-Python Projects:

  • Twitter Bootstrap

####Contributing Projects:

Usage

##Commands Run these commands by using python manage.py <command>

##Templates The base template used Flask-Bootstrap for basic templates. This project can be overridden by adding your own templates to the templates folder or by taking it out.

##Static Content This project is designed to use CSSMin and Flask-Assets to manage Assets to save on bandwidth and requests.

You can find this in the style block of the layout template. You can also simply edit static/css/site.css as that is included in the base setup.

Deploying

This app is all ready configured to be deployed on Heroku with Postgres (database) and Mandrill (email).

Simply add the free tiers of those services, change your config.py SERVER_NAME, set the production config with heroku config:set PRODUCTION=yes and deploy normally.

LICENSE & COPYRIGHT

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

flaskbootstrapsecurity's People

Contributors

hansonkd avatar robinedwards avatar

Watchers

 avatar  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.