推荐使用ubuntu操作系统进行django,简单暴力方便。安装django$sudo apt-get install pip$sudo pip install Django==1,6,1首先需要创建一个项目$django-admin.py startproject FirstSitepython ...
分类:
其他好文 时间:
2014-11-24 18:48:56
阅读次数:
229
环境:linux如果你使用了Apache部署了Django项目,在上传文件时可能会出现“[Errno 13] Permission denied:某目录”的错误。这是因为apache没有权限在该目录下生成文件夹和文件。所以你需要做的只需要赋予Apache对该文件夹的权限就可以了。执行command:...
分类:
其他好文 时间:
2014-11-24 13:25:21
阅读次数:
836
1. 目录结构/mysite/setting.py部分配置:# Django settings for mysite project.import os.pathTEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_temp...
分类:
其他好文 时间:
2014-11-23 22:51:25
阅读次数:
309
1. 安装配置Apache2. 安装wsgi_mod模块3. 开放相应端口vim /etc/sysconfig/iptables# Firewall configuration written by system-config-firewall# Manual customization of th...
分类:
Web程序 时间:
2014-11-23 18:56:24
阅读次数:
168
视图代码:importjson
deftest(request):
pie_list=[[u‘北京‘,50],[u‘上海‘,20],[u‘广州‘,30]]
t_country=[u‘北京‘,u‘上海‘,u‘广州‘]
t_country_count=[50,20,30]
data_dic={‘pie_g‘:pie_list,‘t_country‘:t_country,‘t_county_count‘:t_country_count}
returnHttpResponse(j..
分类:
Web程序 时间:
2014-11-22 23:21:04
阅读次数:
700
Django配置MySQL的参数设置DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'djangodb', 'USER':'root', '...
分类:
数据库 时间:
2014-11-22 15:52:32
阅读次数:
201
1.问题描述1.1表结构1.2问题ref_list为id列表的字符串,需要从ref_list中找出包含指定id的数据(eg id=8)。如果实用models.objects.filter(ref_list__contains=id)无法实现精确查找models.objects.filter(ref_...
分类:
其他好文 时间:
2014-11-21 18:24:20
阅读次数:
728
在机器上安装了一个新版本的python2.7.8,系统中存在python2.4下载django1.7的压缩包,解压,进入。运行python2.7.8 setup.py install 提示没有安装setuptools。于是vim ez_setup.py ,在另外一台机器上在网上找到该文件,复制粘贴内...
分类:
其他好文 时间:
2014-11-21 18:11:25
阅读次数:
141
突然心血来潮,想写点东西,隐约记得51cto有个个性域名liufeily.blog.51cto.com,账号都已经忘记了,想了半天终于想到,于是便有了这篇文章,切入正题。写python也有差不多两年多的时间了吧,由于非科班出身,之前除了写写shell外,无任何编程经验,为了让python有所提高,几乎..
分类:
其他好文 时间:
2014-11-20 15:39:46
阅读次数:
380
Downloading/unpacking Django>=1.4.2,=1.4Downloading/unpacking django-openstack-auth>=1.1.7Downloading/unpacking django-pyscss>=1.0.3Downloading/unpack...
分类:
其他好文 时间:
2014-11-20 01:24:49
阅读次数:
501