├── black ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_img.py │ ├── 0003_auto_20190518_0844.py │ └── 0001_initial.py ├── tests.py ├── apps.py ├── admin.py ├── urls.py ├── models.py └── views.py ├── other ├── __init__.py ├── migrations │ └── __init__.py ├── models.py ├── tests.py ├── admin.py ├── apps.py ├── urls.py └── views.py ├── user ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_auto_20190401_1534.py │ ├── 0004_auto_20190518_0844.py │ ├── 0001_initial.py │ └── 0003_auto_20190415_2217.py ├── tests.py ├── apps.py ├── admin.py ├── urls.py ├── models.py └── views.py ├── Blacklearn ├── __init__.py ├── wsgi.py ├── urls.py └── settings.py ├── static ├── img │ ├── jy.png │ ├── sqzy.png │ ├── enjoy.jpg │ ├── github.jpeg │ ├── paylogo.jpg │ └── zydemo.jpg ├── images │ ├── down.png │ ├── icon.png │ ├── logo.jpg │ ├── py.png │ ├── sqzy.png │ ├── Thumbs.db │ ├── bcoin.jpg │ ├── block.jpg │ ├── icons.png │ ├── slide.jpg │ ├── weixin.jpg │ ├── backtop.png │ ├── browser.jpg │ ├── icon │ │ ├── icon.png │ │ ├── icon.psd │ │ ├── Thumbs.db │ │ ├── favicon.ico │ │ ├── icon_500x500.png │ │ └── icon_border_0.jpg │ ├── icons02.png │ ├── javaweb.jpg │ ├── left_bg.jpg │ ├── news-icon.png │ ├── pay_icons.png │ ├── shop_cart.png │ ├── weixin2.jpg │ ├── interval_line.png │ ├── login_banner.jpg │ ├── login_banner1.png │ ├── register_banner.png │ └── 360截图20190401171337531.jpg ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── css │ ├── reset2.css │ ├── reset.css │ ├── nprogress.css │ ├── public.css │ └── extend.css └── js │ ├── html5shiv.min.js │ ├── register.js │ ├── slide.js │ ├── jquery.lazyload.min.js │ ├── jquery.cookie.js │ ├── respond.min.js │ ├── selectivizr-min.js │ ├── easyform.js │ └── nprogress.js ├── README.md ├── manage.py ├── requirements.txt ├── 库文件.txt ├── .gitignore ├── templates ├── blackmain │ ├── vip.html │ ├── getcoin.html │ ├── index.html │ ├── bw.html │ ├── bcym.html │ ├── enjoy.html │ ├── answer.html │ └── goodclass.html ├── users │ ├── login.html │ ├── register.html │ ├── payvip.html │ ├── user_info.html │ └── user_center_info.html └── other │ ├── payvip.html │ ├── seacher.html │ └── contentzy.html └── models.py /black/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /other/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /user/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Blacklearn/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /black/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /other/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /other/models.py: -------------------------------------------------------------------------------- 1 | #wwe 2 | -------------------------------------------------------------------------------- /user/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /black/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /other/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /user/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /other/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | 4 | # Register your models here. 5 | -------------------------------------------------------------------------------- /static/img/jy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/jy.png -------------------------------------------------------------------------------- /static/img/sqzy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/sqzy.png -------------------------------------------------------------------------------- /static/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/down.png -------------------------------------------------------------------------------- /static/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon.png -------------------------------------------------------------------------------- /static/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/logo.jpg -------------------------------------------------------------------------------- /static/images/py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/py.png -------------------------------------------------------------------------------- /static/images/sqzy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/sqzy.png -------------------------------------------------------------------------------- /static/img/enjoy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/enjoy.jpg -------------------------------------------------------------------------------- /static/img/github.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/github.jpeg -------------------------------------------------------------------------------- /static/img/paylogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/paylogo.jpg -------------------------------------------------------------------------------- /static/img/zydemo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/img/zydemo.jpg -------------------------------------------------------------------------------- /static/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/Thumbs.db -------------------------------------------------------------------------------- /static/images/bcoin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/bcoin.jpg -------------------------------------------------------------------------------- /static/images/block.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/block.jpg -------------------------------------------------------------------------------- /static/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icons.png -------------------------------------------------------------------------------- /static/images/slide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/slide.jpg -------------------------------------------------------------------------------- /static/images/weixin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/weixin.jpg -------------------------------------------------------------------------------- /black/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlackConfig(AppConfig): 5 | name = 'black' 6 | -------------------------------------------------------------------------------- /other/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OtherConfig(AppConfig): 5 | name = 'other' 6 | -------------------------------------------------------------------------------- /static/images/backtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/backtop.png -------------------------------------------------------------------------------- /static/images/browser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/browser.jpg -------------------------------------------------------------------------------- /static/images/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/icon.png -------------------------------------------------------------------------------- /static/images/icon/icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/icon.psd -------------------------------------------------------------------------------- /static/images/icons02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icons02.png -------------------------------------------------------------------------------- /static/images/javaweb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/javaweb.jpg -------------------------------------------------------------------------------- /static/images/left_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/left_bg.jpg -------------------------------------------------------------------------------- /static/images/news-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/news-icon.png -------------------------------------------------------------------------------- /static/images/pay_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/pay_icons.png -------------------------------------------------------------------------------- /static/images/shop_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/shop_cart.png -------------------------------------------------------------------------------- /static/images/weixin2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/weixin2.jpg -------------------------------------------------------------------------------- /user/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserConfig(AppConfig): 5 | name = 'user' 6 | -------------------------------------------------------------------------------- /static/images/icon/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/Thumbs.db -------------------------------------------------------------------------------- /static/images/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/favicon.ico -------------------------------------------------------------------------------- /static/images/interval_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/interval_line.png -------------------------------------------------------------------------------- /static/images/login_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/login_banner.jpg -------------------------------------------------------------------------------- /static/images/login_banner1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/login_banner1.png -------------------------------------------------------------------------------- /static/images/register_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/register_banner.png -------------------------------------------------------------------------------- /static/images/icon/icon_500x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/icon_500x500.png -------------------------------------------------------------------------------- /static/images/icon/icon_border_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/icon/icon_border_0.jpg -------------------------------------------------------------------------------- /static/images/360截图20190401171337531.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/images/360截图20190401171337531.jpg -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WEIYANLIN1996/python-django-/HEAD/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /user/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from user.models import Users 4 | 5 | 6 | # Register your models here. 7 | admin.site.register(Users) -------------------------------------------------------------------------------- /black/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from black.models import Posts,Comment,Information,Buys,Img,Answer 4 | # Register your models here. 5 | 6 | admin.site.register([Posts,Comment,Information,Buys,Img,Answer]) -------------------------------------------------------------------------------- /user/migrations/0002_auto_20190401_1534.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-04-01 07:34 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameModel( 14 | old_name='user_list', 15 | new_name='Ulist', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /Blacklearn/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for Blacklearn project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blacklearn.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-django- 2 | Black学习社
3 | ===== 4 | 本项目是利用python django框架开发的一个学习资源分享网站,类似csdn
5 | ------ 6 | *网站功能介绍
7 | >>1.精品教程
8 | >>2.百度网盘教程资源
9 | >>3.编程源码资源
10 | >>4.有问必答
11 | >>5.B币获取
12 | >>6.分享资源
13 | >>7.升级vip
14 | 15 | [Black学习社-项目部署网址](http://114.115.166.10:8080/ "项目部署网址链接") 16 |
17 | 18 | *网站首页:
19 | ![image](https://github.com/WEIYANLIN1996/python-django-/blob/master/static/images/360截图20190401171337531.jpg) 20 | 21 | 22 | *功能模块源码介绍
23 | >>最近工作繁忙,有空更新 24 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blacklearn.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /user/migrations/0004_auto_20190518_0844.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-05-18 00:44 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0003_auto_20190415_2217'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='users', 15 | name='User_headpicurl', 16 | field=models.CharField(default='', max_length=100, verbose_name='用户头像地址'), 17 | ), 18 | migrations.AlterField( 19 | model_name='users', 20 | name='description', 21 | field=models.CharField(default='', max_length=200, verbose_name='个人说明'), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pip3 insrall amqp==2.2.2 2 | asn1crypto==0.24.0 3 | billiard==3.5.0.3 4 | celery==4.1.0 5 | certifi==2018.10.15 6 | cffi==1.11.5 7 | chardet==3.0.4 8 | cryptography==2.3.1 9 | Django==1.11.15 10 | django-cors-headers==2.4.0 11 | django-redis==4.8.0 12 | django-tinymce==2.6.0 13 | djangorestframework==3.7.7 14 | djangorestframework-jwt==1.11.0 15 | gunicorn==19.9.0 16 | idna==2.7 17 | itsdangerous==0.24 18 | jieba==0.39 19 | kombu==4.1.0 20 | olefile==0.44 21 | Pillow==4.3.0 22 | pycparser==2.19 23 | pycryptodome==3.6.6 24 | pycryptodomex==3.6.6 25 | PyJWT==1.6.4 26 | PyMySQL==0.9.2 27 | python-alipay-sdk==1.7.0 28 | pytz==2017.2 29 | redis==2.10.6 30 | six==1.11.0 31 | urllib3==1.23 32 | vine==1.1.4 33 | Whoosh==2.7.4 34 | django-haystack==2.8.1 35 | -------------------------------------------------------------------------------- /static/css/reset2.css: -------------------------------------------------------------------------------- 1 | /* 把标签默认的间距设为0 */ 2 | body,ul,ol,p,h1,h2,h3,h4,h5,h6,dl,dd,select,input,textarea,form{margin:0;padding:0} 3 | 4 | /* 让h标签文字大小继承body的文字设置 */ 5 | h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} 6 | 7 | /* 去掉列表默认的图标 */ 8 | ul,ol{list-style:none;} 9 | 10 | /* 去掉em默认的斜体 */ 11 | em{font-style: normal;} 12 | 13 | /* 去掉a标签默认的下划线 */ 14 | a{text-decoration:none;} 15 | 16 | 17 | /* 去掉加链接时产生的框线 */ 18 | img{border:0;} 19 | 20 | /* 清除浮动 */ 21 | .clearfix:before,.clearfix:after{content:"";display:table} 22 | .clearfix:after{clear:both;} 23 | .clearfix{zoom:1} 24 | 25 | /* 浮动 */ 26 | .fl{float:left} 27 | .fr{float:right} 28 | .error{ 29 | display:block; 30 | width:100%; 31 | height:15px; 32 | color:red; 33 | font-size:10px; 34 | text-align:center; 35 | margin-top:0; 36 | } -------------------------------------------------------------------------------- /库文件.txt: -------------------------------------------------------------------------------- 1 | pip3 install amqp 2 | pip3 install asn1crypto 3 | pip3 install billiard 4 | pip3 install celery 5 | pip3 install certifi 6 | pip3 install cffi 7 | pip3 install chardet 8 | pip3 install cryptography 9 | pip3 install django-cors-headers 10 | pip3 install django-redis 11 | pip3 install django-tinymce 12 | pip3 install djangorestframework 13 | pip3 install djangorestframework-jwt 14 | pip3 install gunicorn 15 | pip3 install idna 16 | pip3 install itsdangerous 17 | pip3 install jieba 18 | pip3 install kombu 19 | pip3 install olefile 20 | pip3 install Pillow 21 | pip3 install pycparser 22 | pip3 install pycryptodome 23 | pip3 install pycryptodomex 24 | pip3 install PyJWT 25 | pip3 install PyMySQL 26 | pip3 install python-alipay-sdk 27 | pip3 install pytz 28 | pip3 install redis 29 | pip3 install six 30 | pip3 install urllib3 31 | pip3 install vine 32 | pip3 install Whoosh 33 | pip3 install django-haystack -------------------------------------------------------------------------------- /user/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-04-01 03:12 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='user_list', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('userid', models.IntegerField(db_column='userid', default=1000)), 19 | ('username', models.CharField(max_length=20)), 20 | ('password', models.CharField(max_length=40)), 21 | ('description', models.CharField(max_length=200)), 22 | ('email', models.EmailField(max_length=254, verbose_name='用户邮箱')), 23 | ], 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /black/migrations/0002_img.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-05-01 14:02 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('black', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='Img', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('img', models.ImageField(upload_to='img', verbose_name='资源图片')), 18 | ('img_name', models.CharField(max_length=20, verbose_name='图片名')), 19 | ('wpurl', models.CharField(max_length=200, verbose_name='图片标识网盘地址')), 20 | ], 21 | options={ 22 | 'verbose_name': '资源图片', 23 | 'verbose_name_plural': '资源图片', 24 | 'db_table': 'Img_source', 25 | }, 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /other/urls.py: -------------------------------------------------------------------------------- 1 | """Blacklearn URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from . import views 17 | from django.contrib import admin 18 | from django.urls import path 19 | from django.conf.urls import url, include 20 | 21 | 22 | urlpatterns = [ 23 | url(r'source', views.source), 24 | url(r'buy', views.buy), 25 | url(r'seacher', views.seacher), 26 | ] 27 | -------------------------------------------------------------------------------- /static/css/reset.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td,hr { margin: 0; padding: 0;font-family: arial,"Microsoft Yahei","Hiragino Sans GB",sans-serif;} 3 | body{ font-size: 12px; background: #fff;} 4 | h1,h2,h3,h4,h5,h6 { font-family: arial,"Microsoft Yahei","Hiragino Sans GB",sans-serif; font-size: 100%; font-weight:normal;} 5 | input,textarea,select,button { font-size: 12px; font-weight: normal; vertical-align:middle;outline: none;} 6 | input[type='button'],input[type='submit'],select,button { cursor: pointer;} 7 | a{ text-decoration: none; } 8 | li{ list-style: none; } 9 | img{ border: 0; } 10 | .clearfix:after{content:".";display:block;height:0;visibility:hidden} 11 | .clearfix{display:inline-block} 12 | .clearfix{display:block} 13 | .clearfix:after,.fix:after{content:".";display:block;height:0;clear:both;visibility:hidden} 14 | .clearfix{zoom:1} 15 | .clear{ clear: both;} 16 | -------------------------------------------------------------------------------- /user/urls.py: -------------------------------------------------------------------------------- 1 | """Blacklearn URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from . import views 17 | from django.contrib import admin 18 | from django.urls import path 19 | from django.conf.urls import url, include 20 | 21 | 22 | urlpatterns = [ 23 | url(r'login', views.login), 24 | url(r'register', views.resgister), 25 | url(r'ucenter', views.user_center), 26 | url(r'forget', views.user_forget), 27 | url(r'logout', views.logout), 28 | url(r'pay', views.payvip), 29 | url(r'info', views.user_info), 30 | url(r'usermodify',views.uinfo_modify), 31 | ] 32 | -------------------------------------------------------------------------------- /Blacklearn/urls.py: -------------------------------------------------------------------------------- 1 | """Blacklearn URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.conf.urls import url, include 19 | from django.urls import path, re_path 20 | from django.views.static import serve 21 | from Blacklearn.settings import MEDIA_ROOT 22 | 23 | urlpatterns = [ 24 | path('admin/', admin.site.urls), 25 | url(r'', include('black.urls')), 26 | url(r'user', include('user.urls')), 27 | url(r'other', include('other.urls')), 28 | re_path(r'^media/(?P.*)', serve, {"document_root": MEDIA_ROOT}), 29 | ] 30 | -------------------------------------------------------------------------------- /black/migrations/0003_auto_20190518_0844.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-05-18 00:44 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('black', '0002_img'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Answer', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('question_name', models.CharField(max_length=100, verbose_name='提问者用户名')), 19 | ('question_content', models.TextField(default='??', verbose_name='提问内容')), 20 | ('question_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='提问时间')), 21 | ], 22 | options={ 23 | 'verbose_name': '提问表', 24 | 'verbose_name_plural': '提问表', 25 | 'db_table': 'question_list', 26 | }, 27 | ), 28 | migrations.AlterField( 29 | model_name='img', 30 | name='img_name', 31 | field=models.CharField(default='1', max_length=20, verbose_name='图片名'), 32 | ), 33 | ] 34 | -------------------------------------------------------------------------------- /black/urls.py: -------------------------------------------------------------------------------- 1 | """Blacklearn URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from . import views 17 | from django.contrib import admin 18 | from django.urls import path 19 | from django.conf.urls import url, include 20 | 21 | 22 | urlpatterns = [ 23 | url(r'^$', views.index), 24 | url(r'goodclass', views.gooodclass), 25 | url(r'bw', views.bw), 26 | url(r'bcym', views.bcym), 27 | url(r'getcoin', views.getcoin), 28 | url(r'answer', views.answer), 29 | url(r'enjoy', views.enjoy), 30 | url(r'vip', views.vip), 31 | url(r'posts', views.posts), 32 | url(r'comment',views.comment), 33 | url(r'question',views.question), 34 | 35 | ] 36 | -------------------------------------------------------------------------------- /user/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils import timezone 3 | # Create your models here. 4 | 5 | class Ulist(models.Model): 6 | userid = models.IntegerField(db_column='userid', default=1000) 7 | username = models.CharField(max_length=20,verbose_name='用户名') 8 | password = models.CharField(max_length=40,verbose_name='用户密码') 9 | description = models.CharField(max_length=200,verbose_name='个人说明') 10 | email = models.EmailField(verbose_name='用户邮箱') 11 | 12 | 13 | class Users(models.Model): 14 | userid = models.IntegerField(db_column='userid', default=1000) 15 | username = models.CharField(max_length=20,verbose_name='用户名') 16 | password = models.CharField(max_length=40,verbose_name='用户密码') 17 | description = models.CharField(max_length=200,verbose_name='个人说明',default="") 18 | email = models.EmailField(verbose_name='用户邮箱') 19 | User_headpicurl=models.CharField(max_length=100, verbose_name='用户头像地址',default="") 20 | user_allmarks=models.IntegerField(db_column='user_mark', default=20,verbose_name='用户B币数') 21 | register_time=models.DateTimeField(verbose_name='注册时间', default=timezone.now) 22 | 23 | class Meta: 24 | db_table= 'Users_list' 25 | verbose_name = '所有用户' 26 | verbose_name_plural = verbose_name 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /static/css/nprogress.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 767px) { 2 | #nprogress { 3 | pointer-events: none; 4 | } 5 | #nprogress .bar { 6 | background:#3399CC; 7 | position: fixed; 8 | z-index: 1031; 9 | top: 0; 10 | left: 0; 11 | width: 100%; 12 | height: 2px; 13 | } 14 | #nprogress .peg { 15 | display: block; 16 | position: absolute; 17 | right: 0px; 18 | width: 100px; 19 | height: 100%; 20 | box-shadow: 0 0 10px #29d, 0 0 5px #29d; 21 | opacity: 1.0; 22 | -webkit-transform: rotate(3deg) translate(0px, -4px); 23 | -ms-transform: rotate(3deg) translate(0px, -4px); 24 | transform: rotate(3deg) translate(0px, -4px); 25 | } 26 | #nprogress .spinner { 27 | display: block; 28 | position: fixed; 29 | z-index: 1031; 30 | top: 11px; 31 | right: 9px; 32 | } 33 | #nprogress .spinner-icon { 34 | width: 18px; 35 | height: 18px; 36 | box-sizing: border-box; 37 | border: solid 2px transparent; 38 | border-top-color: #FF0004; 39 | border-left-color: #29d; 40 | border-radius: 50%; 41 | -webkit-animation: nprogress-spinner 400ms linear infinite; 42 | animation: nprogress-spinner 400ms linear infinite; 43 | } 44 | .nprogress-custom-parent { 45 | overflow: hidden; 46 | position: relative; 47 | } 48 | .nprogress-custom-parent #nprogress .spinner, .nprogress-custom-parent #nprogress .bar { 49 | position: absolute; 50 | } 51 | } 52 | @-webkit-keyframes nprogress-spinner { 53 | 0% { 54 | -webkit-transform: rotate(0deg); 55 | } 56 | 100% { 57 | -webkit-transform: rotate(360deg); 58 | } 59 | } 60 | @keyframes nprogress-spinner { 61 | 0% { 62 | transform: rotate(0deg); 63 | } 64 | 100% { 65 | transform: rotate(360deg); 66 | } 67 | } -------------------------------------------------------------------------------- /static/css/public.css: -------------------------------------------------------------------------------- 1 | .ltHead{ 2 | width: 100%; 3 | height: 45px; 4 | background-color: dodgerblue; 5 | } 6 | .ltHead_cen{ 7 | width: 100%; 8 | height: 60px; 9 | margin: 0 auto; 10 | } 11 | .headPic1{ 12 | float: left; 13 | margin-top: 10px; 14 | } 15 | .headNav{ 16 | float: left; 17 | margin-left: 300px; 18 | } 19 | .headNav li{ 20 | float: left; 21 | font-size: 14px; 22 | text-align: center; 23 | line-height: 50px; 24 | margin-right: 20px; 25 | } 26 | .headNav li a{ 27 | color: #fff; 28 | text-align: center; 29 | line-height: 50px; 30 | } 31 | .ltForm{ 32 | width: 150px; 33 | height: 60px; 34 | float: right; 35 | } 36 | .headPic2{ 37 | margin-top: 15px; 38 | float: left; 39 | } 40 | .ltForm ul{ 41 | float: left; 42 | margin-left: 20px; 43 | } 44 | .ltForm ul li{ 45 | float: left; 46 | line-height: 60px; 47 | font-size: 14px; 48 | margin-right: 20px; 49 | } 50 | .ltForm ul li a{ 51 | color: #fff; 52 | } 53 | .lt_login{ 54 | height: 60px; 55 | float: right; 56 | background: url("../img/loginMsg.png") no-repeat 0 center; 57 | } 58 | .lt_login ul{ 59 | margin-left: 30px; 60 | 61 | } 62 | .lt_login li{ 63 | float: left; 64 | line-height: 60px; 65 | font-size: 14px; 66 | margin-left: 20px; 67 | text-indent: 20px; 68 | } 69 | .lt_login li:first-of-type{ 70 | background: url("../img/indexPerson.png") no-repeat 0 center; 71 | } 72 | .lt_login li:last-of-type{ 73 | background: url("../img/indexTc.png") no-repeat 0 center; 74 | } 75 | .lt_login li a{ 76 | color: #fff; 77 | } 78 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /user/migrations/0003_auto_20190415_2217.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.1 on 2019-04-15 14:17 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('user', '0002_auto_20190401_1534'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Users', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('userid', models.IntegerField(db_column='userid', default=1000)), 19 | ('username', models.CharField(max_length=20, verbose_name='用户名')), 20 | ('password', models.CharField(max_length=40, verbose_name='用户密码')), 21 | ('description', models.CharField(max_length=200, verbose_name='个人说明')), 22 | ('email', models.EmailField(max_length=254, verbose_name='用户邮箱')), 23 | ('User_headpicurl', models.CharField(max_length=100, verbose_name='用户头像地址')), 24 | ('user_allmarks', models.IntegerField(db_column='user_mark', default=20, verbose_name='用户B币数')), 25 | ('register_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='注册时间')), 26 | ], 27 | options={ 28 | 'verbose_name': '所有用户', 29 | 'verbose_name_plural': '所有用户', 30 | 'db_table': 'Users_list', 31 | }, 32 | ), 33 | migrations.AlterField( 34 | model_name='ulist', 35 | name='description', 36 | field=models.CharField(max_length=200, verbose_name='个人说明'), 37 | ), 38 | migrations.AlterField( 39 | model_name='ulist', 40 | name='password', 41 | field=models.CharField(max_length=40, verbose_name='用户密码'), 42 | ), 43 | migrations.AlterField( 44 | model_name='ulist', 45 | name='username', 46 | field=models.CharField(max_length=20, verbose_name='用户名'), 47 | ), 48 | ] 49 | -------------------------------------------------------------------------------- /templates/blackmain/vip.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}升级vip{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
7 |
8 | 24 | 39 | 40 |
41 |

说明

42 |
43 |

44 | 1.所有人员皆是本着自愿的原则购买vip,赞助本站,支持平台的运营,便于大家相互分享,不涉及任何商业利益行为。 45 | 46 | 2.本站资源由网站粉丝投稿,版权归资源原创所有,仅供学习交流,请于下载学习后24小时内删除,如侵犯了你的权益,请及时联系以便本站及时删除。 47 | 48 | 温馨提示:以任何方式,赞助本站者,均视为同意 以上声明,否则,请自觉离开,谢谢合作。 49 |

50 |
51 |
52 | 53 | 54 |
55 |
56 | {% endblock mainbody %} 57 | 58 | -------------------------------------------------------------------------------- /static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document); -------------------------------------------------------------------------------- /static/js/register.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | var error_name = false; 4 | var error_password = false; 5 | var error_check_password = false; 6 | var error_email = false; 7 | var error_check = false; 8 | 9 | 10 | $('#user_name').blur(function() { 11 | check_user_name(); 12 | }); 13 | 14 | $('#pwd').blur(function() { 15 | check_pwd(); 16 | }); 17 | 18 | $('#cpwd').blur(function() { 19 | check_cpwd(); 20 | }); 21 | 22 | $('#email').blur(function() { 23 | check_email(); 24 | }); 25 | 26 | $('#allow').click(function() { 27 | if($(this).is(':checked')) 28 | { 29 | error_check = false; 30 | $(this).siblings('span').hide(); 31 | } 32 | else 33 | { 34 | error_check = true; 35 | $(this).siblings('span').html('请勾选同意'); 36 | $(this).siblings('span').show(); 37 | } 38 | }); 39 | 40 | 41 | function check_user_name(){ 42 | var len = $('#user_name').val().length; 43 | if(len<5||len>20) 44 | { 45 | $('#user_name').next().html('请输入5-20个字符的用户名') 46 | $('#user_name').next().show(); 47 | error_name = true; 48 | } 49 | else 50 | { 51 | $('#user_name').next().hide(); 52 | error_name = false; 53 | } 54 | } 55 | 56 | function check_pwd(){ 57 | var len = $('#pwd').val().length; 58 | if(len<8||len>20) 59 | { 60 | $('#pwd').next().html('密码最少8位,最长20位') 61 | $('#pwd').next().show(); 62 | error_password = true; 63 | } 64 | else 65 | { 66 | $('#pwd').next().hide(); 67 | error_password = false; 68 | } 69 | } 70 | 71 | 72 | function check_cpwd(){ 73 | var pass = $('#pwd').val(); 74 | var cpass = $('#cpwd').val(); 75 | 76 | if(pass!=cpass) 77 | { 78 | $('#cpwd').next().html('两次输入的密码不一致') 79 | $('#cpwd').next().show(); 80 | error_check_password = true; 81 | } 82 | else 83 | { 84 | $('#cpwd').next().hide(); 85 | error_check_password = false; 86 | } 87 | 88 | } 89 | 90 | function check_email(){ 91 | var re = /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/; 92 | 93 | if(re.test($('#email').val())) 94 | { 95 | $('#email').next().hide(); 96 | error_email = false; 97 | } 98 | else 99 | { 100 | $('#email').next().html('你输入的邮箱格式不正确') 101 | $('#email').next().show(); 102 | error_check_password = true; 103 | } 104 | 105 | } 106 | 107 | 108 | $('#reg_form').submit(function() { 109 | check_user_name(); 110 | check_pwd(); 111 | check_cpwd(); 112 | check_email(); 113 | 114 | if(error_name == false && error_password == false && error_check_password == false && error_email == false && error_check == false) 115 | { 116 | return true; 117 | } 118 | else 119 | { 120 | return false; 121 | } 122 | 123 | }); 124 | }) -------------------------------------------------------------------------------- /static/js/slide.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var $slides = $('.slide_pics li'); 3 | var len = $slides.length; 4 | var nowli = 0; 5 | var prevli = 0; 6 | var $prev = $('.prev'); 7 | var $next = $('.next'); 8 | var ismove = false; 9 | var timer = null; 10 | $slides.not(':first').css({left:760}); 11 | $slides.each(function(index, el) { 12 | var $li = $('
  • '); 13 | 14 | if(index==0) 15 | { 16 | $li.addClass('active'); 17 | } 18 | 19 | $li.appendTo($('.points')); 20 | }); 21 | $points = $('.points li'); 22 | timer = setInterval(autoplay,4000); 23 | 24 | $('.slide').mouseenter(function() { 25 | clearInterval(timer); 26 | }); 27 | 28 | $('.slide').mouseleave(function() { 29 | timer = setInterval(autoplay,4000); 30 | }); 31 | 32 | function autoplay(){ 33 | nowli++; 34 | move(); 35 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 36 | } 37 | 38 | $points.click(function(event) { 39 | if(ismove) 40 | { 41 | return; 42 | } 43 | nowli = $(this).index(); 44 | 45 | if(nowli==prevli) 46 | { 47 | return; 48 | } 49 | 50 | $(this).addClass('active').siblings().removeClass('active'); 51 | move(); 52 | 53 | }); 54 | 55 | $prev.click(function() { 56 | if(ismove) 57 | { 58 | return; 59 | } 60 | nowli--; 61 | move(); 62 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 63 | 64 | }); 65 | 66 | $next.click(function() { 67 | if(ismove) 68 | { 69 | return; 70 | } 71 | nowli++; 72 | move(); 73 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 74 | 75 | }); 76 | 77 | 78 | function move(){ 79 | 80 | ismove = true; 81 | 82 | if(nowli<0) 83 | { 84 | nowli=len-1; 85 | prevli = 0 86 | $slides.eq(nowli).css({left:-760}); 87 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 88 | $slides.eq(prevli).animate({left:760},800,'easeOutExpo',function(){ 89 | ismove = false; 90 | }); 91 | prevli=nowli; 92 | return; 93 | } 94 | 95 | if(nowli>len-1) 96 | { 97 | nowli = 0; 98 | prevli = len-1; 99 | $slides.eq(nowli).css({left:760}); 100 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 101 | $slides.eq(prevli).animate({left:-760},800,'easeOutExpo',function(){ 102 | ismove = false; 103 | }); 104 | prevli=nowli; 105 | return; 106 | } 107 | 108 | 109 | if(prevlij.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); -------------------------------------------------------------------------------- /templates/users/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Black学习社-登录 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |
    欢迎来到Black学习社!
    15 |
    16 | 21 | 25 |
    26 |
    27 |
    28 | 33 | 34 | 62 | 66 | 104 | 105 | -------------------------------------------------------------------------------- /static/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /templates/users/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Black学习社-注册 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 |
    欢迎来到Black学习社!
    16 |
    17 | 22 | 28 |
    29 |
    30 |
    31 |
    32 |
    33 | 34 |
    无尽资源,Black学习社
    35 |
    36 |
    37 | 38 |
    39 |
    40 |

    用户注册

    41 | 登录 42 |
    43 |
    44 |
    45 | {% csrf_token %} 46 |
      47 |
    • 48 | 49 | 50 | 提示信息 51 |
    • 52 |
    • 53 | 54 | 55 | 提示信息 56 |
    • 57 |
    • 58 | 59 | 60 | 提示信息 61 |
    • 62 |
    • 63 | 64 | 65 | 提示信息 66 |
    • 67 |
    • 68 | 69 |

      {{errmsg}}

      70 |
    • 71 |
    72 |
    73 |
    74 | 115 |
    116 | 117 |
    118 | 119 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | # Create your models here. 3 | from django.utils import timezone 4 | 5 | class Posts(models.Model): 6 | """ 7 | 资源帖子 8 | """ 9 | title = models.CharField(verbose_name='标题', max_length=100) 10 | content = models.TextField(verbose_name='资源介绍', default='') 11 | source_picurl = models.CharField(max_length=100, verbose_name='资源图片展示地址') 12 | source_bgurl = models.CharField(verbose_name='资源网盘或开源连接', max_length=300) 13 | source_psw = models.CharField(verbose_name='资源网盘密码', max_length=150,default='') 14 | source_valuemarks = models.IntegerField(default=50, verbose_name='资源值B币数') 15 | source_type = models.CharField(verbose_name='资源类型',max_length=150) 16 | create_time = models.DateTimeField(verbose_name='分享时间', default=timezone.now) 17 | click_nums = models.IntegerField(verbose_name='浏览量', default=0) 18 | load_nums = models.IntegerField(verbose_name='使用量', default=0) 19 | share_name = models.CharField(verbose_name='分享资源用户名', max_length=100) 20 | source_price= models.IntegerField(verbose_name='市场价值', default=80) 21 | 22 | class Meta: 23 | db_table= 'Posts_list' 24 | verbose_name = '我的资源' 25 | verbose_name_plural = verbose_name 26 | 27 | def __str__(self): 28 | return self.title 29 | 30 | 31 | class Comment(models.Model): 32 | """ 33 | 评论表 34 | """ 35 | comment_sourcename = models.CharField(verbose_name='评论资源用户名', max_length=100) 36 | comment_name = models.CharField(verbose_name='评论用户名', max_length=100) 37 | source_id = models.IntegerField(db_column='sourceid', default=1,verbose_name='评论资源id') 38 | comment_content= models.TextField(verbose_name='评论内容', default='??') 39 | comment_time = models.DateTimeField(verbose_name='评论时间', default=timezone.now) 40 | class Meta: 41 | db_table= 'Comment_list' 42 | verbose_name = '评论表' 43 | verbose_name_plural = verbose_name 44 | 45 | 46 | 47 | class Information(models.Model): 48 | """ 49 | 消息表 50 | """ 51 | send_name = models.CharField(verbose_name='发消息用户名', max_length=100) 52 | receive_name = models.CharField(verbose_name='接收者用户名', max_length=100) 53 | info_content = models.TextField(verbose_name='消息内容', default='??') 54 | send_time = models.DateTimeField(verbose_name='发送时间', default=timezone.now) 55 | read_sure=models.BooleanField(verbose_name='是否已经被阅读',default= False) 56 | 57 | class Meta: 58 | db_table= 'Info_list' 59 | verbose_name = '消息表' 60 | verbose_name_plural = verbose_name 61 | 62 | 63 | 64 | class Buys(models.Model): 65 | '''已被使用资源表''' 66 | 67 | source_id = models.IntegerField(db_column='source_id',verbose_name='资源id') 68 | user = models.CharField(verbose_name='使用者用户名', max_length=100) 69 | use_time = models.DateTimeField(verbose_name='使用时间', default=timezone.now) 70 | source_value = models.IntegerField(verbose_name='资源价值', default=80) 71 | 72 | 73 | class Meta: 74 | db_table = 'buys_list' 75 | verbose_name = '已被使用资源' 76 | verbose_name_plural = verbose_name 77 | 78 | 79 | 80 | 81 | class Img(models.Model): 82 | img = models.ImageField(upload_to='img',verbose_name="资源图片") 83 | img_name = models.CharField(max_length=20,verbose_name="图片名",default="1") 84 | wpurl=models.CharField(max_length=200,verbose_name="图片标识网盘地址") 85 | 86 | class Meta: 87 | db_table= 'Img_source' 88 | verbose_name = '资源图片' 89 | verbose_name_plural = verbose_name 90 | 91 | class Answer(models.Model): 92 | 93 | question_name = models.CharField(verbose_name='提问者用户名', max_length=100) 94 | question_content = models.TextField(verbose_name='提问内容', default='??') 95 | question_time = models.DateTimeField(verbose_name='提问时间', default=timezone.now) 96 | 97 | class Meta: 98 | db_table = 'question_list' 99 | verbose_name = '提问表' 100 | verbose_name_plural = verbose_name -------------------------------------------------------------------------------- /black/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | from django.utils import timezone 5 | 6 | class Posts(models.Model): 7 | """ 8 | 资源帖子 9 | """ 10 | title = models.CharField(verbose_name='标题', max_length=100) 11 | content = models.TextField(verbose_name='资源介绍', default='') 12 | source_picurl = models.CharField(max_length=100, verbose_name='资源图片展示地址') 13 | source_bgurl = models.CharField(verbose_name='资源网盘或开源连接', max_length=300) 14 | source_psw = models.CharField(verbose_name='资源网盘密码', max_length=150,default='') 15 | source_valuemarks = models.IntegerField(default=50, verbose_name='资源值B币数') 16 | source_type = models.CharField(verbose_name='资源类型',max_length=150) 17 | create_time = models.DateTimeField(verbose_name='分享时间', default=timezone.now) 18 | click_nums = models.IntegerField(verbose_name='浏览量', default=0) 19 | load_nums = models.IntegerField(verbose_name='使用量', default=0) 20 | share_name = models.CharField(verbose_name='分享资源用户名', max_length=100) 21 | source_price= models.IntegerField(verbose_name='市场价值', default=80) 22 | 23 | class Meta: 24 | db_table= 'Posts_list' 25 | verbose_name = '我的资源' 26 | verbose_name_plural = verbose_name 27 | 28 | def __str__(self): 29 | return self.title 30 | 31 | 32 | class Comment(models.Model): 33 | """ 34 | 评论表 35 | """ 36 | comment_sourcename = models.CharField(verbose_name='评论资源用户名', max_length=100) 37 | comment_name = models.CharField(verbose_name='评论用户名', max_length=100) 38 | source_id = models.IntegerField(db_column='sourceid', default=1,verbose_name='评论资源id') 39 | comment_content= models.TextField(verbose_name='评论内容', default='??') 40 | comment_time = models.DateTimeField(verbose_name='评论时间', default=timezone.now) 41 | class Meta: 42 | db_table= 'Comment_list' 43 | verbose_name = '评论表' 44 | verbose_name_plural = verbose_name 45 | 46 | 47 | 48 | class Information(models.Model): 49 | """ 50 | 消息表 51 | """ 52 | send_name = models.CharField(verbose_name='发消息用户名', max_length=100) 53 | receive_name = models.CharField(verbose_name='接收者用户名', max_length=100) 54 | info_content = models.TextField(verbose_name='消息内容', default='??') 55 | send_time = models.DateTimeField(verbose_name='发送时间', default=timezone.now) 56 | read_sure=models.BooleanField(verbose_name='是否已经被阅读',default= False) 57 | 58 | class Meta: 59 | db_table= 'Info_list' 60 | verbose_name = '消息表' 61 | verbose_name_plural = verbose_name 62 | 63 | 64 | 65 | class Buys(models.Model): 66 | '''已被使用资源表''' 67 | 68 | source_id = models.IntegerField(db_column='source_id',verbose_name='资源id') 69 | user = models.CharField(verbose_name='使用者用户名', max_length=100) 70 | use_time = models.DateTimeField(verbose_name='使用时间', default=timezone.now) 71 | source_value = models.IntegerField(verbose_name='资源价值', default=80) 72 | 73 | 74 | class Meta: 75 | db_table = 'buys_list' 76 | verbose_name = '已被使用资源' 77 | verbose_name_plural = verbose_name 78 | 79 | 80 | 81 | 82 | class Img(models.Model): 83 | img = models.ImageField(upload_to='img',verbose_name="资源图片") 84 | img_name = models.CharField(max_length=20,verbose_name="图片名",default="1") 85 | wpurl=models.CharField(max_length=200,verbose_name="图片标识网盘地址") 86 | 87 | class Meta: 88 | db_table= 'Img_source' 89 | verbose_name = '资源图片' 90 | verbose_name_plural = verbose_name 91 | 92 | class Answer(models.Model): 93 | 94 | question_name = models.CharField(verbose_name='提问者用户名', max_length=100) 95 | question_content = models.TextField(verbose_name='提问内容', default='??') 96 | question_time = models.DateTimeField(verbose_name='提问时间', default=timezone.now) 97 | 98 | class Meta: 99 | db_table = 'question_list' 100 | verbose_name = '提问表' 101 | verbose_name_plural = verbose_name -------------------------------------------------------------------------------- /templates/blackmain/getcoin.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}B币获取{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | {% block mainbody %} 5 |
    6 |
    7 | 39 |
    40 |

    评论

    41 |
    42 | {% csrf_token %} 43 |
    44 |
    45 | 46 | 52 |
    53 |
    54 |
    55 |
      56 | {% for comment in zy_comment%} 57 |
    • {{comment.comment_name}} ({{comment.comment_time}}) 说:
      58 | {{comment.comment_content}}
    • 59 | {% endfor %} 60 |
    61 |
    62 |
    63 |
    64 |
    65 | 108 | {% endblock mainbody %} 109 | 110 | -------------------------------------------------------------------------------- /static/js/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl 2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT 3 | * */ 4 | 5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b0){var a=l,f,e=s.substring(0,e).replace(H,i);if(e==i||e.charAt(e.length-1)==o)e+="*";try{f=t(e)}catch(k){}if(f){e=0;for(c=f.length;e-1&&(a=a.substring(0,l));if(a.charAt(0)==":")switch(a.slice(1)){case "root":c=function(a){return b?a!=p:a==p};break;case "target":if(m==8){c=function(a){function c(){var d=location.hash,e=d.slice(1);return b?d==i||a.id!=e:d!=i&&a.id==e}k(j,"hashchange",function(){g(a,d,c())});return c()};break}return!1;case "checked":c=function(a){J.test(a.type)&&k(a,"propertychange",function(){event.propertyName=="checked"&&g(a,d,a.checked!==b)});return a.checked!==b};break;case "disabled":b=!b;case "enabled":c=function(c){if(K.test(c.tagName))return k(c,"propertychange",function(){event.propertyName=="$disabled"&&g(c,d,c.a===b)}),q.push(c),c.a=c.disabled,c.disabled===b;return a==":enabled"?b:!b};break;case "focus":e="focus",f="blur";case "hover":e||(e="mouseenter",f="mouseleave");c=function(a){k(a,b?f:e,function(){g(a,d,!0)});k(a,b?e:f,function(){g(a,d,!1)});return b};break;default:if(!L.test(a))return!1}return{className:d,b:c}}function w(a){return M+"-"+(m==6&&N?O++:a.replace(P,function(a){return a.charCodeAt(0)}))}function D(a){return a.replace(x,h).replace(Q,o)}function g(a,c,d){var b=a.className,c=u(b,c,d);if(c!=b)a.className=c,a.parentNode.className+=i}function u(a,c,d){var b=RegExp("(^|\\s)"+c+"(\\s|$)"),e=b.test(a);return d?e?a:a+o+c:e?a.replace(b,h).replace(x,h):a}function k(a,c,d){a.attachEvent("on"+c,d)}function r(a,c){if(/^https?:\/\//i.test(a))return c.substring(0,c.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return c.substring(0,c.indexOf("/",8))+a;var d=c.split(/[?#]/)[0];a.charAt(0)!="?"&&d.charAt(d.length-1)!="/"&&(d=d.substring(0,d.lastIndexOf("/")+1));return d+a}function y(a){if(a)return n.open("GET",a,!1),n.send(),(n.status==200?n.responseText:i).replace(R,i).replace(S,function(c,d,b,e,f){return y(r(b||f,a))}).replace(T,function(c,d,b){d=d||i;return" url("+d+r(b,a)+d+") "});return i}function U(){var a,c;a=f.getElementsByTagName("BASE");for(var d=a.length>0?a[0].href:f.location.href,b=0;b0&&setInterval(function(){for(var a=0,c=q.length;a8||!n)){var z={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},t,q=[],O=0,N=!0,M="slvzr",R=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,S=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,T=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g,L=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,B=/:(:first-(?:line|letter))/g,C=/(^|})\s*([^\{]*?[\[:][^{]+)/g,G=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,H=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,P=/[^\w-]/g,K=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,J=/^(checkbox|radio)$/,v=m>6?/[\$\^*]=(['"])\1/:null,E=/([(\[+~])\s+/g,F=/\s+([)\]+~])/g,Q=/\s+/g,x=/^\s*((?:[\S\s]*\S)?)\s*$/,i="",o=" ",h="$1";(function(a,c){function d(){try{p.doScroll("left")}catch(a){setTimeout(d,50);return}b("poll")}function b(d){if(!(d.type=="readystatechange"&&f.readyState!="complete")&&((d.type=="load"?a:f).detachEvent("on"+d.type,b,!1),!e&&(e=!0)))c.call(a,d.type||d)}var e=!1,g=!0;if(f.readyState=="complete")c.call(a,i);else{if(f.createEventObject&&p.doScroll){try{g=!a.frameElement}catch(h){}g&&d()}k(f,"readystatechange",b);k(a,"load",b)}})(j,function(){for(var a in z){var c,d,b=j;if(j[a]){for(c=z[a].replace("*",a).split(".");(d=c.shift())&&(b=b[d]););if(typeof b=="function"){t=b;U();break}}}})}}})(this); -------------------------------------------------------------------------------- /other/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from user.models import Users 3 | from black.models import Posts 4 | from black.models import Buys 5 | from black.models import Comment 6 | from black.models import Information 7 | from black.models import Answer 8 | from django.http import JsonResponse 9 | from django.core.paginator import Paginator , PageNotAnInteger,EmptyPage 10 | # Create your views here. 11 | def source(request): 12 | if request.method=="GET": 13 | sid = request.GET.get('n') 14 | if sid=="": 15 | return JsonResponse({'res': "无此页面"}) 16 | else: 17 | source = Posts.objects.filter(id=sid) 18 | zy_comment=Comment.objects.filter(source_id=sid) 19 | buysource = Buys.objects.filter(source_id=sid) 20 | #source_img = Img.objects.filter(wpurl=source[0].source_bgurl) 21 | context={ 22 | 'title': source[0].title, 23 | 'content': source[0].content, 24 | 'source_bgurl': source[0].source_bgurl, 25 | 'source_psw':source[0].source_psw, 26 | 'source_valuemarks': source[0].source_valuemarks, 27 | 'click_nums': source[0].click_nums, 28 | 'load_nums': source[0].load_nums, 29 | 'source_price': source[0].source_price, 30 | 'share_name': source[0].share_name, 31 | 'source_id': source[0].id, 32 | 'share_time':source[0].create_time, 33 | 'zy_comment':zy_comment, 34 | 'buysource':buysource, 35 | } 36 | print(zy_comment) 37 | return render(request,'other/contentzy.html',context) 38 | else: 39 | return JsonResponse({'res': "无此页面"}) 40 | 41 | def send(send_name,content,receive_name): 42 | try: 43 | buy = Information(send_name=send_name, receive_name=receive_name, info_content=content) 44 | buy.save() 45 | except Exception as e: 46 | print("e: ", e) 47 | 48 | 49 | 50 | def buy(request): 51 | if request.method=="POST": 52 | user_name = request.POST.get('user_name') 53 | source_id=request.POST.get('source_id') 54 | source_value=request.POST.get('source_value') 55 | source = Buys.objects.filter(id=source_id) 56 | 57 | for record in source: 58 | if record.user==user_name: 59 | return JsonResponse({'res': 1, 'errmsg': '您已购买此资源'}) 60 | else: 61 | continue 62 | user = Users.objects.get(username=user_name) 63 | if int(user.user_allmarks)>=int(source_value): 64 | user_allmarks=int(user.user_allmarks)-int(source_value) 65 | user.user_allmarks=user_allmarks 66 | user.save() 67 | else: 68 | return JsonResponse({'res': 2, 'errmsg': '积分不足'}) 69 | try: 70 | buy=Buys(source_id=source_id,user=user_name,source_value=source_value) 71 | buy.save() 72 | except Exception as e: 73 | print("e: ", e) 74 | return JsonResponse({'res': 3, 'errmsg': '购买失败'}) 75 | 76 | posts = Posts.objects.get(id=source_id) 77 | posts.load_nums = posts.load_nums + 1 78 | posts.save() 79 | source = Posts.objects.filter(id=source_id) 80 | send_name="系统消息" 81 | content="你已兑换资源"+str(source[0].title)+"网盘/开源网址"+str(source[0].source_bgurl)+" 网盘密码:"+str(source[0].source_psw) 82 | send(send_name,content,request.session['username']) 83 | return JsonResponse({'res': 0,'bgurl':source[0].source_bgurl,'psw':source[0].source_psw}) 84 | else: 85 | return JsonResponse({'res': "无此页面"}) 86 | 87 | 88 | def seacher(request): 89 | if request.method=="GET": 90 | skey=request.GET.get('seacherkey') 91 | if not skey: 92 | error_msg = '请输入关键词' 93 | return render(request, 'other/seacher.html', {'error_msg': error_msg}) 94 | else: 95 | contact_list = Posts.objects.filter(title__icontains=skey).order_by("-create_time") 96 | paginator = Paginator(contact_list, 7) # Show 25 contacts per page 97 | 98 | page = request.GET.get('page', '1') 99 | try: 100 | contacts = paginator.page(page) 101 | except PageNotAnInteger: 102 | # If page is not an integer, deliver first page. 103 | contacts = paginator.page(1) 104 | except EmptyPage: 105 | # If page is out of range (e.g. 9999), deliver last page of results. 106 | contacts = paginator.page(paginator.num_pages) 107 | 108 | return render(request, 'other/seacher.html', {'contacts': contacts, 'paginator': paginator,'num':len(contact_list),'key':skey}) 109 | else: 110 | return JsonResponse({'res': "无此页面"}) 111 | -------------------------------------------------------------------------------- /Blacklearn/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for Blacklearn project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.1. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = ')-e4#3(mj-dde7f50l$!(3suv2=2+4r1cyxgj+#7(e_fb)(ve5' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = ['*'] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'black', 41 | 'user', 42 | #'img_db', 43 | ] 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | #'django.middleware.security.SecurityMiddleware', 56 | #'django.contrib.sessions.middleware.SessionMiddleware', 57 | #'django.middleware.common.CommonMiddleware', 58 | #'django.middleware.csrf.CsrfViewMiddleware', 59 | #'django.contrib.auth.middleware.AuthenticationMiddleware', 60 | #'django.contrib.messages.middleware.MessageMiddleware', 61 | #'django.middleware.clickjacking.XFrameOptionsMiddleware', 62 | 63 | 64 | ROOT_URLCONF = 'Blacklearn.urls' 65 | 66 | TEMPLATES = [ 67 | { 68 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 69 | 'DIRS': [BASE_DIR+"/templates",], 70 | 'APP_DIRS': True, 71 | 'OPTIONS': { 72 | 'context_processors': [ 73 | 'django.template.context_processors.debug', 74 | 'django.template.context_processors.request', 75 | 'django.contrib.auth.context_processors.auth', 76 | 'django.contrib.messages.context_processors.messages', 77 | 'django.template.context_processors.media', 78 | ], 79 | }, 80 | }, 81 | ] 82 | 83 | WSGI_APPLICATION = 'Blacklearn.wsgi.application' 84 | 85 | 86 | # Database 87 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 88 | 89 | DATABASES = { 90 | 'default': { 91 | 'ENGINE': 'django.db.backends.mysql', 92 | 'NAME': 'test', 93 | 'USER': 'root', 94 | 'PASSWORD': 'wyl336339', 95 | 'HOST': '127.0.0.1', 96 | 'PORT': 3306, 97 | 'OPTIONS': { 98 | 'read_default_file': '/path/to/my.cnf', 99 | 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 100 | }, 101 | } 102 | } 103 | 104 | 105 | # Password validation 106 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 107 | 108 | AUTH_PASSWORD_VALIDATORS = [ 109 | { 110 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 111 | }, 112 | { 113 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 114 | }, 115 | { 116 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 117 | }, 118 | { 119 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 120 | }, 121 | ] 122 | 123 | 124 | # Internationalization 125 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 126 | 127 | LANGUAGE_CODE = 'en-us' 128 | 129 | TIME_ZONE = 'UTC' 130 | 131 | USE_I18N = True 132 | 133 | USE_L10N = True 134 | 135 | USE_TZ = True 136 | 137 | 138 | # Static files (CSS, JavaScript, Images) 139 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 140 | 141 | STATIC_URL = '/static/' 142 | STATICFILES_DIRS=[ 143 | os.path.join(BASE_DIR,'static'), 144 | ] 145 | 146 | SESSION_ENGINE = "django.contrib.sessions.backends.db" 147 | SESSION_CACHE_ALIAS = "default" 148 | SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' 149 | 150 | # 设置静态文件路径为主目录下的media文件夹 151 | 152 | MEDIA_URL = '/media/' 153 | MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 154 | 155 | SESSION_COOKIE_AGE=60*30 -------------------------------------------------------------------------------- /templates/other/payvip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vip购买 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    欢迎来到Black学习社!
    17 |
    18 | {% if request.session.islogin %} 19 | 24 | {% else %} 25 | 30 | {% endif %} 31 | 37 |
    38 |
    39 |
    40 | 41 | 52 |
    53 | 65 |
    66 | 67 |

    支付方式

    68 |
    69 |
    70 | 71 | 72 | 73 | 74 |
    75 |
    76 |
    77 |
    订单编号:
    78 |
    c93442585s
    79 |
    80 |
    81 |
    82 | 83 |

    订单列表

    84 |
    85 |
      86 |
    • 商品名称
    • 87 |
    • 商品价格
    • 88 |
    • 数量
    • 89 |
    • 小计
    • 90 |
    91 |
      92 |
    • 1
    • 93 |
    • 94 |
    • Black学习社vip会员
    • 95 |
    • 20.00元
    • 96 |
    • 1
    • 97 |
    • 20.00元
    • 98 |
    99 |
    100 | 101 |

    总金额结算

    102 | 103 |
    104 |
    105 |
    1件商品,总金额20.00元
    106 |
    实付款:20.00元
    107 |
    108 |
    109 | 110 |
    111 | 提交订单 112 |
    113 | 114 | 118 | 119 | 126 | 127 | 138 | 139 | -------------------------------------------------------------------------------- /templates/users/payvip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vip购买 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    欢迎来到Black学习社!
    17 |
    18 | {% if request.session.islogin %} 19 | 26 | {% else %} 27 | 32 | {% endif %} 33 | 37 |
    38 |
    39 |
    40 | 41 | 52 |
    53 | 65 |
    66 | 67 |

    支付方式

    68 |
    69 |
    70 | 71 | 72 | 73 | 74 |
    75 |
    76 |
    77 |
    订单编号:
    78 |
    c93442585s
    79 |
    80 |
    81 |
    82 | 83 |

    订单列表

    84 |
    85 |
      86 |
    • 商品名称
    • 87 |
    • 商品价格
    • 88 |
    • 数量
    • 89 |
    • 小计
    • 90 |
    91 |
      92 |
    • 1
    • 93 |
    • 94 |
    • Black学习社vip会员
    • 95 |
    • 20.00元
    • 96 |
    • 1
    • 97 |
    • 20.00元
    • 98 |
    99 |
    100 | 101 |

    总金额结算

    102 | 103 |
    104 |
    105 |
    1件商品,总金额20.00元
    106 |
    实付款:20.00元
    107 |
    108 |
    109 | 110 |
    111 | 提交订单 112 |
    113 | 114 | 118 | 119 | 126 | 127 | 138 | 139 | -------------------------------------------------------------------------------- /user/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import JsonResponse 3 | from user.models import Users 4 | from black.models import Posts 5 | from black.models import Information 6 | from django.core.paginator import Paginator , PageNotAnInteger,EmptyPage 7 | import re 8 | from django.shortcuts import render, redirect, reverse 9 | 10 | 11 | 12 | 13 | # Create your views here. 14 | def login(request): 15 | if request.method=="GET": 16 | return render(request,'users/login.html',{'errmsg': ''}) 17 | 18 | if request.method=="POST": 19 | username = request.POST.get('username') 20 | password = request.POST.get('pwd') 21 | 22 | userlist = Users.objects.all() 23 | for var in userlist: 24 | if var.username==username and var.password==password: 25 | request.session['islogin'] = True 26 | request.session['username'] = username 27 | request.session['user_id'] = var.userid 28 | return JsonResponse({'res': 0, 'jump_url': 'http:127.0.0.1:8080/'}) 29 | else: 30 | continue 31 | return JsonResponse({'res': 1, 'errmsg': '登录失败'}) 32 | 33 | def logout(request): 34 | request.session['islogin'] = False 35 | del request.session['username'] 36 | del request.session['user_id'] 37 | # 跳转到首页 38 | return render(request,'users/login.html') 39 | 40 | def resgister(request): 41 | if request.method=="GET": 42 | return render(request,'users/register.html', {'errmsg': ''}) 43 | 44 | if request.method=="POST": 45 | username = request.POST.get('user_name') 46 | password = request.POST.get('pwd') 47 | cpassword = request.POST.get('cpwd') 48 | email = request.POST.get('email') 49 | if not all([username, password, email]): 50 | # 有数据为空 51 | return render(request, 'users/register.html', {'errmsg': '参数不能为空!'}) 52 | 53 | if not re.match(r'^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$', email): 54 | # 邮箱不合法 55 | return render(request, 'users/register.html', {'errmsg': '邮箱不合法!'}) 56 | if password!=cpassword: 57 | return render(request, 'users/register.html', {'errmsg': '两次密码不一致!'}) 58 | try: 59 | new_data = Users.objects.order_by('-id')[:1] 60 | if len(new_data)>=1: 61 | newuid=new_data[0].userid+1 62 | passport = Users(username=username, password=password, email=email,userid=newuid) 63 | else: 64 | passport = Users(username=username, password=password, email=email) 65 | passport.save() 66 | except Exception as e: 67 | print("e: ", e) # 把异常打印出来 68 | return render(request, 'users/register.html', {'errmsg': '用户名已存在!'}) 69 | return render(request, 'users/login.html') 70 | 71 | def user_center(request): 72 | user_info = Users.objects.get(username=request.session['username']) 73 | source = Posts.objects.filter(share_name=request.session['username']) 74 | info = Information.objects.filter(receive_name=request.session['username'],read_sure=False) 75 | paginator = Paginator(source,5) # Show 25 contacts per page 76 | 77 | page = request.GET.get('page','1') 78 | try: 79 | contacts = paginator.page(page) 80 | except PageNotAnInteger: 81 | # If page is not an integer, deliver first page. 82 | contacts = paginator.page(1) 83 | except EmptyPage: 84 | # If page is out of range (e.g. 9999), deliver last page of results. 85 | contacts = paginator.page(paginator.num_pages) 86 | 87 | context = { 88 | 'zynum':len(source), 89 | 'info_num':len(info), 90 | 'contacts': contacts, 91 | 'paginator': paginator, 92 | 'user_info':user_info, 93 | } 94 | return render(request, 'users/user_center_info.html',context) 95 | 96 | def user_forget(request): 97 | return render(request, 'users/user_center_order.html') 98 | 99 | def payvip(request): 100 | return render(request, 'users/payvip.html') 101 | 102 | def user_info(request): 103 | if request.method=="GET": 104 | user_info = Users.objects.get(username=request.session['username']) 105 | source = Posts.objects.filter(share_name=request.session['username']) 106 | info = Information.objects.filter(receive_name=request.session['username']).order_by('-send_time') 107 | info_n = Information.objects.filter(receive_name=request.session['username'], read_sure=False) 108 | context = { 109 | 'zynum': len(source), 110 | 'info':info, 111 | 'info_num':len(info_n), 112 | 'user_info': user_info, 113 | } 114 | return render(request, 'users/user_info.html', context) 115 | else: 116 | return JsonResponse({'res': 1, 'errmsg': '无效请求'}) 117 | 118 | def uinfo_modify(request): 119 | if request.method=="POST": 120 | username=request.POST.get('username') 121 | des=request.POST.get('des') 122 | user_info=Users.objects.get(username=request.session['username']) 123 | user_info.username=username 124 | user_info.description =des 125 | user_info.save() 126 | request.session['username'] = username 127 | return JsonResponse({'res':0,'errmsg': 'success'}) 128 | 129 | else: 130 | return JsonResponse({'res': 1, 'errmsg': '无效请求'}) -------------------------------------------------------------------------------- /templates/blackmain/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}首页{% endblock title %} 3 | 4 | {% block fdnav %} 5 | 18 | {% endblock fdnav %} 19 | 20 | {% block mainbody %} 21 |
    22 |
    23 | 41 | 42 | 43 | 63 |
    64 |

    热门资源

    65 |
    66 | {% for contact in contacts %} 67 |
    68 | 69 |
    70 |
    71 |
    {{contact.title}}
    72 |
    {{contact.tcreate_time}}
    73 |
    {{contact.content}}
    74 |
    75 |
    本站 {{contact.share_name}} 2126 查看 12 使用
    76 |
    77 |
    78 | {% endfor %} 79 |
    80 | 83 |
    84 | 首页 85 | {% if contacts.has_previous %} 86 | 上一页 87 | {% endif %} 88 | 89 | {% for page_number in paginator.page_range %} 90 | {# 获取当前页的页码 #} 91 | {% if page_number == page.number %} 92 | {# 如果是当前页的话,选中 #} 93 | {{page_number}} 94 | {% else %} 95 | {{page_number}} 96 | {% endif %} 97 | {% endfor %} 98 | 99 | {% if contacts.has_next %} 100 | 下一页 101 | {% endif %} 102 |
    103 |
    104 |
    105 |
    106 | {% endblock mainbody %} 107 | 108 | 109 | -------------------------------------------------------------------------------- /templates/other/seacher.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}搜索-{{key}}{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | 6 | 7 | {% block seacher %} 8 | 20 | {% endblock seacher %} 21 | {% block mainbody %} 22 |
    23 |
    24 |
    25 |

    搜索{{key}}结果如下:   共{{num}}条

    26 |
    27 | {% for contact in contacts %} 28 |
    29 | 30 |
    31 |
    32 |
    {{contact.title}}
    33 |
    {{contact.tcreate_time}}
    34 |
    {{contact.content}}
    35 |
    36 |
    本站 {{contact.share_name}} 2126 查看 12 使用
    37 |
    38 |
    39 | {% endfor %} 40 | 41 |
    42 | 45 |
    46 | 首页 47 | {% if contacts.has_previous %} 48 | 上一页 49 | {% endif %} 50 | 51 | {% for page_number in paginator.page_range %} 52 | {# 获取当前页的页码 #} 53 | {% if page_number == page.number %} 54 | {# 如果是当前页的话,选中 #} 55 | {{page_number}} 56 | {% else %} 57 | {{page_number}} 58 | {% endif %} 59 | {% endfor %} 60 | 61 | {% if contacts.has_next %} 62 | 下一页 63 | {% endif %} 64 |
    65 |
    66 |
    67 |
    68 | {% endblock mainbody %} 69 | 70 | {% block rightb %} 71 | 110 | {% endblock rightb %} 111 | 112 | -------------------------------------------------------------------------------- /templates/blackmain/bw.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}百度网盘资源{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
    7 |
    8 | 28 |
    29 |

    热门资源

    30 |
    31 | {% for contact in contacts %} 32 |
    33 | 34 |
    35 |
    36 |
    {{contact.title}}
    37 |
    {{contact.tcreate_time}}
    38 |
    {{contact.content}}
    39 |
    40 |
    本站 {{contact.share_name}} 2126 查看 12 使用
    41 |
    42 |
    43 | {% endfor %} 44 |
    45 | 48 |
    49 | 首页 50 | {% if contacts.has_previous %} 51 | 上一页 52 | {% endif %} 53 | 54 | {% for page_number in paginator.page_range %} 55 | {# 获取当前页的页码 #} 56 | {% if page_number == page.number %} 57 | {# 如果是当前页的话,选中 #} 58 | {{page_number}} 59 | {% else %} 60 | {{page_number}} 61 | {% endif %} 62 | {% endfor %} 63 | 64 | {% if contacts.has_next %} 65 | 下一页 66 | {% endif %} 67 |
    68 |
    69 |
    70 |
    71 | {% endblock mainbody %} 72 | 73 | {% block rightb %} 74 | 113 | {% endblock rightb %} 114 | -------------------------------------------------------------------------------- /templates/blackmain/bcym.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}编程源码资源{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
    7 |
    8 | 28 |
    29 |

    热门资源

    30 |
    31 | {% for contact in contacts %} 32 |
    33 | 34 |
    35 |
    36 |
    {{contact.title}}
    37 |
    {{contact.tcreate_time}}
    38 |
    {{contact.content}}
    39 |
    40 |
    本站 {{contact.share_name}} 2126 查看 12 使用
    41 |
    42 |
    43 | {% endfor %} 44 | 45 | 46 | 47 |
    48 | 51 |
    52 | 首页 53 | {% if contacts.has_previous %} 54 | 上一页 55 | {% endif %} 56 | 57 | {% for page_number in paginator.page_range %} 58 | {# 获取当前页的页码 #} 59 | {% if page_number == page.number %} 60 | {# 如果是当前页的话,选中 #} 61 | {{page_number}} 62 | {% else %} 63 | {{page_number}} 64 | {% endif %} 65 | {% endfor %} 66 | 67 | {% if contacts.has_next %} 68 | 下一页 69 | {% endif %} 70 |
    71 |
    72 |
    73 |
    74 | {% endblock mainbody %} 75 | 76 | {% block rightb %} 77 | 116 | {% endblock rightb %} -------------------------------------------------------------------------------- /static/js/easyform.js: -------------------------------------------------------------------------------- 1 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';5(2y(1E)=="1d"){7 1E(j,L){6 f=$("#"+j).14(L);f=(!!f?f.1I(";"):1d);6 14=1u();5(!!f){6 D;1c(D 1i f){6 1x=f[D];6 p=1x.31(":");6 11=[];5(-1==p){11[0]=1x;11[1]=""}t{11[0]=1x.2r(0,p);11[1]=1x.2r(p+1)}5(11[0].A>0)14[11[0]]=11[1]}}c 14}}(7($,1g,P,1d){6 2a=7(1j,1k){3.R=1j;5(0==3.R.A&&"R"!=3.R[0].3h){2l Z 2g("1e 2m a R !")}3.1l={l:K};3.f=$.2d({},3.1l,1k);3.1H=[];3.I=[];3.S=0;3.1h=K;3.O=G;3.13=G;3.26=G};2a.29={1f:7(){6 $3=3;$3.28();3.2q=3.R.2p("h:Y");3.2q.2o(7(){6 1t=$(3);1t.1Q("W","1t");1t.1N(7(){$3.Y(K)})});c 3},28:7(){1c(6 i 1i 3.I){3.I[i].2W()}3.I.2t(0,3.I.A);6 $3=3;3.R.2p("h:2n, 3g:2n").2o(7(D,h){5(h.W!="3b"&&h.W!="1t"&&h.W!="Y"&&h.W!="3e"){5(h.W=="2x"||h.W=="2w"){6 L=h.L;1c(D 1i $3.I){5(L==$3.I[D].h[0].L){c}}}6 1K=$(h).2F({l:$3.f.l});1K.13=7(e,r){$3.1h=x;$3.1H.2s(e);5(!!$3.13)$3.13($3,e,r)};1K.O=7(e){$3.S++;5($3.S==$3.I.A){$3.S=0;5(!!$3.O)$3.O($3);5(!!$3.1h){$3.R.Y()}}};$3.I.2s(1K)}})},Y:7(Y){3.28();3.1H.2t(0,3.1H.A);3.S=0;3.1h=Y;5(3.26){3.1h=3.26(3)}5(3.I.A==0){5(!!3.O)3.O();5(3.1h){3.R.Y()}}6 D;1c(D 1i 3.I){3.I[D].1n()}}};$.22.1e=7(f){6 1n=Z 2a(3,f);c 1n.1f()}})(1Z,1g,P);(7($,1g,P,1d){6 1W=7(h,1k){5(0==h.A){2l Z 2g("1e 2m a h 3d !")}3.h=h;3.H=[];3.13=G;3.O=G;3.1l={"l":K,"1p-17":x};3.8=G;3.H=1E(h[0].j,"1e");6 o=1u();1c(6 D 1i 3.H){5(D=="l"){o["l"]=3.H[D]}t 5(D=="1p-17"){o["1p-17"]=K}}1V 3.H["l"];1V 3.H["1p-17"];3.f=$.2d({},3.1l,1k,o);3.S=0;3.1C=x};1W.29={1f:7(){5(K===3.f.l){3.8=$(3.h).l()}6 $3=3;5(!!3.H&&3.f["1p-17"]){3.h.32("2O",7(){$3.1n()})}c 3},1n:7(){3.2i=3.h.1Y();3.S=0;3.1C=x;5(3.h.1Q("W")=="2x"||3.h.1Q("W")=="2w"){6 L=3.h.1Q("L");6 v=$(\'h[L="\'+L+\'"]:34\').1Y();5(x==3.2c(3,v,3.H)){3.1q()}}t 5(x==3.2c(3,3.2i,3.H)){1c(6 D 1i 3.H){5(!!3.2k[D])3.2k[D](3,3.2i,3.H[D])}5(1u.2u(3.H).A==0){3.1q()}}},C:7(1B){5(!!3.13)3.13(3.h[0],1B);5(x==3.1C){6 U=$(3.h).14("2v-"+1B);5(!U)U=$(3.h).14("2v");U=!U?"格式错误":U;5(K===3.f.l){3.8.2A(U)}3.1C=K}c x},1q:7(){5(!!3.O)3.O(3.h);c K},E:7(1B){3.S+=1;5(3.S==1u.2u(3.H).A)3.1q();c K},2c:7(b,v,r){5(!v){5(!!r&&2y(r["G"])!="1d"){c b.1q()}t{c b.C("G")}}t{c x}},2k:{"T-25":7(b,v,p){5(x==/^\\w+$/.J(v))c b.C("T-25");t c b.E("T-25")},"T-2h":7(b,v,p){5(x==/^([\\w]|[\\3u-\\3t]|[ 。,、?¥“”‘’!:【】《》()——.,?!$\'":+-])+$/.J(v))c b.C("T-2h");t c b.E("T-2h")},"T-2f":7(b,v,p){5(x==/^([\\w]|[ .,?!$\'":+-])+$/.J(v))c b.C("T-2f");t c b.E("T-2f")},"1U":7(b,v,p){5(x==/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.J(v))c b.C("1U");t c b.E("1U")},"A":7(b,v,p){6 n=p.1I(" ");5(n.A==1)n[1]=n[0];6 1S=v.3j(/[^\\3n-\\3o]/g,"3s").A;5(1Sn[1])c b.C("A");t c b.E("A")},"20":7(b,v,p){6 1X=$(p);5(0==1X.A||1X.1Y()!=v)c b.C("20");t c b.E("20")},"1m":7(b,v,p){b.h.3p("","1e-1m",7(e,p){b.h.1L("1e-1m");5(x==p)c b.C("1m");t c b.E("1m")});3q(p)},"27":7(b,v,p){5(x==/^(\\d{4})-(\\d{2})-(\\d{2})$/.J(v))c b.C("27");t c b.E("27")},"17":7(b,v,p){5(x==/^(\\d{2}):(\\d{2}):(\\d{2})$/.J(v))c b.C("17");t c b.E(v)},"2j":7(b,v,p){5(x==/^(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})$/.J(v))c b.C("2j");t c b.E("2j")},"1T":7(b,v,p){5(x==/^([1-9][\\d]{0,10}|0)(\\.[\\d]{1,2})?$/.J(v))c b.C("1T");t c b.E("1T")},"24":7(b,v,p){5(x==/^\\d{1,}$/.J(v))c b.C("24");t c b.E("24")},"1o":7(b,v,p){6 n=p.1I(" ");5(n.A!=2){c b.C("1o")}t 5(n[0]+n[1]>16){2V.2T("您的"+b.h.j+"1o规则配置可能不正确!请保证整数位数+小数位数 < 16")}6 1D=Z 2R("^([1-9][\\\\d]{0,"+n[0]+"}|0)(\\\\.[\\\\d]{1,"+n[1]+"})?$");5(x==1D.J(v))c b.C("1o");t c b.E("1o")},"1R":7(b,v,p){v=18(v);6 n=p.2X().1I(" ");5(""==p.2X()){2V.2T("您的"+b.h.j+"1R规则,没有设置值域!");n[0]=0}5(n.A==1){n[1]=3k}n[0]=18(n[0]);n[1]=18(n[1]);5(1J(v)||1J(n[0])||1J(n[1])||vn[1]||v<0)c b.C("1R");t c b.E("1R")},"23":7(b,v,p){6 1D=Z 2R(p);5(x==1D.J(v))c b.C("23");t c b.E("23")}},2W:7(){3.13=G;3.O=G;3.h.3r("2O");1V 3}};$.22.2F=7(f){6 2z=Z 1W(3,f);c 2z.1f()}})(1Z,1g,P);(7($,1g,P,1d){6 21=7(1j,1k){3.B=1j;5(0==3.B.A){2l Z 2g("l\'s 3l G !")}3.1l={q:0,u:0,1F:"1z",M:"2e",V:"3m",1P:"3B-3v",k:"1y",1r:G,F:G};3.1G=1u();6 14=1E(1j[0].j,"l");3.f=$.2d({},3.1l,1k,14);3.j="l-15-3w-"+1j[0].j};21.29={1f:7(){6 8=$("#"+3.j);5(8.A==0){$(P.3C).2I("<15 j=\\""+3.j+"\\"><15 1P=\\"l-y\\">");8=$("#"+3.j);6 y=$("#"+3.j+" .l-y");8.m({"y-2L":"q","3y":"3x","1F":"2K","z-D":3z});y.m({"y-2L":"q","2J":"2N","3A-1a":"3i"});8.2I("<15 1P=\\"l-k\\">");6 k=$("#"+3.j+" .l-k");k.m({"2J":"0","37":"0","1a":"0","1w":"0","1F":"2K","19":"2N 35"})}c 3},2C:7(){6 B=3.B;6 8=$("#"+3.j);5(8.1a()>2M){8.1a(2M)}},2D:7(){6 8=$("#"+3.j);6 y=$("#"+3.j+" .l-y");6 k=$("#"+3.j+" .l-k");y.2Y(3.f.1P);k.m("19-1v","1O 1O 1O 1O");8.m("2H-2Z","30-2H")},2P:7(){6 8=$("#"+3.j);6 y=$("#"+3.j+" .l-y");6 k=$("#"+3.j+" .l-k");2B(3.f.k){12"u":k.m({"q":"2G","u":-k.Q(),"19-1y-1v":y.m("1M")});X;12"q":k.m({"q":-k.1b(),"u":8.2b()/2-k.Q()/2,"19-1z-1v":y.m("1M")});X;12"1y":k.m({"q":"2G","u":8.2b(),"19-u-1v":y.m("1M")});X;12"1z":k.m({"q":8.1b(),"u":8.2b()/2-k.Q()/2,"19-q-1v":y.m("1M")});X}},2E:7(){6 8=$("#"+3.j);6 y=$("#"+3.j+" .l-y");6 k=$("#"+3.j+" .l-k");6 N=$(3.B).N();6 1A={1a:$(3.B).1b(),1w:$(3.B).Q()};2B(3.f.1F){12"u":8.m("q",N.q);8.m("u",N.u-8.Q()-k.Q()/2);3.f.k="1y";X;12"q":8.m("q",N.q-8.1b()-k.1b()/2);8.m("u",N.u-(8.Q()-1A.1w)/2);3.f.k="1z";X;12"1y":8.m("q",N.q);8.m("u",N.u+1A.1w+k.Q()/2);3.f.k="u";X;12"1z":8.m("q",N.q+1A.1a+k.1b()/2);8.m("u",N.u-(8.Q()-1A.1w)/2);3.f.k="q";X}6 q=18(8.m("q"));6 u=18(8.m("u"));8.m("q",18(3.f.q)+q);8.m("u",18(3.f.u)+u)},2A:7(U){6 8=$("#"+3.j);6 y=$("#"+3.j+" .l-y");6 k=$("#"+3.j+" .l-k");6 V=3.f.V;6 M=3.f.M;6 B=3.B;y.3c(U);3.2C();3.2D();3.2E();3.2P();6 $3=3;6 1r=3.f.1r;6 F=3.f.F;8.38(V,7(){5(!!1r)1r(B,8[0]);5(!1J(M)){39(7(){8.1s(V,7(){5(!!F)F(B,8[0])})},M)}t 5(M=="2U"||M=="2e"){$(P).3a(\'1N\',$3.1G[8[0].j]=7(e){5(M=="2U"&&e.2Q==y[0]){8.1s(V,7(){5(!!F)F(B,8[0]);$(P).1L("1N",$3.1G[8[0].j])})}t 5(M=="2e"&&e.2Q!=8[0]){8.1s(V,7(){5(!!F)F(B,8[0]);$(P).1L("1N",$3.1G[8[0].j])})}})}t 5(M=="3f-36"){$(B).2S(7(){8.1s(V,7(){5(!!F)F(B,8[0]);$(B).1L("2S")})})}})},33:7(){6 8=$("#"+3.j);6 B=3.B;6 F=3.f.F;8.1s(3.f.V,7(){5(!!F)F(B,8[0])})}};$.22.l=7(f){6 8=Z 21(3,f);c 8.1f()}})(1Z,1g,P);',62,225,'|||this||if|var|function|tip|||ei|return|||options||input||id|arrow|easytip|css|range|||left|||else|top|||false|text||length|parent|_error|index|_success_rule|onclose|null|rules|inputs|test|true|name|disappear|offset|success|document|outerHeight|form|counter|char|msg|speed|type|break|submit|new||temp|case|error|data|div||time|parseInt|border|width|outerWidth|for|undefined|easyform|init|window|is_submit|in|ele|opt|defaults|ajax|validation|float|real|_success|onshow|fadeOut|button|Object|color|height|temps|bottom|right|size|rule|is_error|pattern|easy_load_options|position|_fun_cache|result|split|isNaN|checker|unbind|borderTopColor|click|transparent|class|attr|uint|len|money|email|delete|_easyinput|pair|val|jQuery|equal|_easytip|fn|regex|number|normal|per_validation|date|_load|prototype|_easyform|innerHeight|_null|extend|other|english|Error|chinese|value|datetime|judge|throw|need|visible|each|find|submit_button|substring|push|splice|keys|message|checkbox|radio|typeof|check|show|switch|_size|_css|_position|easyinput|25px|box|append|padding|absolute|align|300|10px|blur|_arrow|target|RegExp|focusout|warn|self|console|destructor|trim|addClass|sizing|content|indexOf|on|close|checked|solid|focus|margin|fadeIn|setTimeout|bind|hidden|html|object|file|lost|textarea|localName|120px|replace|999999999999999|is|fast|x00|xff|delegate|eval|off|aa|u9fa5|u4e00|white|main|none|display|9000|min|easy|body'.split('|'),0,{})) -------------------------------------------------------------------------------- /black/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from black.models import Posts 3 | from black.models import Comment 4 | from black.models import Information 5 | from black.models import Img 6 | from black.models import Answer 7 | from django.http import JsonResponse 8 | from django.core.paginator import Paginator , PageNotAnInteger,EmptyPage 9 | # Create your views here. 10 | 11 | def index(request): 12 | info = Information.objects.filter(receive_name=request.session['username'], read_sure=False) 13 | contact_list = Posts.objects.all().order_by("-create_time") 14 | paginator = Paginator(contact_list,7) # Show 25 contacts per page 15 | 16 | page = request.GET.get('page','1') 17 | try: 18 | contacts = paginator.page(page) 19 | except PageNotAnInteger: 20 | # If page is not an integer, deliver first page. 21 | contacts = paginator.page(1) 22 | except EmptyPage: 23 | # If page is out of range (e.g. 9999), deliver last page of results. 24 | contacts = paginator.page(paginator.num_pages) 25 | 26 | return render(request,'blackmain/index.html',{'contacts': contacts,'paginator':paginator}) 27 | 28 | def gooodclass(request): 29 | contact_list = Posts.objects.all().order_by("-create_time") 30 | paginator = Paginator(contact_list, 12) # Show 25 contacts per page 31 | 32 | page = request.GET.get('page', '1') 33 | try: 34 | contacts = paginator.page(page) 35 | except PageNotAnInteger: 36 | # If page is not an integer, deliver first page. 37 | contacts = paginator.page(1) 38 | except EmptyPage: 39 | # If page is out of range (e.g. 9999), deliver last page of results. 40 | contacts = paginator.page(paginator.num_pages) 41 | 42 | if len(contacts)>=4 and len(contacts)<8: 43 | list1=[contacts[0],contacts[1],contacts[2],contacts[3]] 44 | elif len(contacts)>=8 and len(contacts)<12: 45 | list1 = [contacts[0], contacts[1], contacts[2], contacts[3]] 46 | list2 = [contacts[4], contacts[5], contacts[6], contacts[7]] 47 | elif len(contacts)>=12: 48 | list1 = [contacts[0], contacts[1], contacts[2], contacts[3]] 49 | list2 = [contacts[4], contacts[5], contacts[6], contacts[7]] 50 | list3 = [contacts[8], contacts[9], contacts[10], contacts[11]] 51 | else: 52 | list1 = [contacts[0], contacts[1], contacts[2], contacts[3]] 53 | print(len(list1)) 54 | return render(request, 'blackmain/goodclass.html', {'contacts': contacts, 'paginator': paginator,'list1':list1,'list2':list2,'list3':list3}) 55 | 56 | 57 | def bw(request): 58 | contact_list = Posts.objects.filter(source_type="百度网盘教程").order_by("-create_time") 59 | paginator = Paginator(contact_list, 7) # Show 25 contacts per page 60 | 61 | page = request.GET.get('page', '1') 62 | try: 63 | contacts = paginator.page(page) 64 | except PageNotAnInteger: 65 | # If page is not an integer, deliver first page. 66 | contacts = paginator.page(1) 67 | except EmptyPage: 68 | # If page is out of range (e.g. 9999), deliver last page of results. 69 | contacts = paginator.page(paginator.num_pages) 70 | 71 | return render(request, 'blackmain/bw.html', {'contacts': contacts, 'paginator': paginator}) 72 | 73 | def bcym(request): 74 | contact_list = Posts.objects.filter(source_type="开源源码").order_by("-create_time") 75 | paginator = Paginator(contact_list, 7) # Show 25 contacts per page 76 | 77 | page = request.GET.get('page', '1') 78 | try: 79 | contacts = paginator.page(page) 80 | except PageNotAnInteger: 81 | # If page is not an integer, deliver first page. 82 | contacts = paginator.page(1) 83 | except EmptyPage: 84 | # If page is out of range (e.g. 9999), deliver last page of results. 85 | contacts = paginator.page(paginator.num_pages) 86 | 87 | return render(request, 'blackmain/bcym.html', {'contacts': contacts, 'paginator': paginator}) 88 | 89 | def answer(request): 90 | answer_list=Answer.objects.all().order_by("-question_time") 91 | print (answer_list) 92 | return render(request,'blackmain/answer.html',{'answer':answer_list}) 93 | 94 | 95 | def getcoin(request): 96 | if request.method == "GET": 97 | zy_comment = Comment.objects.filter(source_id=111111) 98 | context = { 99 | 'zy_comment': zy_comment, 100 | } 101 | print(zy_comment) 102 | return render(request, 'blackmain/getcoin.html', context) 103 | else: 104 | return JsonResponse({'res': "无此页面"}) 105 | 106 | 107 | def enjoy(request): 108 | return render(request,'blackmain/enjoy.html') 109 | 110 | def vip(request): 111 | 112 | return render(request,'blackmain/vip.html') 113 | 114 | def posts(request): 115 | if request.method=="POST": 116 | title = request.POST.get('title') 117 | content = request.POST.get('sourcedsp') 118 | source_bgurl = request.POST.get('source_bgurl') 119 | source_psw = request.POST.get('source_psw') 120 | source_valuemarks = request.POST.get('sourcevalue') 121 | source_type = request.POST.get('source_type') 122 | share_name = request.POST.get('share_name') 123 | try: 124 | passport = Posts(title=title,content=content,source_picurl="11",source_psw=source_psw,source_bgurl=source_bgurl,source_valuemarks=source_valuemarks,source_type=source_type,share_name=share_name) 125 | passport.save() 126 | new_img = Img( 127 | img=request.FILES.get('sourceimg'), 128 | wpurl=source_bgurl 129 | ) 130 | new_img.save() 131 | 132 | except Exception as e: 133 | print("e: ", e) # 把异常打印出来 134 | return render(request, 'blackmain/enjoy.html') 135 | else: 136 | return render(request,'users/user_center_info.html') 137 | 138 | 139 | def comment(request): 140 | if request.method=="POST": 141 | comment_sourcename=request.POST.get('comment_sourcename') 142 | source_id = request.POST.get('source_id') 143 | source_name = request.POST.get('source_name') 144 | comment_content = request.POST.get('comment_content') 145 | comment_name = request.POST.get('comment_name') 146 | info_tx=comment_name+"评论你的:"+comment_sourcename+" 资源"+comment_content 147 | try: 148 | passport = Comment(comment_sourcename=comment_sourcename, source_id=source_id,comment_content=comment_content,comment_name=comment_name) 149 | passport.save() 150 | 151 | info = Information(info_content=info_tx,receive_name=comment_sourcename, send_name=comment_name) 152 | info.save() 153 | 154 | except Exception as e: 155 | print("e: ", e) # 把异常打印出来 156 | return JsonResponse({'res': 1, 'errmsg': 'failed'}) 157 | 158 | return JsonResponse({'res': 0, 'errmsg': 'success'}) 159 | else: 160 | return JsonResponse({'res': 1, 'errmsg': 'failed'}) 161 | 162 | def question(request): 163 | if request.method=="POST": 164 | tw_name=request.POST.get("twname") 165 | twcontent=request.POST.get('twcontent') 166 | try: 167 | tw = Answer(question_name=tw_name, question_content=twcontent) 168 | tw.save() 169 | except Exception as e: 170 | print("e: ", e) # 把异常打印出来 171 | return JsonResponse({'res': 1, 'errmsg': '提交失败'}) 172 | return JsonResponse({'res': 0, 'errmsg': '提交成功'}) 173 | else: 174 | return JsonResponse({'res': 4, 'errmsg': '请求错误'}) 175 | -------------------------------------------------------------------------------- /templates/blackmain/enjoy.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}分享资源{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
    7 |
    8 |
    9 |

    分享资源

    10 |
    11 | {% csrf_token %} 12 |
    13 |
    14 | 15 | 16 |
    17 |
    18 | 19 | 20 |
    21 |
    22 |
    23 |
    24 | 25 | 26 |
    27 |
    28 | 29 | 34 |
    35 | 36 |
    37 |
    38 |
    39 | 40 | 41 |
    42 |
    43 | 44 | 45 |
    46 |
    47 | 48 |
    49 | 50 | 56 |
    57 |
    58 |
    59 | 101 |
    102 |
    103 | {% endblock mainbody %} 104 | 105 | {% block rightb %} 106 | 145 | {% endblock rightb %} 146 | 147 | -------------------------------------------------------------------------------- /templates/blackmain/answer.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}有问必答{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | {% block mainbody %} 5 |
    6 |
    7 |
    8 |

    有问必答

    9 |
    10 | {% csrf_token %} 11 |
    12 |
    13 | 14 | 20 |
    21 |
    22 |
    23 |
      24 | {% for question in answer %} 25 |
    • {{question.question_name}} ({{question.question_time}}) 提问:
      26 | {{question.question_content}}
    • 27 | {% endfor %} 28 |
    29 |
    30 |
    31 | 71 |
    72 |

    热门提问

    73 |
    74 |
    75 |
    76 |
    77 |
    如何获取B币
    78 |
    2019-4-1
    79 |
    获取B币有多种方法,查看获取B币即可看到
    80 |
    81 |
    本站 jjl 2126 阅览 12 使用
    82 |
    83 |
    84 |
    85 |
    86 |
    87 |
    关于vip购买
    88 |
    2019-4-1
    89 |
    购买vip即可终身下载本站所有资源
    90 |
    91 |
    本站 jj林 2126 阅览 3 使用
    92 |
    93 |
    94 | 95 | 96 |
    97 | 98 |
    首页上一页12下一页尾页
    99 |
    100 |
    101 |
    102 | {% endblock mainbody %} 103 | 104 | {% block rightb %} 105 | 136 | {% endblock rightb %} 137 | 138 | -------------------------------------------------------------------------------- /templates/users/user_info.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}用户中心{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
    7 |
    8 | 19 |
    20 |

    21 | 发表资源({{zynum}}) 22 |     B币数({{user_info.user_allmarks}}) 23 |     消息({{info_num}}) 24 |     学习群(0) 25 |

    26 |
    27 |
    28 | {%for x in info %} 29 | {% if x.read_sure %} 30 | 31 |

    32 | {{x.info_content}} 33 |

    34 |

    35 | {{x.send_time}} 36 |

    37 |
    38 | {%else%} 39 | 40 |

    41 | {{x.info_content}} 42 |

    43 |

    44 | {{x.send_time}} 45 | 46 |

    47 |
    48 | {%endif%} 49 | {% endfor %} 50 |
    51 |
    52 | 55 | 56 |
    57 |
    58 |

    基本资料

    59 |
    60 | {% csrf_token %} 61 |
    62 |
    63 | 64 |
    65 |
    66 | 67 | 68 |
    69 |
    70 |
    71 |
    72 | 73 | 74 |
    75 |
    76 |
    77 | 78 | 84 |
    85 | 86 |
    87 |
    88 |
    89 | 130 | {% endblock mainbody %} 131 | 132 | {% block rightb %} 133 | 164 | 165 | {% endblock rightb %} 166 | -------------------------------------------------------------------------------- /templates/users/user_center_info.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}用户中心{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 | 7 |
    8 |
    9 | 20 |
    21 |

    22 | 发表资源({{zynum}}) 23 |     B币数({{user_info.user_allmarks}}) 24 |     消息({{info_num}}) 25 |     学习群(0) 26 |

    27 |
    28 | {% for contact in contacts %} 29 |
    30 | 31 |
    32 |
    33 |
    {{contact.title}}
    34 |
    {{contact.create_time}}
    35 |
    {{contact.content}}
    36 |
    37 |
    本站{{contact.share_name}}{{contact.click_nums}} 查看 {{contact.load_nums}} 使用
    38 |
    39 |
    40 | {% endfor %} 41 | 44 |
    45 |
    46 | 首页 47 | {% if contacts.has_previous %} 48 | 上一页 49 | {% endif %} 50 | 51 | {% for page_number in paginator.page_range %} 52 | {# 获取当前页的页码 #} 53 | {% if page_number == page.number %} 54 | {# 如果是当前页的话,选中 #} 55 | {{page_number}} 56 | {% else %} 57 | {{page_number}} 58 | {% endif %} 59 | {% endfor %} 60 | 61 | {% if contacts.has_next %} 62 | 下一页 63 | {% endif %} 64 |
    65 |
    66 |
    67 |

    基本资料

    68 |
    69 | {% csrf_token %} 70 |
    71 |
    72 | 73 |
    74 |
    75 | 76 | 77 |
    78 |
    79 |
    80 |
    81 | 82 | 83 |
    84 |
    85 |
    86 | 87 | 93 |
    94 |
    95 | 96 |
    97 |
    98 |
    99 | 141 | {% endblock mainbody %} 142 | {% block rightb %} 143 | 174 | {% endblock rightb %} 175 | -------------------------------------------------------------------------------- /static/js/nprogress.js: -------------------------------------------------------------------------------- 1 | ;(function(root, factory) { 2 | 3 | if (typeof define === 'function' && define.amd) { 4 | define(factory); 5 | } else if (typeof exports === 'object') { 6 | module.exports = factory(); 7 | } else { 8 | root.NProgress = factory(); 9 | } 10 | 11 | })(this, function() { 12 | var NProgress = {}; 13 | 14 | NProgress.version = '0.2.0'; 15 | 16 | var Settings = NProgress.settings = { 17 | minimum: 0.08, 18 | easing: 'ease', 19 | positionUsing: '', 20 | speed: 200, 21 | trickle: true, 22 | trickleRate: 0.02, 23 | trickleSpeed: 800, 24 | showSpinner: true, 25 | barSelector: '[role="bar"]', 26 | spinnerSelector: '[role="spinner"]', 27 | parent: 'body', 28 | template: '
    ' 29 | }; 30 | NProgress.configure = function(options) { 31 | var key, value; 32 | for (key in options) { 33 | value = options[key]; 34 | if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; 35 | } 36 | 37 | return this; 38 | }; 39 | NProgress.status = null; 40 | NProgress.set = function(n) { 41 | var started = NProgress.isStarted(); 42 | 43 | n = clamp(n, Settings.minimum, 1); 44 | NProgress.status = (n === 1 ? null : n); 45 | 46 | var progress = NProgress.render(!started), 47 | bar = progress.querySelector(Settings.barSelector), 48 | speed = Settings.speed, 49 | ease = Settings.easing; 50 | 51 | progress.offsetWidth; 52 | 53 | queue(function(next) { 54 | if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); 55 | 56 | css(bar, barPositionCSS(n, speed, ease)); 57 | 58 | if (n === 1) { 59 | css(progress, { 60 | transition: 'none', 61 | opacity: 1 62 | }); 63 | progress.offsetWidth; 64 | 65 | setTimeout(function() { 66 | css(progress, { 67 | transition: 'all ' + speed + 'ms linear', 68 | opacity: 0 69 | }); 70 | setTimeout(function() { 71 | NProgress.remove(); 72 | next(); 73 | }, speed); 74 | }, speed); 75 | } else { 76 | setTimeout(next, speed); 77 | } 78 | }); 79 | 80 | return this; 81 | }; 82 | 83 | NProgress.isStarted = function() { 84 | return typeof NProgress.status === 'number'; 85 | }; 86 | NProgress.start = function() { 87 | if (!NProgress.status) NProgress.set(0); 88 | 89 | var work = function() { 90 | setTimeout(function() { 91 | if (!NProgress.status) return; 92 | NProgress.trickle(); 93 | work(); 94 | }, Settings.trickleSpeed); 95 | }; 96 | 97 | if (Settings.trickle) work(); 98 | 99 | return this; 100 | }; 101 | NProgress.done = function(force) { 102 | if (!force && !NProgress.status) return this; 103 | 104 | return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); 105 | }; 106 | 107 | NProgress.inc = function(amount) { 108 | var n = NProgress.status; 109 | 110 | if (!n) { 111 | return NProgress.start(); 112 | } else { 113 | if (typeof amount !== 'number') { 114 | amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 115 | } 116 | 117 | n = clamp(n + amount, 0, 0.994); 118 | return NProgress.set(n); 119 | } 120 | }; 121 | 122 | NProgress.trickle = function() { 123 | return NProgress.inc(Math.random() * Settings.trickleRate); 124 | }; 125 | 126 | (function() { 127 | var initial = 0, current = 0; 128 | 129 | NProgress.promise = function($promise) { 130 | if (!$promise || $promise.state() === "resolved") { 131 | return this; 132 | } 133 | 134 | if (current === 0) { 135 | NProgress.start(); 136 | } 137 | 138 | initial++; 139 | current++; 140 | 141 | $promise.always(function() { 142 | current--; 143 | if (current === 0) { 144 | initial = 0; 145 | NProgress.done(); 146 | } else { 147 | NProgress.set((initial - current) / initial); 148 | } 149 | }); 150 | 151 | return this; 152 | }; 153 | 154 | })(); 155 | 156 | NProgress.render = function(fromStart) { 157 | if (NProgress.isRendered()) return document.getElementById('nprogress'); 158 | 159 | addClass(document.documentElement, 'nprogress-busy'); 160 | 161 | var progress = document.createElement('div'); 162 | progress.id = 'nprogress'; 163 | progress.innerHTML = Settings.template; 164 | 165 | var bar = progress.querySelector(Settings.barSelector), 166 | perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), 167 | parent = document.querySelector(Settings.parent), 168 | spinner; 169 | 170 | css(bar, { 171 | transition: 'all 0 linear', 172 | transform: 'translate3d(' + perc + '%,0,0)' 173 | }); 174 | 175 | if (!Settings.showSpinner) { 176 | spinner = progress.querySelector(Settings.spinnerSelector); 177 | spinner && removeElement(spinner); 178 | } 179 | 180 | if (parent != document.body) { 181 | addClass(parent, 'nprogress-custom-parent'); 182 | } 183 | 184 | parent.appendChild(progress); 185 | return progress; 186 | }; 187 | 188 | NProgress.remove = function() { 189 | removeClass(document.documentElement, 'nprogress-busy'); 190 | removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); 191 | var progress = document.getElementById('nprogress'); 192 | progress && removeElement(progress); 193 | }; 194 | 195 | NProgress.isRendered = function() { 196 | return !!document.getElementById('nprogress'); 197 | }; 198 | 199 | 200 | NProgress.getPositioningCSS = function() { 201 | 202 | var bodyStyle = document.body.style; 203 | 204 | var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : 205 | ('MozTransform' in bodyStyle) ? 'Moz' : 206 | ('msTransform' in bodyStyle) ? 'ms' : 207 | ('OTransform' in bodyStyle) ? 'O' : ''; 208 | 209 | if (vendorPrefix + 'Perspective' in bodyStyle) { 210 | return 'translate3d'; 211 | } else if (vendorPrefix + 'Transform' in bodyStyle) { 212 | return 'translate'; 213 | } else { 214 | return 'margin'; 215 | } 216 | }; 217 | 218 | function clamp(n, min, max) { 219 | if (n < min) return min; 220 | if (n > max) return max; 221 | return n; 222 | } 223 | 224 | function toBarPerc(n) { 225 | return (-1 + n) * 100; 226 | } 227 | 228 | 229 | function barPositionCSS(n, speed, ease) { 230 | var barCSS; 231 | 232 | if (Settings.positionUsing === 'translate3d') { 233 | barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; 234 | } else if (Settings.positionUsing === 'translate') { 235 | barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; 236 | } else { 237 | barCSS = { 'margin-left': toBarPerc(n)+'%' }; 238 | } 239 | 240 | barCSS.transition = 'all '+speed+'ms '+ease; 241 | 242 | return barCSS; 243 | } 244 | var queue = (function() { 245 | var pending = []; 246 | 247 | function next() { 248 | var fn = pending.shift(); 249 | if (fn) { 250 | fn(next); 251 | } 252 | } 253 | 254 | return function(fn) { 255 | pending.push(fn); 256 | if (pending.length == 1) next(); 257 | }; 258 | })(); 259 | var css = (function() { 260 | var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], 261 | cssProps = {}; 262 | 263 | function camelCase(string) { 264 | return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { 265 | return letter.toUpperCase(); 266 | }); 267 | } 268 | 269 | function getVendorProp(name) { 270 | var style = document.body.style; 271 | if (name in style) return name; 272 | 273 | var i = cssPrefixes.length, 274 | capName = name.charAt(0).toUpperCase() + name.slice(1), 275 | vendorName; 276 | while (i--) { 277 | vendorName = cssPrefixes[i] + capName; 278 | if (vendorName in style) return vendorName; 279 | } 280 | 281 | return name; 282 | } 283 | 284 | function getStyleProp(name) { 285 | name = camelCase(name); 286 | return cssProps[name] || (cssProps[name] = getVendorProp(name)); 287 | } 288 | 289 | function applyCss(element, prop, value) { 290 | prop = getStyleProp(prop); 291 | element.style[prop] = value; 292 | } 293 | 294 | return function(element, properties) { 295 | var args = arguments, 296 | prop, 297 | value; 298 | 299 | if (args.length == 2) { 300 | for (prop in properties) { 301 | value = properties[prop]; 302 | if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); 303 | } 304 | } else { 305 | applyCss(element, args[1], args[2]); 306 | } 307 | } 308 | })(); 309 | 310 | function hasClass(element, name) { 311 | var list = typeof element == 'string' ? element : classList(element); 312 | return list.indexOf(' ' + name + ' ') >= 0; 313 | } 314 | 315 | function addClass(element, name) { 316 | var oldList = classList(element), 317 | newList = oldList + name; 318 | 319 | if (hasClass(oldList, name)) return; 320 | element.className = newList.substring(1); 321 | } 322 | 323 | function removeClass(element, name) { 324 | var oldList = classList(element), 325 | newList; 326 | 327 | if (!hasClass(element, name)) return; 328 | newList = oldList.replace(' ' + name + ' ', ' '); 329 | 330 | element.className = newList.substring(1, newList.length - 1); 331 | } 332 | function classList(element) { 333 | return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); 334 | } 335 | function removeElement(element) { 336 | element && element.parentNode && element.parentNode.removeChild(element); 337 | } 338 | 339 | return NProgress; 340 | }); 341 | 342 | -------------------------------------------------------------------------------- /templates/blackmain/goodclass.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}精品资源{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 |
    7 |
    8 | 56 | 57 | 87 | 88 | 89 |
    90 |
    91 | 首页 92 | {% if contacts.has_previous %} 93 | 上一页 94 | {% endif %} 95 | 96 | {% for page_number in paginator.page_range %} 97 | {# 获取当前页的页码 #} 98 | {% if page_number == page.number %} 99 | {# 如果是当前页的话,选中 #} 100 | {{page_number}} 101 | {% else %} 102 | {{page_number}} 103 | {% endif %} 104 | {% endfor %} 105 | 106 | {% if contacts.has_next %} 107 | 下一页 108 | {% endif %} 109 |
    110 |
    111 |
    112 |
    113 | {% endblock mainbody %} 114 | 115 | {% block rightb %} 116 | 155 | {% endblock rightb %} 156 | -------------------------------------------------------------------------------- /templates/other/contentzy.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}分享资源{% endblock title %} 3 | {% block fdnav %}{% endblock fdnav %} 4 | 5 | {% block mainbody %} 6 | 7 |
    8 |
    9 | 26 | 50 | 90 |
    91 |

    评论

    92 |
    93 | {% csrf_token %} 94 |
    95 |
    96 | 97 | 98 | 99 | 100 | 101 | 107 |
    108 |
    109 |
    110 |
      111 | {% for comment in zy_comment%} 112 |
    • {{comment.comment_name}} ({{comment.comment_time}}) 说:
      113 | {{comment.comment_content}}
    • 114 | {% endfor %} 115 |
    116 |
    117 |
    118 | 119 |
    120 |
    121 | {% endblock mainbody %} 122 | 123 | {% block rightb %} 124 | 155 | 200 | 201 | {% endblock rightb %} 202 | 203 | --------------------------------------------------------------------------------