# django-tctip
一个 Django 应用,用来在页面显示打赏弹框,效果可看我博客 https://tendcode.com/
step 1
安裝包
```bash
pip install django-tctip
```
step 2
配置中添加应用
```python
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_tctip',
]
```
step 3
生成数据表
```bash
python manage.py makemigrations
python manage.py migrate
```
step 4
在需要展示的页面添加引入标签函数{% load tctip_tags %},并添加标签函数{% load_tctip %}到html中,建议放在head标签末尾
```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>
{% load_tctip %}
</head>
<body>
<div>django-tctip demo test !!!</div>
</body>
</html>
```
step 5
前往管理界面添加数据即可显示到前台(参数都是可以通过后台配置的,参数的作用可以查看前台注释中描述,比较简单故不做说明)
![](https://ftp.bmp.ovh/imgs/2020/07/471c08dcb08d47c0.png)
![](https://ftp.bmp.ovh/imgs/2020/07/cc4742af979cac9c.png)
![](https://ftp.bmp.ovh/imgs/2020/07/505d3218487e1114.png)
说明:django-tctip 是将tctip项目封装成了django的应用,感谢原项目 https://github.com/greedying/tctip 作者和删减版 https://github.com/HaddyYang/tctip 作者
Raw data
{
"_id": null,
"home_page": "https://github.com/Hopetree/django-tctip",
"name": "django-tctip",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "django tctip tip",
"author": "Hopetree",
"author_email": "zlwork2014@163.com",
"download_url": "https://files.pythonhosted.org/packages/c0/ab/61ebf2d96ef408f2f6d9ca0e277991e3f3bfbf426d86d9695235535b3e52/django-tctip-1.4.7.tar.gz",
"platform": null,
"description": "# django-tctip\n\u4e00\u4e2a Django \u5e94\u7528\uff0c\u7528\u6765\u5728\u9875\u9762\u663e\u793a\u6253\u8d4f\u5f39\u6846\uff0c\u6548\u679c\u53ef\u770b\u6211\u535a\u5ba2 https://tendcode.com/\n\nstep 1\n\u5b89\u88dd\u5305\n```bash\npip install django-tctip\n```\n\nstep 2\n\u914d\u7f6e\u4e2d\u6dfb\u52a0\u5e94\u7528\n```python\nINSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'django_tctip',\n]\n```\n\nstep 3\n\u751f\u6210\u6570\u636e\u8868\n```bash\npython manage.py makemigrations\npython manage.py migrate\n```\n\nstep 4\n\u5728\u9700\u8981\u5c55\u793a\u7684\u9875\u9762\u6dfb\u52a0\u5f15\u5165\u6807\u7b7e\u51fd\u6570{% load tctip_tags %}\uff0c\u5e76\u6dfb\u52a0\u6807\u7b7e\u51fd\u6570{% load_tctip %}\u5230html\u4e2d\uff0c\u5efa\u8bae\u653e\u5728head\u6807\u7b7e\u672b\u5c3e\n```html\n{% load tctip_tags %}\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <!-- Required meta tags -->\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n <meta name=\"referrer\" content=\"origin\">\n <title>Title</title>\n {% load_tctip %}\n</head>\n<body>\n<div>django-tctip demo test !!!</div>\n</body>\n</html>\n\n```\n\nstep 5\n\u524d\u5f80\u7ba1\u7406\u754c\u9762\u6dfb\u52a0\u6570\u636e\u5373\u53ef\u663e\u793a\u5230\u524d\u53f0\uff08\u53c2\u6570\u90fd\u662f\u53ef\u4ee5\u901a\u8fc7\u540e\u53f0\u914d\u7f6e\u7684\uff0c\u53c2\u6570\u7684\u4f5c\u7528\u53ef\u4ee5\u67e5\u770b\u524d\u53f0\u6ce8\u91ca\u4e2d\u63cf\u8ff0\uff0c\u6bd4\u8f83\u7b80\u5355\u6545\u4e0d\u505a\u8bf4\u660e\uff09\n\n![](https://ftp.bmp.ovh/imgs/2020/07/471c08dcb08d47c0.png)\n\n![](https://ftp.bmp.ovh/imgs/2020/07/cc4742af979cac9c.png)\n![](https://ftp.bmp.ovh/imgs/2020/07/505d3218487e1114.png)\n\n\u8bf4\u660e\uff1adjango-tctip \u662f\u5c06tctip\u9879\u76ee\u5c01\u88c5\u6210\u4e86django\u7684\u5e94\u7528\uff0c\u611f\u8c22\u539f\u9879\u76ee https://github.com/greedying/tctip \u4f5c\u8005\u548c\u5220\u51cf\u7248 https://github.com/HaddyYang/tctip \u4f5c\u8005\n",
"bugtrack_url": null,
"license": "",
"summary": "A web tip of Django",
"version": "1.4.7",
"project_urls": {
"Homepage": "https://github.com/Hopetree/django-tctip"
},
"split_keywords": [
"django",
"tctip",
"tip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1182f5a4a3bc72b35ca8274f8fd8a201dfb4608cafa3130c168e2956aaf6da4",
"md5": "7040fc834b3184a53652cc8a900ad3b1",
"sha256": "06782fdb40764d9cd39a8df3f54141608729af969fc9de6424c777c3a46e25db"
},
"downloads": -1,
"filename": "django_tctip-1.4.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7040fc834b3184a53652cc8a900ad3b1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 33109,
"upload_time": "2024-02-03T01:30:42",
"upload_time_iso_8601": "2024-02-03T01:30:42.374631Z",
"url": "https://files.pythonhosted.org/packages/d1/18/2f5a4a3bc72b35ca8274f8fd8a201dfb4608cafa3130c168e2956aaf6da4/django_tctip-1.4.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c0ab61ebf2d96ef408f2f6d9ca0e277991e3f3bfbf426d86d9695235535b3e52",
"md5": "f42b49044a7b42f73191a5ab0ee37219",
"sha256": "90996d9ac8514a8909ea20f09382b5f7d5f670fab184d9dc79b4d51d07c6aa12"
},
"downloads": -1,
"filename": "django-tctip-1.4.7.tar.gz",
"has_sig": false,
"md5_digest": "f42b49044a7b42f73191a5ab0ee37219",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 24733,
"upload_time": "2024-02-03T01:30:44",
"upload_time_iso_8601": "2024-02-03T01:30:44.415732Z",
"url": "https://files.pythonhosted.org/packages/c0/ab/61ebf2d96ef408f2f6d9ca0e277991e3f3bfbf426d86d9695235535b3e52/django-tctip-1.4.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-03 01:30:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Hopetree",
"github_project": "django-tctip",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "django-tctip"
}