In order to install TurboGears we need Python setuptools and in order to create an isolated environment we need virtualenv package. Why an isolated environment? With a virtual environment we don’t need to think about our packages clashing.
Install requirements:
sudo apt-get install build-essential python-dev python-setuptools python-virtualenv
Those installation requirements are not specific to TurboGears. If you are working with Python anyway and tried to use any Python package management that means you already have these packages.
The standard installation
$ virtualenv --no-site-packages tg2env$ cd tg2env/ $ source bin/activate (tg2env)$ easy_install -i http://tg.gy/current/index/ tg.devtools (tg2env)$ deactivate
You may get errors depending on your system and your system’s requirements. If you have not seen any errors, congratulations, you have installed TurboGears 2.1.4 (the current stable release as of this writing) and its dependencies successfully.
The pip way
You have tried to install TurboGears with the standard way however you are curious. How to install with pip as well? Fear not, young TGer. I will feed your hunger.
pip install -i http://tg.gy/current tg.devtools
Pingback: Introduction to TurboGears | TurboGears Notes
Hi,
I would like to ask if Turbogears is working well with Windows 64bit?
What is the installation process of Turbogears for 64bit Windows?
Thanks
hi cedric,
there is no reason for TurboGears not to work with 64-bit windows.
you need Python on your computer, setuptools package which can be found at http://pypi.python.org/pypi/setuptools#windows and then the rest is same.
you install virtualenv with easy_install virtualenv and then you are good to go with the same steps as linux or unix.
do you think a post on installing on windows would help?
Thanks for your time and help.
I already install installed Turbogears in my Windows.
However, I am quite confuse because in the templates folder I have files like about.mak, index.mak, header.mak, master.mak . Are these files supposedly html files?
I want to access the html files so that i could design the project first.
hi Cedrick,
you have generated a TurboGears project with mako templates. those are supposedly html files which also support python operations and you can access the variables exposed to views.
please read http://www.turbogears.org/book/part1/wiki20.html for more information.
Another question.
How do you make a login session in Turbogears? Just like a cookie login in php. ? Where in it can save the username info who login in the system? and how do you access it?
hi Cedrick,
here you can read about the built-in authentication and authorization support in TG http://www.turbogears.org/2.2/docs/main/Auth/index.html.
Another question.
I can do a little python in my mak files like this..
% for a,b,c in zip([0,1,2,3,4,5], courselist[0], courseid[0]):
form1.Courses.options[${a}] =new Option(‘${b}’,'${c}’);
% endfor
however, i have a variable i in java script.
how could i use the variable i in the python loop?
I need to do like this:
% for a,b,c in zip([0,1,2,3,4,5], courselist[i], courseid[i]):
form1.Courses.options[${a}] =new Option(‘${b}’,'${c}’);
% endfor
however, it tells an error because i is undefined. I really need to use the value of i in the loop.
Cedrick,
When I need to form a JavaScript array in my templates, I use something like this: https://gist.github.com/mengu/4f6fe739014db8fc558b
Hi, I have successfully created a working project.
Thanks for your time and suggestions.
Do you have any idea how to make my project working online. How to install Turbogears in a hosting site?
Do you know any free hosting sites for Turbogears?
hi Cedrick,
you can try webfaction hosting or a linode vps.
How can i access my application/project using another computer? via adhoc?
If the project is working in laptop1, can laptop2 access the project as well..?