Pinax安装调试手记

Pinax 的官方站点

http://pinaxproject.com/|http://pinaxproject.com/

下载源代码的位置

http://pinaxproject.com/downloads/|http://pinaxproject.com/downloads/

补充一下,上面网址已经失效,新的:https://github.com/pinax/pinax/tree/master   (2013.12.19)

下载完成后,解压缩

$ tar zxvf Pinax-0.7.3-bundle.tar.gz

安装

[lidong@queen ~/Pinax-0.7.3-bundle]$ python scripts/pinax-boot.py ../pinax-env
New python executable in ../pinax-env/bin/python
Installing setuptools............done.
Installing setuptools-dummy 0.0.3
Installing setuptools-git 0.3.4
Installing Django 1.0.4
Going to install a full Pinax 0.7.3 release.
  Installing Pinax
Ignoring indexes: http://pypi.python.org/simple
Downloading/unpacking django-openid==0.2.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 43))
  Running setup.py egg_info for package django-openid
Downloading/unpacking django-friends==0.1.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 35))
  Running setup.py egg_info for package django-friends
Downloading/unpacking vobject==0.8.1c (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 16))
  Running setup.py egg_info for package vobject
Downloading/unpacking django-tagging==0.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 48))
  Running setup.py egg_info for package django-tagging
Downloading/unpacking django-pagination==1.0.6 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 44))
  Running setup.py egg_info for package django-pagination
Downloading/unpacking django-photologue==2.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 54))
  Running setup.py egg_info for package django-photologue
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking django-oembed==0.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 42))
  Running setup.py egg_info for package django-oembed
Downloading/unpacking django-uni-form==0.6.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 51))
  Running setup.py egg_info for package django-uni-form
Downloading/unpacking django-mailer==0.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 38))
  Running setup.py egg_info for package django-mailer
Downloading/unpacking django-sorting>=0.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 47))
  Running setup.py egg_info for package django-sorting
Downloading/unpacking django-generic-flatblocks==0.9.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 58))
  Running setup.py egg_info for package django-generic-flatblocks
Downloading/unpacking django-robots==0.6.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 45))
  Running setup.py egg_info for package django-robots
Downloading/unpacking django-threadedcomments==0.5.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 49))
  Running setup.py egg_info for package django-threadedcomments
Downloading/unpacking django-avatar==1.0.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 27))
  Running setup.py egg_info for package django-avatar
Downloading/unpacking sorl==3.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 57))
  Running setup.py egg_info for package sorl
Downloading/unpacking django-db-log==1.0.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 29))
  Running setup.py egg_info for package django-db-log
Downloading/unpacking gdata==1.3.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 9))
  Running setup.py egg_info for package gdata
Downloading/unpacking django-gravatar==0.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 36))
  Running setup.py egg_info for package django-gravatar
Downloading/unpacking python-yadis==1.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 13))
  Running setup.py egg_info for package python-yadis
Downloading/unpacking django-filter==0.5.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 60))
  Running setup.py egg_info for package django-filter
    warning: no files found matching '*' under directory 'django_filters/fixtures'
    warning: no files found matching '*' under directory 'django_filters/tests/templates/django_filters'
Downloading/unpacking django-timezones==0.1.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 50))
  Running setup.py egg_info for package django-timezones
Downloading/unpacking django-dbtemplates==0.5.8 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 30))
  Running setup.py egg_info for package django-dbtemplates
Downloading/unpacking BeautifulSoup==3.0.7a (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 17))
  Running setup.py egg_info for package BeautifulSoup
Downloading/unpacking django-announcements==0.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 25))
  Running setup.py egg_info for package django-announcements
Downloading/unpacking textile==2.1.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 15))
  Running setup.py egg_info for package textile
Downloading/unpacking docutils==0.5 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 7))
  Running setup.py egg_info for package docutils
    "optparse" module already present; ignoring extras/optparse.py.
    "textwrap" module already present; ignoring extras/textwrap.py.
    "roman" module already present; ignoring extras/roman.py.
Downloading/unpacking django-locations==0.1.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 37))
  Running setup.py egg_info for package django-locations
Downloading/unpacking django-markup==0.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 56))
  Running setup.py egg_info for package django-markup
    no previously-included directories found matching 'docs/_build/*'
Downloading/unpacking django-atomformat==0.1.0dev (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 26))
  Running setup.py egg_info for package django-atomformat
