Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Created January 12, 2010 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amcgregor/275048 to your computer and use it in GitHub Desktop.
Save amcgregor/275048 to your computer and use it in GitHub Desktop.
WebCore reusable components idea.
1. Download and install WebCore using the boostrap script.
(Optional; skip this if you have an existing environment.)
2. Quickstart a new project.
(Optional; skip this if you have an existing project.)
3. Install WebCore-Blog:
pip install webcore-blog
4. Configure your application's INI file.
4a. Share your existing database with the Blog component:
(replace core with your DB connection name)
db.core.session = myapp.model:session, web.extras.blog.model:session
4b. Create a new database connection for the blog:
(replace core with your DB connection name)
db.connections = core, blog
db.blog.engine = sqlalchemy
db.blog.model = web.extras.blog.model
db.blog.sqlalchemy.url = ...
db.core.sqlalchemy.echo = False
5. Import and attach to one of your own controllers:
from web.extras.blog.controllers import BlogRootController
# ...
class RootController(Controller):
blog = BlogRootController()
6. Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment