tango with django chapter 4 Django Basics
来源:互联网 发布:php form表单提交 编辑:程序博客网 时间:2024/06/05 09:54
Creating a Project
django-admin.py startproject tango_with_django_project.├── manage.py└── tango_with_django_project # ├── __init__.py # 表明是一个python包 ├── settings.py # django 项目的配置文件 ├── urls.py # 存放项目的url模式的地方 └── wsgi.py # 一个用来帮助运行开发服务器并且勇于部署到生产环境的python脚本
work flow
creating a django project
python django-admin.py startproject project_name
creating a application
python manage.py startapp app_name
config install_apps in project_name/project_name/settings.py
config urls.py in project_name/project_name/urls.py
url(r'^rango/', include('rango.urls')),
config urls.py in app_name/urls.py
urlpatterns = patterns( '', url(r'^$', views.index, name='index'), url(r'^about/', views.about, name='about'),)
creating views in app_name/views.py
def index(request): return HttpResponse( 'Rango started!~~~' + '<br /><a href="/rango/about">About Rango</a>' )def about(request): return HttpResponse( 'This is about page of Rango~~~' + '<br /><a href="/rango/">Rango</a>' )
Django dispatcher
0 0
- tango with django chapter 4 Django Basics
- tango with django ch12
- 基于How To Tango With Django 1.7的实践(3)——Django Basics
- tango with django ch6 Model
- tango with django ch7 MTV
- 学习Tango with django(1)
- 学习Tango with django(2)
- 学习Tango with django(3)
- tango with django ch5 template&static file
- 基于How To Tango With Django 1.9的重新实践(11)——User Authentication with {#chapter-redux}
- Django(1)Tango with Django过程中的问题
- django网站设计与规划【Tango with Django】
- 基于How To Tango With Django 1.7的实践(4)——Templates and Static Media
- 基于How To Tango With Django 1.7的实践(1)
- 基于How To Tango With Django 1.7的实践(2)
- 基于How To Tango With Django 1.7的实践(5)——Models and Databases
- 基于How To Tango With Django 1.9的重新实践(0-5)
- 基于How To Tango With Django 1.9的重新实践(7)——Forms
- Linux 防火墙开放特定端口 (iptables)
- 进程与线程的区别
- CodeForces 628B(数论)
- HTML基础语法(3)
- TCP/IP、Http、Socket的区别
- tango with django chapter 4 Django Basics
- 1006. Sign In and Sign Out (25)
- 网络请求
- Mysql性能优化一
- js获取model的值
- oracle IMP-00024: 只能指定一种模式 (TABLES, FROMUSER 或 FULL)
- React-native 环境搭建
- C++0X(C++11)的std:mutex、std::thread与Windows API性能对比
- ASP.NET-使用Alert事件导致页面错位的解决方法