Downloading/unpacking django-swaps==0.5.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 46))
  Running setup.py egg_info for package django-swaps
    warning: no files found matching 'CONTRIBUTORS.txt'
Downloading/unpacking geopy==0.93dev-r0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 21))
  Running setup.py egg_info for package geopy
Downloading/unpacking creole==1.0.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 23))
  Running setup.py egg_info for package creole
Downloading/unpacking django-ajax-validation==0.1.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 24))
  Running setup.py egg_info for package django-ajax-validation
Downloading/unpacking django-wikiapp==0.2.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 53))
  Running setup.py egg_info for package django-wikiapp
Downloading/unpacking simplejson==2.0.9 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 14))
  Running setup.py egg_info for package simplejson
Downloading/unpacking django-notification==0.1.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 41))
  Running setup.py egg_info for package django-notification
Downloading/unpacking django-frontendadmin==0.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 59))
  Running setup.py egg_info for package django-frontendadmin
Downloading/unpacking django-flag==0.1.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 34))
  Running setup.py egg_info for package django-flag
Downloading/unpacking django-bookmarks==0.1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 28))
  Running setup.py egg_info for package django-bookmarks
Downloading/unpacking pytz==2009l (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 22))
  Running setup.py egg_info for package pytz
    warning: no files found matching '*.pot' under directory 'pytz'
    warning: no previously-included files found matching 'test_zdump.py'
Downloading/unpacking template-utils==0.4p2 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 61))
  Running setup.py egg_info for package template-utils
Downloading/unpacking Pinax==0.7.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 63))
  Running setup.py egg_info for package Pinax
Downloading/unpacking python-dateutil==1.4.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 6))
  Running setup.py egg_info for package python-dateutil
Downloading/unpacking python-openid==2.2.4 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 11))
  Running setup.py egg_info for package python-openid
    warning: no files found matching 'CHANGELOG'
    warning: no files found matching '*.css' under directory 'doc'
    warning: no files found matching '*.html' under directory 'doc'
Downloading/unpacking elementtree==1.2.7-20070827-preview (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 8))
  Running setup.py egg_info for package elementtree
Downloading/unpacking diff-match-patch==20090804 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 20))
  Running setup.py egg_info for package diff-match-patch
Downloading/unpacking django-debug-toolbar==0.7.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 31))
  Running setup.py egg_info for package django-debug-toolbar
Downloading/unpacking Markdown==2.0.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 19))
  Running setup.py egg_info for package Markdown
Downloading/unpacking ybrowserauth==1.2 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 18))
  Running setup.py egg_info for package ybrowserauth
Downloading/unpacking django-extensions==0.4.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 33))
  Running setup.py egg_info for package django-extensions
Downloading/unpacking django-email-confirmation==0.1.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 32))
  Running setup.py egg_info for package django-email-confirmation
Downloading/unpacking django-staticfiles==0.1.2 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 62))
  Running setup.py egg_info for package django-staticfiles
Downloading/unpacking python-twitter==0.6 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 12))
  Running setup.py egg_info for package python-twitter
Downloading/unpacking Pygments==1.0 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 10))
  Running setup.py egg_info for package Pygments
Downloading/unpacking django-messages==0.4.2 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 39))
  Running setup.py egg_info for package django-messages
Downloading/unpacking django-voting==0.1 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 52))
  Running setup.py egg_info for package django-voting
Downloading/unpacking django-microblogging==0.1.2 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 40))
  Running setup.py egg_info for package django-microblogging
Downloading/unpacking django-attachments==0.3 (from -r /home/lidong/Pinax-0.7.3-bundle/requirements/0.7.3/release.txt (line 55))
  Running setup.py egg_info for package django-attachments
    warning: no files found matching '*' under directory 'attachments/fixtures'
