• PIL — this is only required if you are using a project which requires imaging capabilites (includes projects which support avatars and/or photos). It is likely the best idea to install it anyways.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
二、 Installation
(mysite-env)$
Go ahead and install Pinax:
(mysite-env)$ pip install Pinax
不过有可能会出现以下错误:
Could not find a version that satisfies the requirement pinax (from versions: 0.9a2)
因为pip使用新的 pip call 法(pip.util.call_subprocess), 故你只能使用新版的方法安装,
所以这里只要换成指定版本的方法安裝即可:$pip install 产品名称==版本(pip install pinax==0.9a2)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
三、Creating a project
Now that Pinax is installed the next step is to create a project. A project is not much more than a Django project. Pinax
provides many more defaults for you out of the box.
(mysite-env)$ pinax-admin setup_project mysite
This will create a new project named mysite. By default it will install dependencies for you. You can turn that behavior off by giving setup_project the --no-reqs option.
Pinax comes with many different project bases. The default project based is what we call layer zero. It is simply a Django project with some extra integrated dependencies that will make getting started faster.Specifying a different project base
To see what Pinax has to offer run:
(mysite-env)$ pinax-admin setup_project -l
This will list all available project bases and a short description about each. To base your project off of any of these
you’d run:
(mysite-env)$ pinax-admin setup_project -b basic mysite
In many cases the default (zero) is enough to get you going, but others may provide a better starting point for your
project.
创建工程时有可能会出现AttributeError: 'module' object has no attribute 'call_subprocess'错误
出现该问题是因为使用了新版本的pip,而在新版本的pip中,原pip.call_subprocess已经移到了pip.util.call_subprocess
因而引发异常。解决方法很简单,进入pinax目录下的core\management\commands子目录,修改setup_project.py
将其中的pip.call_subprocess改为pip.util.call_subprocess即可。
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
四、 Running a project
At this point you are now working with Django. Pinax has helped you bootstrap your project into life. Inside your
project you should run:
(mysite-env)$ python manage.py syncdb
(mysite-env)$ python manage.py runserver