A web tip of Django
Project description
django-tctip
一个 Django 应用,用来在页面显示打赏弹框,效果可看我博客 https://tendcode.com/
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 在需要展示的页面添加引入标签函数{% load tctip_tags %},并添加标签函数{% load_tctip %}到html中,建议放在head标签末尾
{% 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>
{% load_tctip %}
</head>
<body>
<div>django-tctip demo test !!!</div>
</body>
</html>
step 5 前往管理界面添加数据即可显示到前台(参数都是可以通过后台配置的,参数的作用可以查看前台注释中描述,比较简单故不做说明)
说明:django-tctip 是将tctip项目封装成了django的应用,感谢原项目 https://github.com/greedying/tctip 作者和删减版 https://github.com/HaddyYang/tctip 作者
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.4.0.tar.gz
(22.8 kB
view hashes)
Built Distribution
Close
Hashes for django_tctip-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f50f501c6ad944d71c8e23058fe4262f66b30b601d754e89bdf684009dfc45a |
|
MD5 | 6792a0a4a9f8b7ce25edf9a6bb4aa596 |
|
BLAKE2b-256 | 6aef2afb7622969901754c257bad537880f504f713b22f7153e8b6afc422165b |