Installing collected packages: BeautifulSoup, creole, diff-match-patch, django-ajax-validation, django-announcements, django-atomformat, django-attachments, django-avatar, django-bookmarks, django-db-log, django-dbtemplates, django-debug-toolbar, django-email-confirmation, django-extensions, django-filter, django-flag, django-friends, django-frontendadmin, django-generic-flatblocks, django-gravatar, django-locations, django-mailer, django-markup, django-messages, django-microblogging, django-notification, django-oembed, django-openid, django-pagination, django-photologue, django-robots, django-sorting, django-staticfiles, django-swaps, django-tagging, django-threadedcomments, django-timezones, django-uni-form, django-voting, django-wikiapp, docutils, elementtree, gdata, geopy, Markdown, Pinax, Pygments, python-dateutil, python-openid, python-twitter, python-yadis, pytz, simplejson, sorl, template-utils, textile, vobject, ybrowserauth
  Running setup.py install for BeautifulSoup
  Running setup.py install for creole
    changing mode of build/scripts-2.6/creole2html.py from 644 to 755
    changing mode of /home/lidong/pinax-env/bin/creole2html.py to 755
  Running setup.py install for diff-match-patch
  Running setup.py install for django-ajax-validation
  Running setup.py install for django-announcements
  Running setup.py install for django-atomformat
  Running setup.py install for django-attachments
    warning: no files found matching '*' under directory 'attachments/fixtures'
  Running setup.py install for django-avatar
  Running setup.py install for django-bookmarks
  Running setup.py install for django-db-log
  Running setup.py install for django-dbtemplates
  Running setup.py install for django-debug-toolbar
  Running setup.py install for django-email-confirmation
  Running setup.py install for django-extensions
  Running setup.py install for django-filter
    warning: no files found matching '*' under directory 'django_filters/fixtures'
    warning: no files found matching '*' under directory 'django_filters/tests/templates/django_filters'
  Running setup.py install for django-flag
  Running setup.py install for django-friends
  Running setup.py install for django-frontendadmin
  Running setup.py install for django-generic-flatblocks
  Running setup.py install for django-gravatar
  Running setup.py install for django-locations
  Running setup.py install for django-mailer
  Running setup.py install for django-markup
    no previously-included directories found matching 'docs/_build/*'
  Running setup.py install for django-messages
  Running setup.py install for django-microblogging
  Running setup.py install for django-notification
  Running setup.py install for django-oembed
  Running setup.py install for django-openid
  Running setup.py install for django-pagination
  Running setup.py install for django-photologue
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
  Running setup.py install for django-robots
  Running setup.py install for django-sorting
  Running setup.py install for django-staticfiles
  Running setup.py install for django-swaps
    warning: no files found matching 'CONTRIBUTORS.txt'
  Running setup.py install for django-tagging
  Running setup.py install for django-threadedcomments
  Running setup.py install for django-timezones
  Running setup.py install for django-uni-form
  Running setup.py install for django-voting
  Running setup.py install for django-wikiapp
  Running setup.py install for docutils
    "optparse" module already present; ignoring extras/optparse.py.
    "textwrap" module already present; ignoring extras/textwrap.py.
    "roman" module already present; ignoring extras/roman.py.
    changing mode of build/scripts-2.6/rst2html.py from 644 to 755
    changing mode of build/scripts-2.6/rst2s5.py from 644 to 755
    changing mode of build/scripts-2.6/rst2latex.py from 644 to 755
    changing mode of build/scripts-2.6/rst2newlatex.py from 644 to 755
    changing mode of build/scripts-2.6/rst2xml.py from 644 to 755
    changing mode of build/scripts-2.6/rst2pseudoxml.py from 644 to 755
    changing mode of build/scripts-2.6/rstpep2html.py from 644 to 755
    changing mode of /home/lidong/pinax-env/bin/rst2html.py to 755
    changing mode of /home/lidong/pinax-env/bin/rst2s5.py to 755
    changing mode of /home/lidong/pinax-env/bin/rst2latex.py to 755
    changing mode of /home/lidong/pinax-env/bin/rst2newlatex.py to 755
    changing mode of /home/lidong/pinax-env/bin/rst2xml.py to 755
    changing mode of /home/lidong/pinax-env/bin/rst2pseudoxml.py to 755
    changing mode of /home/lidong/pinax-env/bin/rstpep2html.py to 755
  Running setup.py install for elementtree
  Running setup.py install for gdata
  Running setup.py install for geopy
  Running setup.py install for Markdown
    changing mode of build/scripts-2.6/markdown from 644 to 755
    changing mode of /home/lidong/pinax-env/bin/markdown to 755
  Running setup.py install for Pinax
    Installing pinax-admin script to /home/lidong/pinax-env/bin
  Running setup.py install for Pygments
    Installing pygmentize script to /home/lidong/pinax-env/bin
  Running setup.py install for python-dateutil
  Running setup.py install for python-openid
    warning: no files found matching 'CHANGELOG'
    warning: no files found matching '*.css' under directory 'doc'
    warning: no files found matching '*.html' under directory 'doc'
  Running setup.py install for python-twitter
  Running setup.py install for python-yadis
  Running setup.py install for pytz
    warning: no files found matching '*.pot' under directory 'pytz'
    warning: no previously-included files found matching 'test_zdump.py'
  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    cc -fno-strict-aliasing -DNDEBUG -O2 -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -fPIC -I/usr/local/include/python2.6 -c simplejson/_speedups.c -o build/temp.freebsd-8.0-RELEASE-amd64-2.6/simplejson/_speedups.o
    cc -shared -pthread build/temp.freebsd-8.0-RELEASE-amd64-2.6/simplejson/_speedups.o -o build/lib.freebsd-8.0-RELEASE-amd64-2.6/simplejson/_speedups.so
  Running setup.py install for sorl
  Running setup.py install for template-utils
  Running setup.py install for textile
  Running setup.py install for vobject
    Installing change_tz script to /home/lidong/pinax-env/bin
    Installing ics_diff script to /home/lidong/pinax-env/bin
  Running setup.py install for ybrowserauth
