跳转到主要内容

Django站点联系信息模型和管理员

项目描述

安装

$ pip install django-contact-message

settings.py

INSTALLED_APPS+=['django_contact_message']

migrate

$ python manage.py migrate

特性

  • Message 模型
  • 管理员

模型

模型 列/字段
Message django_contact_message id,user,email,subject,message,created_at

示例

from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic.base import View
from django_contact_message.models import Message

class View(LoginRequiredMixin, View):
    def post(self, request, *args, **kwargs):
        Message(
            user=request.user,
            subject=request.POST['subject'],
            email=request.POST['email'],
            message=request.POST['message'],
        ).save()

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

django_contact_message-0.0.0.tar.gz (2.4 kB 查看哈希)

上传时间

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面