码迷,mamicode.com
首页 >  
搜索关键字:django xadmin    ( 16921个结果
捕捉攻击者
pip install django-admin-honeypotAdd admin_honeypot to INSTALLED_APPSurl(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),url(r...
分类:其他好文   时间:2015-01-08 17:21:38    阅读次数:137
CentOS下nginx+python+fastcgi+postgres部署总结(django版)
最近因为项目上的需要开始大量使用nginx,因此也想趁机将以前常用的django+apache的架构换成django+nginx。常见的 django webapp 部署方式采用FCGI 或 WSGI的方式部署,在这里主要对CentOS 6.5下采用 Nginx + fastcgi + Python...
分类:编程语言   时间:2015-01-08 15:09:19    阅读次数:432
django user模块改写
示例一:继承AbstractBaseUser,AbstractBaseUser只有三个字段password,last_login,is_active,以及需要复习的两个方法def get_full_name(self): raise NotImplementedError()def g...
分类:其他好文   时间:2015-01-08 15:03:53    阅读次数:233
select_related
作用:减少DB访问次数from django.db import modelsclass Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() def __s...
分类:其他好文   时间:2015-01-07 23:33:39    阅读次数:166
nginx+uwsgi部署django项目
操作可参考http://www.linuxyw.com/353.html(nginx+uwsgi+django+python环境部署文档)这里只说明几点我的配置环境:Nginx版本:1.7.9Django版本:1.6.8Python版本:2.7.5Uwsgi版本:2.0.9安装MySQL-python:最好源码安装,yuminstall-yMySQL-python可能因为路径问题importMySQLd..
分类:其他好文   时间:2015-01-07 19:08:01    阅读次数:364
django error
错误信息:You‘reusingtheDjango"sitesframework"withouthavingsettheSITE_IDsetting.CreateasiteinyourdatabaseandsettheSITE_IDsettingtofixthiserror.原因:settings.py里#Applicationdefinition中添加了‘django.contrib.sites‘模块后需要设置SITE_ID处理:在settings.py里..
分类:其他好文   时间:2015-01-07 19:06:53    阅读次数:180
Django POST常见的错误:CSRF verification failed. Request aborted.
直接用代码说明吧。 在Post模板页面加入{%csrf_token%} {{result}} {% csrf_token %} name: password: 把和POST页面相关的所有view的context强制换成RequestContext ...
分类:其他好文   时间:2015-01-07 16:56:06    阅读次数:165
django cbv
django 提供了一系列现成的类视图,他们都继承自一个 View 基类(django.views.generic.base.View)。在这个基类里实现了与 URLs 的接口(as_view)、请求方法匹配(dispatch)和一些其他的基本功能。比如 RedirectView 实现了一个简单的 ...
分类:其他好文   时间:2015-01-06 17:03:31    阅读次数:190
django快速搭建一个sample blog(1)
练手之作,前端不太熟,只能瞎胡搞~Django的设计鼓励松耦合及对应用程序中不同部分的严格分割。遵循这个理念的话,要想修改应用的某部分而不影响其它部分就比较容易了。把数据存取逻辑、业务逻辑和表现逻辑组合在一起的概念有时被称为软件架构的Model-View-Controller(MVC)模式..
分类:其他好文   时间:2015-01-06 15:48:37    阅读次数:166
django 项目部署在 Apache 后, 设置二级域名
上一篇文章简单说了怎么把django的项目部署到Apache上。现在想弄个二级域名,也就是我原来有个域名 www.mysite.com,现在我想弄个 bbs.mysite.com ,该怎么做呢。要用到 Apache 的虚拟主机配置。其实Apache的虚拟主机之前也配置过,有时有效,有时又不好用,也不...
分类:Web程序   时间:2015-01-05 20:24:00    阅读次数:2048
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!