atyu30

atyu30的博客

他的个人主页  他的博客

RHEL 6.1 Django-CMS 2.1.3 安装指南

atyu30  2011年08月22日 星期一 18:59 | 5239次浏览 | 0条评论

RHEL 6.1 Django-CMS 2.1.3 安装指南

环境准备

[root@gfs03 ~]# yum install python-setuptools python-imaging
[root@gfs03 ~]# easy_install pip
[root@gfs03 ~]# yum install mysql-server  MySQL-python

安装 django-cms

[root@gfs03 ~]#  yum install mysql-server
[root@gfs03 ~]# pip install django-cms south django-appmedia
Downloading/unpacking django-cms
  Downloading django-cms-2.1.3.tar.gz (3.1Mb): 3.1Mb downloaded
  Running setup.py egg_info for package django-cms
Downloading/unpacking south
  Downloading South-0.7.3.tar.gz (70Kb): 70Kb downloaded
  Running setup.py egg_info for package south
Downloading/unpacking django-appmedia
  Downloading django-appmedia-1.0.1.tar.gz
  Running setup.py egg_info for package django-appmedia
Downloading/unpacking Django>=1.2 (from django-cms)
  Downloading Django-1.3.tar.gz (6.5Mb): 6.5Mb downloaded
  Running setup.py egg_info for package Django
Downloading/unpacking django-classy-tags>=0.2.2 (from django-cms)
  Downloading django-classy-tags-0.3.4.1.tar.gz
  Running setup.py egg_info for package django-classy-tags
Installing collected packages: django-cms, south, django-appmedia, Django, django-classy-tags
  Running setup.py install for django-cms
  Running setup.py install for south
  Running setup.py install for django-appmedia
  Running setup.py install for Django
    changing mode of build/scripts-2.6/django-admin.py from 644 to 755
    changing mode of /usr/bin/django-admin.py to 755
  Running setup.py install for django-classy-tags
Successfully installed django-cms south django-appmedia Django django-classy-tags
Cleaning up...
[root@gfs03 ~]# 

配置 django-cms


环境配置

[root@gfs03 ~]# cd /opt/
[root@gfs03 opt]# mkdir workspace
[root@gfs03 opt]# cd workspace/
[root@gfs03 workspace]# django-admin.py startproject myproject
[root@gfs03 workspace]# cd myproject/
[root@gfs03 myproject]# ls
__init__.py  manage.py  settings.py  urls.py
[root@gfs03 myproject]# rm -rf settings.py urls.py 
[root@gfs03 myproject]# wget https://gist.github.com/raw/776313/settings.py .
--2011-08-22 16:11:22--  https://gist.github.com/raw/776313/settings.py
正在解析主机 gist.github.com... 207.97.227.243
正在连接 gist.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://raw.github.com/gist/776313/settings.py [跟随至新的 URL]
--2011-08-22 16:11:25--  https://raw.github.com/gist/776313/settings.py
正在解析主机 raw.github.com... 207.97.227.243
正在连接 raw.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:3527 (3.4K) [text/plain]
正在保存至: “settings.py”

100%[=============================================================================================================================>] 3,527       --.-K/s   in 0s      

2011-08-22 16:11:43 (1.66 GB/s) - 已保存 “settings.py” [3527/3527])

--2011-08-22 16:11:43--  http://./
正在解析主机 .... 失败:没有与主机名关联的地址。
wget: 无法解析主机地址 “.”
下载完毕 --2011-08-22 16:11:43--
下载了:1 个文件,0s (1.66 GB/s) 中的 3.4K
[root@gfs03 myproject]# wget https://gist.github.com/raw/776313/urls.py .
--2011-08-22 16:11:48--  https://gist.github.com/raw/776313/urls.py
正在解析主机 gist.github.com... 207.97.227.243
正在连接 gist.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://raw.github.com/gist/776313/urls.py [跟随至新的 URL]
--2011-08-22 16:11:50--  https://raw.github.com/gist/776313/urls.py
正在解析主机 raw.github.com... 207.97.227.243
正在连接 raw.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:386 [text/plain]
正在保存至: “urls.py”

100%[=============================================================================================================================>] 386         --.-K/s   in 0s      

