Noah, I appreciate the reply; that is a solution I had considered.
However, it feels like such a kludgy solution. Is there really no Trac-sanctioned way to write a plugin that will do what I'm asking? ~Drew On Tuesday, October 15, 2013 11:52:08 PM UTC-4, Noah Kantrowitz wrote: > > In your procfile, just make the process started be a bash script that > writes out trac.ini based on $database_url and then execs gunicorn. > > --Noah > > Drew Carey Buglione <[email protected] <javascript:>> wrote: >> >> I'm attempting to create what I believe should be a very simple >>>> Trac plugin. All I want to do is set the database string from an >>>> environmental variable. >>>> >>>> I've been playing around with this for a bit now, and I can't >>>> figure out the way I ought to do this. >>>> >>>> I'm under the impression that I want to do something like the >>>> following: >>>> >>>> self.config.set('trac', 'database', >>>> os.environ.get('DATABASE_URL')) >>>> >>>> But I'm not sure where. Or how. >>>> >>>> Thanks for any help, >>>> ~Drew Carey Buglione >>>> >>> >>> In theory , yes . Nevertheless DB string is supposed to be configured in >>> trac.ini . I'm not sure if your approach will work , but I wonder why is >>> it that config is not enough for you ? Maybe what you need is not exactly a >>> plugin but an external script ? >>> >> >> Thank you for responding, Olemis. >> >> My reason for desiring to do things this way is simple: I'm running Trac >> on Heroku, where there is a convention of keeping all private or >> environment-specific data in config variables. >> >> I can not deploy any files to Heroku without checking them into version >> control, and I'd like to avoid checking my database string into version >> control. >> >> Heroku provides the database string as an environmental variable, though, >> so if anyone has any idea how I can go about resolving my problem th e way >> I'd like to, I'd really appreciate some pointers. >> >> ~Drew Carey Buglione >> >> -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/trac-dev. For more options, visit https://groups.google.com/groups/opt_out.
