Hi Olli,
In TG 0.9, the configuration is broken into a couple of files. One
file, config.py, travels along with your project and sets up
parameters that should be the same regardless of how/where the app is
deployed.
Another file, devcfg.py, contains the config parameters typically used
in development. prodcfg.py contains the settings you would use in
production.
You'll want to edit devcfg.py to tell TurboGears where to find your
database while in development. (Odds are that if you're deploying an
app, you'll have a different database URI as well, so you'd edit
prodcfg.py and copy that to your deployment server.)
The config documentation the website is accurate as far as database
config goes, except it does not cover the split in config files.
Kevin
On 2/15/06, Olli Wang <[EMAIL PROTECTED]> wrote:
>
> hi, Kevin. in the test project, i never modify the config file.
>
> but in the origin project i find this question, the config.py is shown
> below:
> # The settings in this file should not vary depending on the deployment
> # environment. devcfg.py and prodcfg.py are the locations for
> # the different deployment settings. Settings in this file will
> # be overridden by settings in those other files.
>
> # VIEW
>
> # which view (template engine) to use if one is not specified in the
> # template name
> tg.defaultview = "kid"
>
> # kid.outputformat="html"
> kid.encoding="utf-8"
>
> # The sitetemplate is used for overall styling of a site that
> # includes multiple TurboGears applications
> # tg.sitetemplate="<packagename.templates.templatename>"
>
> # Allow every exposed function to be called as json,
> # tg.allow_json = False
>
> # Set to True if you'd like all of your pages to include MochiKit
> # tg.mochikit_all = False
>
>
>
> # VISIT TRACKING
> # Each visit to your application will be assigned a unique visit ID
> tracked via
> # a cookie sent to the visitor's browser.
> # --------------
>
> # Enable Visit tracking
> visit.on=True
>
> # Number of minutes a visit may be idle before it expires.
> visit.timeout=20
>
> # The name of the cookie to transmit to the visitor's browser.
> visit.cookie.name="myrs-visit"
>
> # Domain name to specify when setting the cookie (must begin with .
> according to
> # RFC 2109). The default (None) should work for most cases and will
> default to
> # the machine to which the request was made. NOTE: localhost is NEVER a
> valid
> # value and will NOT WORK.
> # visit.cookie.domain=None
>
> # Specific path for the cookie
> # visit.cookie.path="/"
>
> sessionFilter.on = True
> i18n.runTemplateFilter = True
>
> # IDENTITY
> # General configuration of the TurboGears Identity management module
> # --------
>
> # Switch to turn on or off the Identity management module
> identity.on=True
>
> # [REQUIRED] URL to which CherryPy will internally redirect when an
> access
> # control check fails. If Identity management is turned on, a value for
> this
> # option must be specified.
> import myrs.controllers
> identity.failure_url=myrs.controllers.url_for_identity_failure
>
> # The IdentityProvider to use -- defaults to the
> SqlObjectIdentityProvider which
> # pulls User, Group, and Permission data out of your model database.
> identity.provider="sqlobject"
>
> # The names of the fields on the login form containing the visitor's
> user ID
> # and password. In addition, the submit button is specified simply so
> its
> # existence may be stripped out prior to passing the form data to the
> target
> # controller.
> identity.form.user_name="user_name"
> identity.form.password="password"
> identity.form.submit="login"
>
> # What sources should the identity provider consider when determining
> the
> # identity associated with a request? Comma separated list of identity
> sources.
> # Valid sources: form, visit, http_auth
> identity.source="form,http_auth,visit"
>
>
> # SqlObjectIdentityProvider
> # Configuration options for the default IdentityProvider
> # -------------------------
>
> # The classes you wish to use for your Identity model. Leave these
> commented out
> # to use the default classes for SqlObjectIdentityProvider. Or set them
> to the
> # classes in your model. NOTE: These aren't TG_* because the TG prefix
> is
> # reserved for classes created by TurboGears.
> identity.soprovider.model.user="myrs.model.User"
> identity.soprovider.model.group="myrs.model.AllGroup"
> identity.soprovider.model.permission="myrs.model.Permission"
>
> # The password encryption algorithm used when comparing passwords
> against what's
> # stored in the database. Valid values are 'md5' or 'sha1'. If you do
> not
> # specify an encryption algorithm, passwords are expected to be clear
> text.
> #
> # The SqlObjectProvider *will* encrypt passwords supplied as part of
> your login
> # form, but it is *your* responsibility to make certain the database
> contains
> # passwords encrypted using this algorithm. To make life easier you can
> call
> # turbogears.identity.current_provider.encrypt_password( pw )
> # to encrypt a password using the algorithm of the current provider.
> # identity.soprovider.encryption_algorithm=None
>
> path("/static")
> static_filter.on = True
> static_filter.dir = absfile("myrs", "static")
>
> path("/favicon.ico")
> static_filter.on = True
> static_filter.file = absfile("myrs", "static/images/favicon.ico")
>
>
>
>
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---