Esempio n. 1
0
def resetdb():
	if request.method=='POST':
		refresh_db()
		addDefault()
		flash('Database Reset -  Please remove this function prior to deployment')
		return redirect(url_for('hello'))
	else:
		return render_template('resetdb.html')
Esempio n. 2
0
# all users will have the password "changeme"
# which looks like this:
# $2a$12$/xOeN.4B6wQsen5TgvOAMOUVvETJ8vDC8WqhjHRF2OYGSslxMmB2O


if __name__ == '__main__':
    password = '******'

    from db import User, Story, Tag, Reccomendation, addDefault, refresh_db, session as dbsession
    import random
    import loremipsum
    from datetime import datetime

    refresh_db()
    addDefault()
    print "Added Admin account."

    print "Adding users."

    for adduser in xrange(1, 1000):
        username = "******" % (adduser)
        user = User(username, '', password)
        user.species = 'Automatic'
        user.bio = 'Automatic bio'
        user.email = '*****@*****.**'
        user.minorflag = True
        user.accepttos = True
        dbsession.add(user)
    dbsession.commit()
    print "Added users."