一种应对快速变化的需求的一种软件开发能力。
Git
Trello
持续集成
The Web framework for perfectionists with deadlines.
Django makes it easier to build better Web apps more quickly and with less code.
Object-relational mapper
from django.db import models
from ckeditor.fields import RichTextField
class Pages(TimeStampedModel):
"""
Pages
"""
title = models.CharField(verbose_name='标题', max_length=100)
content = RichTextField(verbose_name='内容', config_name="default")
mark = models.CharField(verbose_name='唯一标志', unique=True, max_length=20)
class Meta:
verbose_name = "页面"
verbose_name_plural = " 页面"
def __unicode__(self):
return self.title
class TimeStampedModel(models.Model):
"""工具类
用来给你的model添加下面两个字段,分别是创建时间和更新时间
Usage: class YourModel(TimeStampedModel): ...
"""
created_date = models.DateTimeField(verbose_name='创建时间', auto_now_add=True)
updated_date = models.DateTimeField(verbose_name='更新时间', auto_now=True)
class Meta:
abstract = True
class DownloadAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'download_link', 'created_date')
list_filter = ('created_date',)
search_fields = ('name', 'description', )
form = forms.UploadFileForm
fieldsets = (
(None, {
'fields': ('document', 'description')
}),
('Advanced options', {
'classes': ('collapse',),
'fields': ('name',)
}),
)
def download_link(self, obj):
link = "<strong><a href={0}>下载</a></strong>".format(reverse('file',
kwargs=dict(file_id=obj.id)))
return mark_safe(link)
download_link.short_description = "下载链接"
def delete_model(self, request, obj):
storage, path = obj.document.storage, obj.document.path
super(DownloadAdmin, self).delete_model(request, obj)
storage.delete(path)
admin.site.register(models.Download, DownloadAdmin)
Django has the concept of “views” to encapsulate the logic responsible for processing a user’s request and for returning the response
class RegisterMeeting(generic.CreateView):
"""
注册会议
"""
model = models.Members
template_name = "register.html"
success_url = '/'
def get_success_url(self):
messages.success(self.request, "注册成功!")
return reverse_lazy("index")
简洁、直观、强悍、移动设备优先的前端开发框架,让web开发更迅速、简单。