[Dancer-users] setting environment in Apache config

Mr. Puneet Kishor punkish at eidesis.org
Sat Mar 5 21:20:17 CET 2011


I can't figure out how to tell Dancer that my app should use development.yml under Apache.

I have the following in vhosts.conf

 SetEnv DANCER_ENVIRONMENT "development"

When I put the following fragment in config.yml, everything works

db_name: "mydb"
db_user: "dev"
db_pass: "dev"

When I take the above out of config.yml, and put it in development.yml, all the config->{} values are empty. For example, I get the following error in my Apache log

 DBI connect('dbname=','',...) failed: FATAL:

because, my code is

my $dbh = DBI->connect(
	"dbi:Pg:dbname=" . config->{db_name}, 
	config->{db_user}, 
	config->{db_pass}, 
	{AutoCommit => 0}
);

If I put the above in development.yml, and put the following in production.yml, it fails because it can't find the prod databases

db_name: "mydb"
db_user: "prod"
db_pass: "prod"

It is almost as if development.yml is not being seen at all. It is being bypassed. Maybe that also explains why I am not getting any development.log.

Any ideas? I am using Dancer 1.3011.

Puneet,


More information about the Dancer-users mailing list