On Apr 16, 2007, at 5:40 PM, lokki wrote:

>
>
>
> On Apr 16, 3:37 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]>
> wrote:
>>> (I have found that is is easier to make the app rather than
>>> distributing it, thats a pity i think. Packaging and Distributing
>>> should be first priority for TG community if we want TurboGears to
>>> expand and to be massified)
>>
>> I don't share your obsevrations here. Packaging and deployment is  
>> considerably
>> easy with TG due to the heavy use of setuptools. Create the egg,  
>> transfer it
>> to the server, and invoke easy_install.
>>
>> And usually, TG applications don't get distributed the way you  
>> seem to want
>> it - normally, one installs a webserver, a python distribution and  
>> so forth,
>> setting up the whole environment. Then deploys the app.
>>
>> Diez
>
> The problem is with the nature of the webserver, The website i am
> developing (my first app with turbogears) will be deployed at a RH
> enterprise server,(i dont thing i get the name of the distro right,
> but i hope u understand what distro i mean ), this server is not setup
> up to work with python applications, (and for some reasons i cant just
> change the hosting company) and althought python is there it dosent
> have setup-tools installed, this situation is not an exception, many
> maybe most of the small web hosting companies that i have worked with
> tend not to support Python app's(TurboGears websites in this case), so
> tools like easy_install are missing. I am not saying that TG is not
> easilly deployable on a webserver that supports python on the contrary
> i believe it is easy as running easy_install, the problem is that web
> hosting companies dont "support" python, so the whole deployment thing
> starts being an issue. I havent had any difficulties making TG run on
> my PC nor on other PC's thanx to setup_tools, the thing is that
> sometimes tha admins are not very eager to help or they dont want to
> spend time setting up python the right way, this is   what i mean when
> i say its not the easiest thing.

Sorry for repeating myself but this is exactly where workingenv.py  
shines, check it out:

1) wget http://svn.colorstudy.com/home/ianb/workingenv/workingenv.py

2) python workingenv.py MyEnvironment

That would create an environment at MyEnvironment and install  
setuptools *inside* that environment, no need to have setuptools  
installed globally.

3) source MyEnviornment/bin/activate

Will activate, this is, change PATH and PYTHONPATH so python looks  
for packages in the enviornment first.

4) python setup.py install MyTGApp

Will install the app *inside* the environment along all its  
dependencies (you might have to install some of them manually if  
you're not too lucky). Note that this procedure can be executed by a  
non-root user since site-packages is not modified in any way.

At this point, you'll essentially have a "frozen" (not in the sense  
the freeze script does but useful enough to deploy elsewhere) and  
isolated "app" (in the sense of a collection of software and  
libraries that do something useful) inside that directory.

If the target platform is binary compatible (so C extensions work out  
of the box) deployment is as easy as zipping the whole environment,  
copying to target machine, do 3) and run start-myapp.py myconfig.cfg.  
If it's not binary compatible then cross-compile or compile at target  
machine directly.

You could also install a different version of python ithan the one  
used in the system, if needed, by compiling it with -- 
prefix=MyEnvironment (although in this scenario virtual_python.py  
might be a better alternative)

HTH,
Alberto

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to