pip install Kotti kotti-create kottiapp sqlalchemy.url = sqlite:////path/to/database.db python from sqlalchemy import Column, Integer, String from kotti.resources import Content class MyModel(Content): id = Column(Integer, primary_key=True) name = Column(String(50)) python from pyramid.view import view_config @view_config(route_name='home', renderer='templates/home.pt') def home_view(request): return {'message': 'Welcome to Kotti!'} python from pyramid.config import Configurator def includeme(config): config.add_route('home', '/') config.scan() def main(global_config, **settings): config = Configurator(settings=settings) config.include(includeme) return config.make_wsgi_app()


上一篇:
下一篇:
切换中文