2011-08-22 16:11:51 (104 MB/s) - 已保存 “urls.py” [386/386])

--2011-08-22 16:11:51--  http://./
正在解析主机 .... 失败:没有与主机名关联的地址。
wget: 无法解析主机地址 “.”
下载完毕 --2011-08-22 16:11:51--
下载了:1 个文件,0s (104 MB/s) 中的 386
[root@gfs03 myproject]# mkdir templates
[root@gfs03 myproject]# cd templates/
[root@gfs03 templates]# wget https://gist.github.com/raw/776313/example.html .
--2011-08-22 16:12:16--  https://gist.github.com/raw/776313/example.html
正在解析主机 gist.github.com... 207.97.227.243
正在连接 gist.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://raw.github.com/gist/776313/example.html [跟随至新的 URL]
--2011-08-22 16:12:23--  https://raw.github.com/gist/776313/example.html
正在解析主机 raw.github.com... 207.97.227.243
正在连接 raw.github.com|207.97.227.243|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:179 [text/plain]
正在保存至: “example.html”

100%[=============================================================================================================================>] 179         --.-K/s   in 0s      

2011-08-22 16:12:25 (10.1 MB/s) - 已保存 “example.html” [179/179])

--2011-08-22 16:12:25--  http://./
正在解析主机 .... 失败:没有与主机名关联的地址。
wget: 无法解析主机地址 “.”
下载完毕 --2011-08-22 16:12:25--
下载了:1 个文件,0s (10.1 MB/s) 中的 179
[root@gfs03 templates]# cd ..
[root@gfs03 myproject]# 


启动 django-cms

[root@gfs03 myproject]# python manage.py syncdb --all
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table cms_placeholder
Creating table cms_cmsplugin
Creating table cms_page_placeholders
Creating table cms_page
Creating table cms_pagemoderator
Creating table cms_pagemoderatorstate
Creating table cms_globalpagepermission_sites
Creating table cms_globalpagepermission
Creating table cms_pagepermission
Creating table cms_pageuser
Creating table cms_pageusergroup
Creating table cms_title
Creating table menus_cachekey
Creating table south_migrationhistory
Creating table cmsplugin_text
Creating table cmsplugin_picture
Creating table cmsplugin_link
Creating table cmsplugin_file
Creating table snippet_snippet
Creating table cmsplugin_snippetptr
Creating table cmsplugin_googlemap

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 'root'): root
E-mail address: atyu30@tvmining.com
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.admin
 > cms
 > menus
 > mptt
 > appmedia
 > south
 > cms.plugins.text
 > cms.plugins.picture
 > cms.plugins.link
 > cms.plugins.file
 > cms.plugins.snippet
 > cms.plugins.googlemap

Not synced (use migrations):
 - 
