On Sat, Oct 31, 2009 at 11:41 PM, Thadeus Burgess <thade...@thadeusb.com>wrote:

> I prefer using a variable named PRODUCTION so that all of my "production"
> code comes first in my if statements.
>
> -Thadeus
>
>
> ...me too ==>

if not DEV_TEST:
   # production code

or

some_setting_for_production = not DEV_TEST

- Yarko


>
>
>
> On Sat, Oct 31, 2009 at 11:38 PM, Yarko Tymciurak <
> resultsinsoftw...@gmail.com> wrote:
>
>> On Sat, Oct 31, 2009 at 11:34 PM, Thadeus Burgess 
>> <thade...@thadeusb.com>wrote:
>>
>>> At the top of db.py I create a global var named PRODUCTION = True/False
>>>
>>
>> ...yeah, like I do (except  PRODUCTION = not DEV_TEST;  same difference
>> ;-))
>>
>>
>>>
>>> Then I use if statements on various things that need it. Not the
>>> cleanest, but it works.  Another alternative, is I have an app version
>>> controlled, when it is tested and stable, i commit, and tagg the commit as a
>>> stable release, then on my production i just po\ull from tags with STABLE in
>>> them.
>>>
>>> if PRODUCTION:
>>>     db = DAL('postgres....'
>>> else:
>>>     db = DAL('sqlite...')
>>>
>>> if PRODUCTION
>>>    msg = 'please click 127.0.0.1 to confirm...'
>>> else
>>>    msg = 'please click httpttp://mysite.com to confirm..'
>>>
>>> -Thadeus
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Oct 31, 2009 at 11:26 PM, Wiiboy <jordon...@gmail.com> wrote:
>>>
>>>>
>>>> Hi guys,
>>>> I think I've finally decided that Web2py will be the framework I'll be
>>>> using for my site, because deployment onto my production server worked
>>>> great.
>>>>
>>>> Now, I can't figure out how to setup MySQL on my local computer, so I
>>>> use sqlite locally.  But in production, I use MySQL.  What's the best
>>>> way to determine if it's production or not?
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to