Successfully installed BeautifulSoup creole diff-match-patch django-ajax-validation django-announcements django-atomformat django-attachments django-avatar django-bookmarks django-db-log django-dbtemplates django-debug-toolbar django-email-confirmation django-extensions django-filter django-flag django-friends django-frontendadmin django-generic-flatblocks django-gravatar django-locations django-mailer django-markup django-messages django-microblogging django-notification django-oembed django-openid django-pagination django-photologue django-robots django-sorting django-staticfiles django-swaps django-tagging django-threadedcomments django-timezones django-uni-form django-voting django-wikiapp docutils elementtree gdata geopy Markdown Pinax Pygments python-dateutil python-openid python-twitter python-yadis pytz simplejson sorl template-utils textile vobject ybrowserauth
Please activate the newly created virtualenv by running: 
  source ../pinax-env/bin/activate
Pinax environment created successfully.

接下来干什么? 上面的脚本的输出已经明白的告诉你了

[lidong@queen ~/Pinax-0.7.3-bundle]$ source ../pinax-env/bin/activate
(pinax-env)[lidong@queen ~/Pinax-0.7.3-bundle]$ 

恭喜!已经安装好了

----

下面开始 Pinax 之旅

官方网站的文档,往往就是一个最好的起步教程 http://pinaxproject.com/docs/0.7/

不过是英文档,什么!你看不懂英文文档。 OK,可以回去洗洗睡了。 

要想玩儿明白最新潮的最新鲜的开源软件,比如像 Pinax 这样的,很不幸的告诉你,目前只有英文文档可以参考。

Starting a new Pinax project 创建一个新的Pinax项目

教程上说了,开启一个新的项目最方便的方法就是从一个克隆一个模板项目,然后再这个基础上继续开发。

试着执行了一下 pinax-admin clone_project -l

看到可供选择的模板项目有好几个:

写道

(pinax-env)[lidong@queen ~/Pinax-0.7.3-bundle]$ pinax-admin clone_project -l
Available Projects
------------------
basic_project:
This project comes with the bare minimum set of applications and templates
to get you started. It includes no extra tabs, only the profile and notices
tabs are included by default. From here you can add any extra functionality
and applications that you would like.

cms_project_company:
A very simple CMS that lets you set up templates and then edit content,
including images, right in the frontend of the site.

The sample media, templates and content including in the project demonstrate
a basic company website.

cms_project_holidayhouse:
A very simple CMS that lets you set up templates and then edit content,
including images, right in the frontend of the site.

The sample media, templates and content including in the project demonstrate
a basic site for holiday house rentals.

code_project:
This project demonstrates group functionality and the tasks, wiki and topics
apps. It is intended to be the starting point for things like code project
management where each code project gets its own wiki, task tracking system
and threaded discussions.

intranet_project:
This project demonstrates a closed site requiring an invitation to join and
not exposing any information publicly. It provides a top-level task tracking
system, wiki and bookmarks. It is intended to be the starting point of sites
like intranets.

