Python-Django-实例sadmin学习
2015-09-23 17:26
901 查看
第1章 实例sadmin
1.1 安装sadmin
版本:[root@mydb1 sadmin]# python -V
Python 2.6.6
pip install Django
import django
print(diango.get_version())
1.6.11
Bootstrap v3.2.0
下载代码:
http://git.oschina.net/liufeily/sadmin
git clone https://git.oschina.net/liufeily/sadmin.git[/code]
将项目解压在任意目录下,进入项目目录, 修改连接数据库配置信息[root@mydb1 sadmin]# vim website/settings.py if 'SERVER_SOFTWARE' in os.environ: from sae.const import ( MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB) else: MYSQL_HOST = 'localhost' MYSQL_PORT = '3306' MYSQL_USER = 'root' MYSQL_PASS = 'pass' MYSQL_DB = 'test'
同步,已经创建的数据库test[root@mydb1 sadmin]# python manage.py syncdb Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table django_content_type Creating table django_session Creating table UserManage_permissionlist Creating table UserManage_rolelist_permission Creating table UserManage_rolelist Creating table UserManage_user 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: admin Email: admin@123.com Password:pass Password (again):pass Superuser created successfully. Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s)
运行项目:[root@mydb1 sadmin]# python manage.py runserver 0.0.0.0:80 Validating models... 0 errors found September 23, 2015 - 16:59:03 Django version 1.6.11, using settings 'website.settings' Starting development server at http://0.0.0.0:80/ Quit the server with CONTROL-C.
浏览器访问:
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法