[转]Django 开发环境中html页面加…
2012-11-05 17:43
579 查看
资料摘自:http://www.cnblogs.com/wang_yb/archive/2011/04/21/2024311.html
1.1 urls.py
?1 2 3 4 5 6 7 8 | urlpatterns = patterns('', # Example: # (r'^siteWithResources/', include('siteWithResources.foo.urls')), ( r '^js/(?P<path>.*)$' , 'django.views.static.serve' , { 'document_root' : 'D:/Vim/python/django/django-resources/js/' } ), ) |
1.2 views.py
?1 2 3 4 5 | from django.shortcuts import render_to_response def PageWithJquery( request ): return render_to_response( 'default.html' , { "mytitle" : "customize_title" }) |
1.3 default.html (引用javascript)
?1 | <script type= "text/javascript" src= "/js/jquery/jquery-1.4.4.min.js" ></script> |
相关文章推荐
- 使用Eclipse+PyDev+EclipseHtmlEditor搭建Django开发环境
- Android&nbsp;SDK&nbsp;2.2&nbsp;开发环境搭建
- Python & PyCharm & Django 搭建web开发环境
- Python & PyCharm & Django 搭建web开发环境
- [转] Android开发环境搭建全程演示…
- Android&nbsp;SDK&nbsp;2.2&nbsp;开发环境搭建
- html&nbsp;页面之间跳转和传值
- Python & PyCharm & Django 搭建web开发环境
- pycharm&django 搭建web开发环境
- Tribon Vitesse二次开发环境搭建
- django开发过程中,报错CSRF t…
- 使用Eclipse+PyDev+EclipseHtmlEditor搭建Django开发环境
- ios 开发环境 复制的另一台电脑
- 2013年初次接触PHP网站快速开发(2):php嵌入 对页面及浏览器实际效果的影响
- 解决Jsoup解析html页面空格( )解析为乱码(问号)
- 在ubuntu&nbsp;下搭建&nbsp;android开发环境
- 用Maven构建Java&nbsp;Web开发环境…
- 第2章第5节 Wanlix的开发环境
- Eclipse下ruby&nbsp;和&nbsp;RoR的开发环境配…