Python-Django-实例sadmin学习
发布日期:2021-08-26 18:18:43 浏览次数:60 分类:技术文章

本文共 1578 字,大约阅读时间需要 5 分钟。

hot3.png

第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

下载代码: git clone https://git.oschina.net/liufeily/sadmin.git


将项目解压在任意目录下,进入项目目录, 修改连接数据库配置信息

[root@mydb1 sadmin]# vim website/settings.pyif '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 syncdbCreating tables ...Creating table auth_permissionCreating table auth_group_permissionsCreating table auth_groupCreating table django_content_typeCreating table django_sessionCreating table UserManage_permissionlistCreating table UserManage_rolelist_permissionCreating table UserManage_rolelistCreating table UserManage_userYou just installed Django's auth system, which means you don't have any superusers defined.Would you like to create one now? (yes/no): yesUsername: adminEmail: admin@123.comPassword:passPassword (again):passSuperuser 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:80Validating models...0 errors foundSeptember 23, 2015 - 16:59:03Django version 1.6.11, using settings 'website.settings'Starting development server at http://0.0.0.0:80/Quit the server with CONTROL-C.

浏览器访问:


转载于:https://my.oschina.net/wangbinbin0326/blog/510304

转载地址:https://blog.csdn.net/weixin_33894640/article/details/92711115 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:cookie 和session 的区别详解
下一篇:ActiveReports 报表应用教程 (13)---嵌入第三方控件

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月06日 15时50分03秒