<s> from flask import Flask <EOL> from flask . ext . superadmin import Admin , model <EOL> from utils import install_models <EOL> from django . conf import settings <EOL> settings . configure ( <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> } <EOL> ) <EOL> from django . db import models <EOL> app = Flask ( __name__ ) <EOL> app . config [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> class User ( models . Model ) : <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> username = models . CharField ( max_length = <NUM_LIT:255> , unique = True ) <EOL> email = models . CharField ( max_length = <NUM_LIT:255> , unique = True ) <EOL> def __unicode__ ( self ) : <EOL> return self . username <EOL> class Post ( models . Model ) : <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> title = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> text = models . TextField ( ) <EOL> date = models . DateField ( ) <EOL> user = models . ForeignKey ( User ) <EOL> def __unicode__ ( self ) : <EOL> return self . title <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> return '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> admin = Admin ( app , '<STR_LIT>' ) <EOL> admin . register ( User ) <EOL> admin . register ( Post ) <EOL> try : <EOL> install_models ( User , Post ) <EOL> except : <EOL> pass <EOL> app . debug = True <EOL> app . run ( '<STR_LIT>' , <NUM_LIT> ) </s>
