A web tip of Django
Project description
django-tctip
一个 Django 应用,用来在页面显示打赏弹框
step 1 安裝包
pip install django-tctip
step 2 配置中添加应用
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_tctip',
]
step 3 生成数据表
python manage.py makemigrations
python manage.py migrate
step 4 在需要展示的页面添加引入标签函数,并添加标签函数到html中
{% load tctip_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="origin">
<title>Title</title>
</head>
<body>
<div>django-tctip demo test !!!</div>
{% load_tctip %}
</body>
</html>
step 5 前往管理界面添加数据即可显示到前台
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-tctip-1.2.0.tar.gz
(22.5 kB
view hashes)