private_beta_project:
This project demonstrates the use of a waiting list and signup codes for
sites in private beta. Otherwise it is the same as basic_project.

sample_group_project:
This project demonstrates group functionality with a barebones group
containing no extra content apps as well as two additional group types,
tribes and projects, which show different membership approaches and
content apps.

social_project:
This project demonstrates a social networking site. It provides profiles,
friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps,
locations and user-to-user messaging.

In 0.5 this was called "complete_project".

没时间仔细翻译上面所有内容了,粗略的看了看,其中 social_project 是大而全的社交网络型的项目,既然是吃螃蟹,当然吃整个的了,所以就创建一个包含内容最多的这个吧。

$pinax-admin clone_project social_project mysite
Copying your project to its new location
Updating settings.py for your new project
Renaming and updating your deployment files
Finished cloning your project, now you may enjoy Pinax!

当前目录下面就有了一个 mysite 的新目录。

写道
cd mysite

进来一看,恩,如果你是有Django项目开发经验的就会开心的笑了,里面的东西咋一看,就是Django的一个项目。

先轻车熟路的去修改一下 settings.py 这个文件

下面的内容可以算作可选项目。因为默认情况下,项目模板会使用Sqlite3 作为数据库,我们采用Mysql做为后端数据库,所以对 settings.py 做了很小的几个必须的改动

写道

26 DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
27 DATABASE_NAME = 'lidong_pinax' # Or path to database file if using sqlite3.
28 DATABASE_USER = 'lidong' # Not used with sqlite3.
29 DATABASE_PASSWORD = 'wo de mi ma' # Not used with sqlite3.
30 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
31 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.

完事后,要用一种你熟悉的方法在这台机器上创建一个数据库,并且授权用户 lidong 去访问这个数据库,这里我采用 Phpmyadmin这个工具来创建一个新数据库。


 

授权用户 lidong 可以访问这个数据库



 

下面执行创建表的工作

写道

(pinax-env)[lidong@queen ~/pinax-env/mysite]$ python manage.py syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table notification_noticetype
Creating table notification_noticesetting
Creating table notification_notice
Creating table notification_noticequeuebatch
Creating table notification_observeditem
Creating table emailconfirmation_emailaddress
Creating table emailconfirmation_emailconfirmation
Creating table robots_url
Creating table robots_rule
Creating table friends_contact
Creating table friends_friendship
Creating table friends_joininvitation
Creating table friends_friendshipinvitation
Creating table friends_friendshipinvitationhistory
Creating table mailer_message
Creating table mailer_dontsendentry
Creating table mailer_messagelog
Creating table messages_message
Creating table announcements_announcement
Creating table oembed_providerrule
Creating table oembed_storedoembed
Creating table threadedcomments_threadedcomment
Creating table threadedcomments_freethreadedcomment
Creating table threadedcomments_testmodel
Creating table wiki_article
Creating table wiki_changeset
Creating table swaps_offer
Creating table swaps_swap
Creating table votes
Creating table tagging_tag
Creating table tagging_taggeditem
Creating table bookmarks_bookmark
Creating table bookmarks_bookmarkinstance
Creating table blog_post
Creating table photologue_gallery
Creating table photologue_galleryupload
Creating table photologue_photo
Creating table photologue_photoeffect
Creating table photologue_watermark
Creating table photologue_photosize
Creating table avatar_avatar
Creating table flag_flaggedcontent
Creating table flag_flaginstance
Creating table microblogging_tweet
Creating table microblogging_tweetinstance
Creating table microblogging_following
Creating table locations_location
Creating table profiles_profile
Creating table account_account
Creating table account_otherserviceinfo
Creating table account_passwordreset
Creating table signup_codes_signupcode
Creating table signup_codes_signupcoderesult
Creating table tribes_tribe
Creating table photos_photoset
Creating table photos_image
Creating table photos_pool
Creating table topics_topic
Creating table django_admin_log
Creating table djangodblog_errorbatch
Creating table djangodblog_error
Creating table django_openid_nonce
Creating table django_openid_association
Creating table django_openid_useropenidassociation

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no):

输入yes 回车

