runler / django Goto Github PK
View Code? Open in Web Editor NEW练习Django
练习Django
1、新建项目 创建虚拟环境virtual venv 2、安装django模块 pip install django (自动安装 pytz sqlparse 模块) 使用mysql数据库,需要提前安装好 https://dev.mysql.com/downloads/windows 3、安装mPyMySQL数据库驱动 pip install pymysql ,导入模块后加上 pymysql.install_as_MySQLdb() 为发挥最大数据库操作性能 4、创建Django项目 django-admin startproject mybog 基本的server已经可以运行了, python manage.py runserver 5、创建app, python manage.py startapp blog 6、a.修改项目setting.py的全局配置,DATABASES 为mysql数据库,INSTALLED_APPS 增加新增的app名, LANGUAGE_CODE = 'zh_Hans' TIME_ZONE = 'Asia/Shanghai' DEBUG = True TEMPLATES = b.并在__init__.py中 import pymysql 、pymysql.install_as_MySQLdb() c.修改urls.py的路由 7、给app应用添加数据models模型类表 8、生成数据迁移脚本文件 python manage.py makemigrations 执行数据库迁移 生成数据表 python manage.py migrate 9、生成数据库超级用户及密码 python manage.py createsuperuser weihy2018 weihy2018 10、管理后台 admin.py 11、创建表单forms.py、视图views 前台调阅 12、定义模板 {% %} 提高效率 19、启动服务器 python manage.py runserver
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.