#!/usr/bin/env python # -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') from lastuserapp import app app.run('0.0.0.0', 7000)
from lastuserapp import app, db from lastuser_core.models import * #incase data exists from previously run tests db.drop_all() #create schema again db.create_all() # Add fixtures for test app # user for CRUD workflow: creating client app gustav = User(username=u"gustav", fullname=u"Gustav 'world' Dachshund", password='******') # org for associating with client # client for CRUD workflow of defining perms *in* client # spare user for CRUD workflow of assigning permissions oakley = User(username=u"oakley", fullname=u"Oakley 'huh' Dachshund") dachsunited = Organization(name=u"dachsunited", title=u"Dachs United") dachsunited.owners.users.append(gustav) dachsunited.members.users.append(oakley) dachshundworld = Client(title=u"Dachshund World", org=dachsunited, confidential=True, website=u"http://gustavsdachshundworld.com") partyanimal = Permission(name=u"partyanimal", title=u"Party Animal", org=dachsunited) db.session.add(gustav) db.session.add(oakley) db.session.add(dachsunited) db.session.add(dachshundworld) db.session.add(partyanimal) db.session.commit() app.run('0.0.0.0')
# Add fixtures for test app # user for CRUD workflow: creating client app gustav = User(username=u"gustav", fullname=u"Gustav 'world' Dachshund", password='******') # org for associating with client # client for CRUD workflow of defining perms *in* client # spare user for CRUD workflow of assigning permissions oakley = User(username=u"oakley", fullname=u"Oakley 'huh' Dachshund") dachsunited = Organization(name=u"dachsunited", title=u"Dachs United") dachsunited.owners.users.append(gustav) dachsunited.members.users.append(oakley) dachshundworld = Client(title=u"Dachshund World", org=dachsunited, confidential=True, website=u"http://gustavsdachshundworld.com") partyanimal = Permission(name=u"partyanimal", title=u"Party Animal", org=dachsunited) db.session.add(gustav) db.session.add(oakley) db.session.add(dachsunited) db.session.add(dachshundworld) db.session.add(partyanimal) db.session.commit() app.run('0.0.0.0')
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') from lastuserapp import app, init_for init_for('dev') app.run('0.0.0.0', port=7000, debug=True)
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import environ environ["LASTUSER_ENV"] = "dev" from lastuserapp import app from lastuserapp.models import db db.create_all() app.run("0.0.0.0", port=7000, debug=True)