写道

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'lidong'):
E-mail address: [email protected]
Password:
Password (again):
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for notification.NoticeSetting model
Installing index for notification.Notice model
Installing index for notification.ObservedItem model
Installing index for emailconfirmation.EmailAddress model
Installing index for emailconfirmation.EmailConfirmation model
Installing index for friends.Contact model
Installing index for friends.Friendship model
Installing index for friends.JoinInvitation model
Installing index for friends.FriendshipInvitation model
Installing index for friends.FriendshipInvitationHistory model
Installing index for messages.Message model
Installing index for announcements.Announcement model
Installing index for threadedcomments.ThreadedComment model
Installing index for threadedcomments.FreeThreadedComment model
Installing index for wiki.Article model
Installing index for wiki.ChangeSet model
Installing index for swaps.Offer model
Installing index for swaps.Swap model
Installing index for voting.Vote model
Installing index for tagging.TaggedItem model
Installing index for bookmarks.Bookmark model
Installing index for bookmarks.BookmarkInstance model
Installing index for blog.Post model
Installing index for photologue.GalleryUpload model
Installing index for photologue.Photo model
Installing index for photologue.PhotoSize model
Installing index for avatar.Avatar model
Installing index for flag.FlaggedContent model
Installing index for flag.FlagInstance model
Installing index for microblogging.Tweet model
Installing index for microblogging.TweetInstance model
Installing index for microblogging.Following model
Installing index for locations.Location model
Installing index for account.OtherServiceInfo model
Installing index for account.PasswordReset model
Installing index for signup_codes.SignupCode model
Installing index for signup_codes.SignupCodeResult model
Installing index for tribes.Tribe model
Installing index for photos.Image model
Installing index for photos.Pool model
Installing index for topics.Topic model
Installing index for admin.LogEntry model
Installing index for djangodblog.ErrorBatch model
Installing index for djangodblog.Error model
Installing index for django_openid.UserOpenidAssociation model
Installing json fixture 'initial_data' from '/home/lidong/pinax-env/lib/python2.6/site-packages/oembed/fixtures'.
Installing json fixture 'initial_data' from '/home/lidong/pinax-env/lib/python2.6/site-packages/pinax/apps/photos/fixtures'.
Installed 18 object(s) from 2 fixture(s)

好家伙,一下自安装了 81 张表,别看上面写的安装了 18 个 Object(s) 。



 

启动 Pinax 项目

$ python manage.py runserver

上面那是一个标准的启动方法,但是对于我这种好吃懒做的人,打 3 个字母总比打 26个字母轻松,所以我写一个脚本用来启动 Pinax项目

我的 run 脚本如下

$ echo python manage.py runserver 192.168.0.8:8888 >run
$ chmod a+x run
$ ./run

Validating models...
0 errors found

Django version 1.0.4, using settings 'mysite.settings'
Development server is running at http://192.168.0.8:8888/
Quit the server with CONTROL-C.

好了,现在打开浏览器,在地址栏输入  http://192.168.0.8:8888/

如果您看到的界面和我看到的不同,不是您人品不好,是不同浏览器可能有一些差异,(微软人品不好:) 另外如果您喜欢我的浏览器超级简洁明快的界面,就给您的火狐浏览器安装一个

http://vimperator.org/|vimperator 插件吧,前提示您必须是一个VIM狂热分子,否则用的非常不顺手别怨我。



 

汉化

写道

既然要那过来用,没有中文界面还真不行。那就汉化一下吧。

http://www.himysql.com/python/pinax-071-chinese-simplified.html

$ wget http://www.himysql.com/wp-content/uploads/2009/11/django.mo
文件下载后置于pinax 项目目录下locale/zh_CN/LC_MESSAGES,重启pinax即可。

如果当前项目目录下面没有 locale 则创建一个目录结构 locale/zh_CN/LC_MESSAGES/


$cd locale/zh_CN/LC_MESSAGES
$wget http://www.himysql.com/wp-content/uploads/2009/11/django.mo
这样正好把 django.mo 放到恰当的位置。locale/zh_CN/LC_MESSAGES/django.mo

修改配置文件 settings.py 

写道

47 # If you set this to False, Django will make some optimizations so as not
48 # to load the internationalization machinery.
49 #USE_I18N = False
50 USE_I18N = True

226 LANGUAGES = (
227 ('en', u'English'),
228 ('zh-cn', u'简体中文'),
229 )


注释掉49行,
新增 50行。
新增 228行

汉化后效果



 

猜你喜欢

转载自xiaolin0199.iteye.com/blog/2019381
今日推荐