(use ./manage.py migrate to migrate these)
[root@gfs03 myproject]# python manage.py migrate --fake
Running migrations for cms:
 - Migrating forwards to 0033_auto__del_field_title_publisher_is_draft__del_field_title_publisher_st.
 > cms:0001_initial
   (faked)
 > picture:0001_initial
   (faked)
 > picture:0002_link_rename
   (faked)
 > picture:0003_freeze
   (faked)
 > cms:0002_auto_start
   (faked)
 > cms:0003_remove_placeholder
   (faked)
 > cms:0004_textobjects
   (faked)
 > cms:0005_mptt_added_to_plugins
   (faked)
 > cms:0006_apphook
   (faked)
 > cms:0007_apphook_longer
   (faked)
 > cms:0008_redirects
   (faked)
 > cms:0009_added_meta_fields
   (faked)
 > cms:0010_5char_language
   (faked)
 > cms:0011_title_overwrites
   (faked)
 > cms:0012_publisher
   (faked)
 > picture:0004_publisher
   (faked)
 > picture:0005_table_rename
   (faked)
 > text:0001_initial
   (faked)
 > text:0002_freeze
   (faked)
 > text:0003_publisher
   (faked)
 > snippet:0001_initial
   (faked)
 > snippet:0002_publisher
   (faked)
 > link:0001_initial
   (faked)
 > link:0002_link_rename
   (faked)
 > link:0003_page_link
   (faked)
 > link:0004_larger_link_names
   (faked)
 > link:0005_publisher
   (faked)
 > googlemap:0001_initial
   (faked)
 > file:0001_initial
   (faked)
 > file:0002_freeze
   (faked)
 > file:0003_publisher
   (faked)
 > cms:0013_site_copy
   (faked)
 > cms:0014_sites_removed
   (faked)
 > cms:0015_modified_by_added
   (faked)
 > cms:0016_author_copy
   (faked)
 > cms:0017_author_removed
   (faked)
 > cms:0018_site_permissions
   (faked)
 > cms:0019_public_table_renames
   (faked)
 > picture:0006_float_added
   (faked)
 > cms:0020_advanced_permissions
   (faked)
 > cms:0021_publisher2
   (faked)
 > cms:0022_login_required_added
   (faked)
 > cms:0023_plugin_table_naming_function_changed
   (faked)
 > cms:0024_added_placeholder_model
   (faked)
 > cms:0025_placeholder_migration
   (faked)
 > cms:0026_finish_placeholder_migration
   (faked)
 > cms:0027_added_width_to_placeholder
   (faked)
 > cms:0028_limit_visibility_in_menu_step1of3
   (faked)
 > cms:0029_limit_visibility_in_menu_step2of3_data
   (faked)
 > cms:0030_limit_visibility_in_menu_step3of3
   (faked)
 > cms:0031_improved_language_code_support
   (faked)
 > cms:0032_auto__del_field_cmsplugin_publisher_public__del_field_cmsplugin_publis
   (faked)
 > cms:0033_auto__del_field_title_publisher_is_draft__del_field_title_publisher_st
   (faked)
Running migrations for menus:
 - Migrating forwards to 0001_initial.
 > menus:0001_initial
   (faked)
Running migrations for text:
 - Migrating forwards to 0005_publisher2.
 > text:0004_table_rename
   (faked)
 > text:0005_publisher2
   (faked)
Running migrations for picture:
 - Migrating forwards to 0008_longdesc_added.
 > picture:0007_publisher2
   (faked)
 > picture:0008_longdesc_added
   (faked)
Running migrations for link:
 - Migrating forwards to 0008_mailto.
 > link:0006_table_rename
   (faked)
 > link:0007_publisher2
   (faked)
 > link:0008_mailto
   (faked)
Running migrations for file:
 - Migrating forwards to 0005_publisher2.
 > file:0004_table_rename
   (faked)
 > file:0005_publisher2
   (faked)
Running migrations for snippet:
 - Migrating forwards to 0005_template_added.
 > snippet:0003_table_rename
   (faked)
 > snippet:0004_publisher2
   (faked)
 > snippet:0005_template_added
   (faked)
Running migrations for googlemap:
 - Migrating forwards to 0009_routeplaner_title.
 > googlemap:0002_table_rename
   (faked)
 > googlemap:0003_address_unified
   (faked)
 > googlemap:0004_copy_address
   (faked)
 > googlemap:0005_delete_street
   (faked)
 > googlemap:0006_publisher2
   (faked)
 > googlemap:0007_latlng
   (faked)
 > googlemap:0008_routeplaner
   (faked)
 > googlemap:0009_routeplaner_title
   (faked)
[root@gfs03 myproject]# 
[root@gfs03 myproject]# python manage.py runserver
Validating models...

0 errors found
Django version 1.3, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

测试


安装 apache

[root@gfs03 conf.d]# yum install mod_python

[root@gfs03 conf.d]# ls
mod_dnssd.conf  python.conf  README  welcome.conf

中文界面

Configuration File: settings.py

#LANGUAGES = [('en', 'en'),('zh-cn',gettext('Chinese'))]
#DEFAULT_LANGUAGE = 0
LANGUAGES = [('en', 'en'),('zh-cn',gettext('Chinese'))]
DEFAULT_LANGUAGE = 1

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(PROJECT_DIR, 'mycms.db'),
    }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Asia/Shanghai'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'zh-cn'
#LANGUAGE_CODE = 'en-us'

评论

我的评论:

发表评论

请 登录 后发表评论。还没有在Zeuux哲思注册吗?现在 注册 !

暂时没有评论

Zeuux © 2024

京ICP备05028076号