Dev and Prod URL

Hello,

How do you access the dev/prod URL referenced in the Radiant feature
list?

“Operates in two modes: dev and production depending on the URL”

Thanks,

Bryan

Bryan wrote:

How do you access the dev/prod URL referenced in the Radiant feature
list?

Alias the domain name so that your web server serves the same site from
different URLs. So:

http://mysite.com

Is the production URL and:

http://dev.mysite.com

Is the dev URL. If you’d like to use a different domain name for your
dev site, set it up in the config:

% script/console production
Loading production environment.

Radiant::Config[‘dev.host’] = ‘preview.mysite.com
=> “preview.mysite.com


John L.
http://wiseheartdesign.com

Hi,

The dev and prod url feature is great. I had it working briefly until I
changed some settings in a lighttpd.conf file. Now it redirects
everything to dev.

Could you recommend a way to use it with a redirect like this?

(implemented to redirect domain to www.domain).

$HTTP[“host”] =~ “^ushousingreport.com$” {
url.redirect = (
“^/(.*)” => “http://www.ushousingreport.com/$1”,
“” => “http://www.ushousingreport.com/
)
}

Maybe an exception rule to the redirect for dev.ushousingreport.com?

Thanks,

Bryan

As far as documentation goes, it isn’t readily apparent how to set up
the development sub-domain when going through the README file. I know
it’s not Radiant specific, but it might help to explain it a little
more.

A symlink seemed to be the way to point the dev.domain.com to
domain.com.

That’s basically the only step right?

Bryan wrote:

Maybe an exception rule to the redirect for dev.ushousingreport.com?

I believe you could do:

$HTTP[“host”] =~ “ushousingreport.com$” {
$HTTP[“host”] !~ “^(dev|www)” {
url.redirect = (
“^/(.*)” => “http://www.ushousingreport.com/$1”,
“” => “http://www.ushousingreport.com/
)
}
}

Is that what you mean?


John L.
http://wiseheartdesign.com

Erik M. wrote:

As far as documentation goes, it isn’t readily apparent how to set up
the development sub-domain when going through the README file. I know
it’s not Radiant specific, but it might help to explain it a little more.

A symlink seemed to be the way to point the dev.domain.com to domain.com.

That’s basically the only step right?

Yes. But you can do it a number of ways (symlink, dns, etc…). The key
thing is that Radiant uses the ‘host’ header to determine whether it is
in dev or live mode. Line 47 of site_controller.rb shows the logic:

(@request.host == @config[‘dev.host’]) or (@request.host =~ /^dev/)


John L.
http://wiseheartdesign.com

Bryan wrote:

Could you explain the difference between dev and prod modes as
implemented in Radiant? Does the URL change force Radiant code to run
in dev/prod or does it simply access different Databases using the prod
code.

I am trying to figure the best workflow for handling changes to design
and content.

dev and live mode in Radiant are different than development and
production environments in Rails (they have nothing to do with the
database). You can run in both dev and live mode regardless of the
environment you are running on. The difference between the modes is that
in dev mode you can see pages that are marked as draft, but in live mode
you cannot.

Larry M. told me that instead of using the dev and live modes he just
runs two versions of the site. One on the production Web site, and one
on his local computer. He uses sqlite for the db, and when he is ready
to go live he just copies the new database file over to the server. This
might be a good workflow solution.


John L.
http://wiseheartdesign.com

Hello,

Could you explain the difference between dev and prod modes as
implemented in Radiant? Does the URL change force Radiant code to run
in dev/prod or does it simply access different Databases using the prod
code.

I am trying to figure the best workflow for handling changes to design
and content.

Thanks,

Bryan

Bryan wrote:

Does Radiant still access the prod database when using the dev url in
production mode. I am trying to determine if I could get by using only
one DB because my host limits DBs. I probably won’t be developing or
testing code.

Yes. Radiant still uses the production database.


John L.
http://wiseheartdesign.com

John W. Long wrote:

Bryan wrote:

Could you explain the difference between dev and prod modes as
implemented in Radiant? Does the URL change force Radiant code to run
in dev/prod or does it simply access different Databases using the prod
code.

I am trying to figure the best workflow for handling changes to design
and content.

dev and live mode in Radiant are different than development and
production environments in Rails (they have nothing to do with the
database). You can run in both dev and live mode regardless of the
environment you are running on. The difference between the modes is that
in dev mode you can see pages that are marked as draft, but in live mode
you cannot.

Does Radiant still access the prod database when using the dev url in
production mode. I am trying to determine if I could get by using only
one DB because my host limits DBs. I probably won’t be developing or
testing code.

Thanks again,

Bryan

Larry M. told me that instead of using the dev and live modes he just
runs two versions of the site. One on the production Web site, and one
on his local computer. He uses sqlite for the db, and when he is ready
to go live he just copies the new database file over to the server. This
might be a good workflow solution.


John L.
http://wiseheartdesign.com