# Flask-Security
app.config["SECURITY_CONFIRMABLE"] = True
app.config["SECURITY_TRACKABLE"] = True
app.config["SECURITY_REGISTERABLE"] = True
app.config["SECURITY_RECOVERABLE"] = True
app.config["SECURITY_CHANGEABLE"] = True
app.config["SECURITY_REGISTER_USER_TEMPLATE"] = 'accounts/register.html'
app.config["SECURITY_LOGIN_USER_TEMPLATE"] = 'accounts/login.html'
app.config["SECURITY_FORGOT_PASSWORD_TEMPLATE"] = 'accounts/forgot-password.html'
app.config["SECURITY_CHANGE_PASSWORD_TEMPLATE"] = 'accounts/change-password.html'
app.config["SECURITY_SEND_REGISTER_EMAIL"] = False
app.config["SECURITY_SEND_PASSWORD_CHANGE_EMAIL"] = False
app.config["SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL"] = False
app.config["SECURITY_PASSWORD_HASH"] = 'sha512_crypt'
app.config["SECURITY_PASSWORD_SALT"] = '' # Set password salt

# Flask-Mail
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = '' # Place email address
app.config['MAIL_PASSWORD'] = '' # Place password
mail = Mail(app)

# Flask-ErrorMail
ADMINISTRATORS = [""] # Set administrators emails
mail_on_500(app, ADMINISTRATORS, sender='') # Add sender email

# Flask-DebugToolBar
app.config['DEBUG_TB_PANELS'] = ['flask.ext.mongoengine.panels.MongoDebugPanel']
Example #2
0
__author__ = "Gangeshwar"
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy

application = Flask(__name__)
application.config.from_object("config")
db = SQLAlchemy(application)
application.config["SECURITY_PASSWORD_HASH"] = "bcrypt"
application.config["SECURITY_PASSWORD_SALT"] = "$2a$16$PnnIgfMwkOjGX4SkHqSOPO"

from main import views, models
#Create an Instance of Flask
app = Flask(__name__)

#Include config from config.py
app.config.from_object('config')
app.config['UPLOAD_FOLDER'] = 'app/static/img/'
app.config['ALLOWED_EXTENSIONS'] = set(['png', 'jpg', 'jpeg', 'csv'])
app.config['WTF_CSRF_SECRET_KEY'] = '1234'
app.config["MAIL_SERVER"] = "mail.car.loc"
app.config["MAIL_PORT"] = 25
app.config["MAIL_USE_SSL"] = False
app.config["MAIL_USERNAME"] = None
app.config["MAIL_PASSWORD"] = None
app.secret_key = "1234"
app.config["SECURITY_PASSWORD_SALT"] = '1234'
app.config["POSTS_PER_PAGE"] = 10

#Create an instance of SQLAclhemy
db = SQLAlchemy(app)

mail = Mail(app)

login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'

from app import models, forms, token

from app.views import index, signup, cercar, esborrar, upload, perfil, signin, signout, f_password, add_ge_car, up_json, editar_gecar
Example #4
0
app = Flask(__name__, static_folder="static")
app.config["DEBUG"] = True
app.config["SECRET_KEY"] = 'not-secret'

app.config["MONGODB_DB"] = 'confessionsplus'
app.config["MONGODB_HOST"] = 'localhost'
app.config["MONGODB_PORT"] = 27017

app.config["FACEBOOK_APP_ID"] = "328075160635846"
app.config["FACEBOOK_APP_SECRET"] = "36a95cf8babf110ae8b6f7d49c127725"

app.config["SECURITY_REGISTERABLE"] = True

app.config["SECURITY_PASSWORD_HASH"] = "bcrypt"
app.config["SECURITY_PASSWORD_SALT"] = "salty"
app.config["SECURITY_POST_LOGIN"] = "/"
app.config["SECURITY_POST_LOGOUT"] = "/"

oauth = OAuth()
db = MongoEngine(app)
csrf(app)

def register_blueprints(app):
  from views import posts, profile, main, admin
  app.register_blueprint(main)
  app.register_blueprint(posts)
  app.register_blueprint(profile)
  app.register_blueprint(admin)

register_blueprints(app)
Example #5
0
# Create application
app = Flask(__name__)
app.config["SECRET_KEY"] = "COfwEzLtXbxwuIxkTNBcG0"

# Mail
app.config["MAIL_SERVER"] = "smtp.gmail.com"
app.config["MAIL_PORT"] = "465"
app.config["MAIL_USE_SSL"] = True
app.config["MAIL_USERNAME"] = "botflasktest@gmail.com"
app.config["MAIL_PASSWORD"] = "medabots"
app.config["MAIL_DEFAULT_SENDER"] = "naoresponder"
mail = Mail(app)


# Create dummy secrety key so we can use sessions
app.config["SECURITY_PASSWORD_SALT"] = "COfwEzLtXbxwuIxkTNBcG0"
app.config["SECURITY_PASSWORD_HASH"] = "bcrypt"
app.config["SECURITY_RECOVERABLE"] = True

# Create in-memory database
app.config["DATABASE_FILE"] = "sample_db.sqlite"
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + app.config["DATABASE_FILE"]
app.config["SQLALCHEMY_ECHO"] = True
db = SQLAlchemy(app)

# Create directory for file fields to use
file_path = op.join(op.dirname(__file__), "static/files")

# thumb name generator function