├── bt ├── __init__.py ├── wsgi.py ├── urls.py └── settings.py ├── .gitignore ├── requirements.txt ├── app ├── tests.py ├── apps.py ├── __init__.py ├── admin.py ├── forms.py ├── urls.py ├── models.py └── views.py ├── static ├── js │ ├── common-v2.js │ ├── m-detail.js │ ├── function-new.js │ ├── clipboard.min.js │ ├── webcam.min.js │ ├── layer.js │ └── webcam.js ├── img │ ├── demo01.png │ ├── demo02.png │ ├── logo.jpg │ └── logo.png └── css │ ├── layer.css │ └── style_v2.css ├── upload └── cover │ └── 2.jpg ├── templates ├── app │ ├── detail.html │ ├── demo.html │ ├── commit.html │ ├── index.html │ └── search.html └── base │ ├── form_messages.html │ ├── footer.html │ ├── form_errors.html │ └── base.html ├── manage.py ├── README.md ├── helpers.py └── 开发过程.md /bt/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | __pycache__ 3 | app/migrations 4 | bt/__pycache__/ 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | django==3.2.11 2 | pymysql==1.0.2 3 | django-ratelimit==1.0.1 -------------------------------------------------------------------------------- /app/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /static/js/common-v2.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#search').focus(); 4 | }); 5 | -------------------------------------------------------------------------------- /upload/cover/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geeeeeeeek/python_bt/HEAD/upload/cover/2.jpg -------------------------------------------------------------------------------- /static/img/demo01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geeeeeeeek/python_bt/HEAD/static/img/demo01.png -------------------------------------------------------------------------------- /static/img/demo02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geeeeeeeek/python_bt/HEAD/static/img/demo02.png -------------------------------------------------------------------------------- /static/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geeeeeeeek/python_bt/HEAD/static/img/logo.jpg -------------------------------------------------------------------------------- /static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geeeeeeeek/python_bt/HEAD/static/img/logo.png -------------------------------------------------------------------------------- /app/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AppConfig(AppConfig): 5 | name = 'app' 6 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- 1 | import pymysql 2 | pymysql.install_as_MySQLdb() 3 | 4 | print("===============install pymysql==============") -------------------------------------------------------------------------------- /templates/app/detail.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/base.html' %} 2 | {% load static %} 3 | 4 | {% block content %} 5 | {% endblock content %} 6 | -------------------------------------------------------------------------------- /app/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from app.models import Link 5 | 6 | admin.site.register(Link) 7 | -------------------------------------------------------------------------------- /templates/base/form_messages.html: -------------------------------------------------------------------------------- 1 | {% if messages %} 2 |
7 | {% endif %} -------------------------------------------------------------------------------- /app/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from app.models import Link 4 | 5 | 6 | class CommitForm(forms.ModelForm): 7 | class Meta: 8 | model = Link 9 | fields = ['url', 'title', 'cover', 'size', 'desc', 'contact'] 10 | -------------------------------------------------------------------------------- /templates/base/footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'app' 5 | urlpatterns = [ 6 | path('index', views.IndexView.as_view(), name='index'), 7 | path('search', views.SearchView.as_view(), name='search'), 8 | # path('detail/