├── README.md
├── mysql数据库
└── haha.sql
├── 关于系统.txt
└── 项目源码
├── ml-100k-data
├── MovieGenre3.csv
├── hhhh.csv
├── ratings.csv
└── rrtotaltable.csv
└── movierecommend
├── .idea
├── django_auth_example.iml
├── encodings.xml
├── misc.xml
├── modules.xml
└── workspace.xml
├── __pycache__
└── models.cpython-36.pyc
├── django_auth_example
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ ├── settings.cpython-36.pyc
│ ├── urls.cpython-36.pyc
│ └── wsgi.cpython-36.pyc
├── settings.py
├── urls.py
└── wsgi.py
├── manage.py
├── models.py
├── requirements.txt
├── templates
├── base.html
├── index.html
└── users
│ └── 3.jpg
└── users
├── __init__.py
├── __pycache__
├── __init__.cpython-36.pyc
├── admin.cpython-36.pyc
├── forms.cpython-36.pyc
├── models.cpython-36.pyc
├── urls.cpython-36.pyc
└── views.cpython-36.pyc
├── admin.py
├── apps.py
├── forms.py
├── migrations
├── 0001_initial.py
├── 0002_auto_20211229_1513.py
├── __init__.py
└── __pycache__
│ ├── 0001_initial.cpython-36.pyc
│ ├── 0002_auto_20211229_1513.cpython-36.pyc
│ └── __init__.cpython-36.pyc
├── models.py
├── static
├── css
│ ├── Test.css
│ ├── bootstrap.css
│ ├── bootstrap.min.css
│ ├── demo.css
│ ├── firstPage.css
│ ├── main.css
│ └── star.css
├── img
│ ├── DaoMeng.JPG
│ ├── GaoYang.JPG
│ ├── HuiHun.JPG
│ ├── LostMan.JPG
│ ├── Orphan.JPG
│ ├── Seven.JPG
│ ├── ZhaoHun.JPG
│ ├── action
│ │ ├── 103776.jpg
│ │ ├── 105859.jpg
│ │ ├── 113189.jpg
│ │ ├── 1229238.jpg
│ │ ├── 1298650.jpg
│ │ ├── 145487.jpg
│ │ ├── 2186715.jpg
│ │ ├── 3540136.jpg
│ │ ├── 3672840.jpg
│ │ ├── 371746.jpg
│ │ ├── 4276752.jpg
│ │ ├── 4324274.jpg
│ │ ├── 434409.jpg
│ │ ├── 4600952.jpg
│ │ ├── 499549.jpg
│ │ ├── 5481184.jpg
│ │ └── 77869.jpg
│ ├── animation
│ │ ├── 110357.jpg
│ │ ├── 113198.jpg
│ │ ├── 114709.jpg
│ │ ├── 118829.jpg
│ │ ├── 120794.jpg
│ │ ├── 126029.jpg
│ │ ├── 129167.jpg
│ │ ├── 1323594.jpg
│ │ ├── 230011.jpg
│ │ ├── 245429.jpg
│ │ ├── 266543.jpg
│ │ ├── 29583.jpg
│ │ ├── 3781476.jpg
│ │ ├── 3919322.jpg
│ │ ├── 396555.jpg
│ │ ├── 441773.jpg
│ │ ├── 4644382.jpg
│ │ ├── 4692656.jpg
│ │ └── 892782.jpg
│ ├── cancel-custom-off.png
│ ├── cancel-custom-on.png
│ ├── cancel-off-big.png
│ ├── cancel-on-big.png
│ ├── comedy
│ │ ├── 110201.jpg
│ │ ├── 1109624.jpg
│ │ ├── 1187043.jpg
│ │ ├── 118799.jpg
│ │ ├── 1372692.jpg
│ │ ├── 1675434.jpg
│ │ ├── 188766.jpg
│ │ ├── 2245084.jpg
│ │ ├── 2414370.jpg
│ │ ├── 2459022.jpg
│ │ ├── 356910.jpg
│ │ ├── 362227.jpg
│ │ ├── 373074.jpg
│ │ ├── 3863552.jpg
│ │ ├── 5061814.jpg
│ │ ├── 5157018.jpg
│ │ └── 5290882.jpg
│ ├── crime
│ │ ├── 1067920.jpg
│ │ ├── 110413.jpg
│ │ ├── 111161.jpg
│ │ ├── 114369.jpg
│ │ ├── 1160629.jpg
│ │ ├── 137494.jpg
│ │ ├── 1527788.jpg
│ │ ├── 209144.jpg
│ │ ├── 216165.jpg
│ │ ├── 2165735.jpg
│ │ ├── 2267998.jpg
│ │ ├── 2820852.jpg
│ │ ├── 2990738.jpg
│ │ ├── 338564.jpg
│ │ ├── 386651.jpg
│ │ ├── 439884.jpg
│ │ ├── 4701702.jpg
│ │ └── 92263.jpg
│ ├── drama
│ │ ├── 1028532.jpg
│ │ ├── 110081.jpg
│ │ ├── 120382.jpg
│ │ ├── 1285016.jpg
│ │ ├── 1393746.jpg
│ │ ├── 1410063.jpg
│ │ ├── 166924.jpg
│ │ ├── 1670345.jpg
│ │ ├── 167404.jpg
│ │ ├── 1707386.jpg
│ │ ├── 2582802.jpg
│ │ ├── 405094.jpg
│ │ ├── 454876.jpg
│ │ ├── 458352.jpg
│ │ ├── 480249.jpg
│ │ └── 73486.jpg
│ ├── love
│ │ ├── 1010048.jpg
│ │ ├── 1055300.jpg
│ │ ├── 106332.jpg
│ │ ├── 109830.jpg
│ │ ├── 1099212.jpg
│ │ ├── 1194664.jpg
│ │ ├── 120338.jpg
│ │ ├── 1554523.jpg
│ │ ├── 1859438.jpg
│ │ ├── 2036416.jpg
│ │ ├── 211915.jpg
│ │ ├── 3043630.jpg
│ │ ├── 428870.jpg
│ │ ├── 808357.jpg
│ │ ├── 817177.jpg
│ │ ├── 93978.jpg
│ │ └── 99487.jpg
│ ├── science
│ │ ├── 1190080.jpg
│ │ ├── 1260502.jpg
│ │ ├── 1305797.jpg
│ │ ├── 133093.jpg
│ │ ├── 1375666.jpg
│ │ ├── 1454468.jpg
│ │ ├── 1631867.jpg
│ │ ├── 182789.jpg
│ │ ├── 1877832.jpg
│ │ ├── 2866360.jpg
│ │ ├── 2872732.jpg
│ │ ├── 289879.jpg
│ │ ├── 76759.jpg
│ │ ├── 816692.jpg
│ │ ├── 848228.jpg
│ │ ├── 910970.jpg
│ │ └── 945513.jpg
│ ├── shawshank.JPG
│ ├── star-half-big.png
│ ├── star-half.png
│ ├── star-off-big.png
│ ├── star-off.png
│ ├── star-on-big.png
│ ├── star-on.png
│ ├── star.jpg
│ ├── star.png
│ └── thriller
│ │ ├── 102926.jpg
│ │ ├── 1148204.jpg
│ │ ├── 1187064.jpg
│ │ ├── 120804.jpg
│ │ ├── 1259521.jpg
│ │ ├── 1457767.jpg
│ │ ├── 195714.jpg
│ │ ├── 212985.jpg
│ │ ├── 2281159.jpg
│ │ ├── 2973516.jpg
│ │ ├── 309698.jpg
│ │ ├── 364385.jpg
│ │ ├── 384537.jpg
│ │ ├── 5700672.jpg
│ │ ├── 63350.jpg
│ │ ├── 81505.jpg
│ │ └── 89371.jpg
├── js
│ ├── GetText.js
│ ├── Star.js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ ├── jquery-2.1.1.min.js
│ ├── jquery-3.1.1.js
│ ├── jquery.min.js
│ ├── jquery.raty.js
│ ├── jquery.raty.min.js
│ ├── jquery.star-rating-svg.js
│ ├── npm.js
│ └── starScore.js
├── rrtotaltable.csv
├── users_resulttable.csv
├── users_resulttable2.csv
└── users_resulttable2.csv.old
├── tests.py
├── urls.py
└── views.py
/README.md:
--------------------------------------------------------------------------------
1 | # Python_Collaborative_Filtering_Movie_Recommendations
2 | Python基于协同过滤算法的电影推荐视频网站设计
3 |
4 | 开发软件:Pycharm 开发环境: Python3.6 数据库:mysql5.6
5 |
6 | 本系统包含电影前端展示界面、电影评分板块、推荐算法的实现以及后端数据库的设 计.其中实现推荐算法是整个电影推荐系统的核心.系统采用由grouplens项目组从美国著名 电影网站movielens整理的ml-latest-small数据集,该数据集包含了671个用户对9000多部电 影的10万条评分数据.首先将该数据集包含的全部文件经过筛选重组之后存储到建好的数 据库中,并将数据集按一定比例划分为训练集和测试集,对训练集进行算法分析生成Top-N 个性化电影推荐列表,然后在测试集上对算法进行评测,至少包括准确率和召回率两种评 测指标.
7 |
8 | 协同过滤算法是推荐领域最出名也是应用最广泛的推荐算法.所以系统拟采用两种协 同过滤算法给出两种不同的推荐结果,一种是基于用户的协同过滤算法,另一种是基于物 品的协同过滤算法,用户可以根据两种推荐结果更加合理的选择合适的电影.系统采用了 改进之后的ItemCF-IUF和UserCF-IIF算法,对计算用户相似度和物品相似度的计算都做出 了改进.最后通过计算两种算法的准确率(Precision)、召回率(Recall)和流行度从而对系 统进行评测、并比较了两种算法各自的优势和劣势.实验证明,改进后的算法比原始的协 同过滤算法推荐效果要好,准确率更高.
9 |
10 | 整个系统涉及到的编程语言包含Python、Html5、JQuery、CSS3以及MySQL数据库编 程.用到的框架是Flask重量级web框架,通过该框架连接系统的前、后端.用户首先需要 填写用户名、密码以及邮箱注册系统,然后才能登陆推荐系统.进入首页后会看到8个电影 分类,包括恐怖片、动作片、剧情片等.用户需要给自己看过的电影进行评分,评分起止 为0.5-5.0分,共10个分段.每评价一部电影就要点击一下提交按钮,将所评分的电影的 imdbId号以及对应的评分存入数据库中.用户点击“推荐结果”按钮,系统就调用推荐算法 遍历数据库所存数据,得出推荐列表之后将结果反馈给浏览器,同时调取数据库所存电影 海报图片进行展示.用户点击自己登陆的昵称,会跳转页面显示自己已经评价过的电影.
11 |
--------------------------------------------------------------------------------
/关于系统.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/关于系统.txt
--------------------------------------------------------------------------------
/项目源码/ml-100k-data/MovieGenre3.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/ml-100k-data/MovieGenre3.csv
--------------------------------------------------------------------------------
/项目源码/movierecommend/.idea/django_auth_example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
32 |
33 |
34 |
35 | aptx4869
36 | login
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | 1523345153255
209 |
210 |
211 | 1523345153255
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 | user_sim_mat[user].items()
279 | Python
280 | EXPRESSION
281 |
282 |
283 | self.trainset
284 | Python
285 | EXPRESSION
286 |
287 |
288 |
289 |
290 | self.trainset
291 | Python
292 | EXPRESSION
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/__pycache__/models.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/__pycache__/models.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/__init__.py:
--------------------------------------------------------------------------------
1 | import pymysql;
2 | pymysql.install_as_MySQLdb()
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/django_auth_example/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/__pycache__/settings.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/django_auth_example/__pycache__/settings.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/__pycache__/urls.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/django_auth_example/__pycache__/urls.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/__pycache__/wsgi.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/django_auth_example/__pycache__/wsgi.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for django_auth_example project.
3 |
4 | Generated by 'django-admin startproject' using Django 1.11.1.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.11/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/1.11/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/1.11/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = '+h-pm!j*c$8!pyf!-^me8c&pjr4vl%b8zh_ms2wn7*bto%myg9'
24 |
25 | # SECURITY WARNING: don't run with debug turned on in production!
26 | DEBUG = True
27 |
28 | ALLOWED_HOSTS = []
29 |
30 | AUTH_USER_MODEL = 'users.User' #自己加的 使用user下的User模型
31 | LOGIN_REDIRECT_URL = '/' #自己添加,实现登录之后跳转到首页
32 |
33 |
34 |
35 |
36 | # Application definition
37 |
38 | INSTALLED_APPS = [
39 | 'django.contrib.admin',
40 | 'django.contrib.auth',
41 | 'django.contrib.contenttypes',
42 | 'django.contrib.sessions',
43 | 'django.contrib.messages',
44 | 'django.contrib.staticfiles',
45 | 'users',
46 | ]
47 |
48 | MIDDLEWARE = [
49 | 'django.middleware.security.SecurityMiddleware',
50 | 'django.contrib.sessions.middleware.SessionMiddleware',
51 | 'django.middleware.common.CommonMiddleware',
52 | 'django.middleware.csrf.CsrfViewMiddleware',
53 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
54 | 'django.contrib.messages.middleware.MessageMiddleware',
55 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
56 | ]
57 |
58 | ROOT_URLCONF = 'django_auth_example.urls'
59 |
60 | TEMPLATES = [
61 | {
62 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
63 | 'DIRS': [os.path.join(BASE_DIR, 'templates')],
64 | 'APP_DIRS': True,
65 | 'OPTIONS': {
66 | 'context_processors': [
67 | 'django.template.context_processors.debug',
68 | 'django.template.context_processors.request',
69 | 'django.contrib.auth.context_processors.auth',
70 | 'django.contrib.messages.context_processors.messages',
71 | ],
72 | },
73 | },
74 | ]
75 |
76 | WSGI_APPLICATION = 'django_auth_example.wsgi.application'
77 |
78 |
79 | # Database
80 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
81 |
82 | DATABASES = {
83 | 'default': {
84 | 'ENGINE': 'django.db.backends.mysql',
85 | #'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
86 | 'NAME': 'haha',
87 | 'USER': 'root',
88 | 'PASSWORD': '123456',
89 | 'HOST': '127.0.0.1',
90 | 'PORT': '3306',
91 | }
92 | }
93 |
94 |
95 | # Password validation
96 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
97 |
98 | AUTH_PASSWORD_VALIDATORS = [
99 | {
100 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
101 | },
102 | {
103 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
104 | },
105 | {
106 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
107 | },
108 | {
109 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
110 | },
111 | ]
112 |
113 |
114 | # Internationalization
115 | # https://docs.djangoproject.com/en/1.11/topics/i18n/
116 |
117 | LANGUAGE_CODE = 'zh-hans'
118 |
119 | TIME_ZONE = 'Asia/Shanghai'
120 |
121 | USE_I18N = True
122 |
123 | USE_L10N = True
124 |
125 | USE_TZ = True
126 |
127 |
128 | # Static files (CSS, JavaScript, Images)
129 | # https://docs.djangoproject.com/en/1.11/howto/static-files/
130 |
131 | STATIC_URL = '/static/'
132 |
133 | STATICFILES_DIRS = (
134 | os.path.join(BASE_DIR, 'static').replace('\\', '/'),
135 | )
136 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/urls.py:
--------------------------------------------------------------------------------
1 | """django_auth_example URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/1.11/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: url(r'^$', 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: url(r'^$', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.conf.urls import url, include
14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15 | """
16 | from django.conf.urls import url, include
17 | from django.contrib import admin
18 | from users import views
19 | from users.views import insert
20 | urlpatterns = [
21 | url(r'^admin/', admin.site.urls),
22 | # 别忘记在顶部引入 include 函数
23 | url(r'^users/', include('users.urls')),
24 | url(r'^users/', include('django.contrib.auth.urls')),
25 | url(r'^$', views.index, name='index'),
26 | url(r'^insert/$', insert),
27 | url(r'^users/recommend1/$', views.recommend1),
28 | url(r'^users/recommend2/$', views.recommend2),
29 | url(r'^users/recommend1/users/recommend1/recommend2/$', views.recommend2),
30 | # url(r'^users/showmessage/$', views.showmessage),
31 | ]
32 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/django_auth_example/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for django_auth_example 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/1.11/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", "django_auth_example.settings")
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/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", "django_auth_example.settings")
7 | try:
8 | from django.core.management import execute_from_command_line
9 | except ImportError:
10 | # The above import may fail for some other reason. Ensure that the
11 | # issue is really that Django is missing to avoid masking other
12 | # exceptions on Python 2.
13 | try:
14 | import django
15 | except ImportError:
16 | raise ImportError(
17 | "Couldn't import Django. Are you sure it's installed and "
18 | "available on your PYTHONPATH environment variable? Did you "
19 | "forget to activate a virtual environment?"
20 | )
21 | raise
22 | execute_from_command_line(sys.argv)
23 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/requirements.txt:
--------------------------------------------------------------------------------
1 | Django==2.2
2 | django-tinymce==2.6.0
3 | mysqlclient==2.0.1
4 | numpy==1.19.1
5 | pandas==1.1.0
6 | Pillow==7.2.0
7 | PyMySQL==1.0.2
8 | python-dateutil==2.8.1
9 | pytz==2020.1
10 | six==1.15.0
11 | sqlparse==0.3.1
12 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/templates/base.html:
--------------------------------------------------------------------------------
1 |
2 | {% load staticfiles %}
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {% block title %}{% endblock %} -- a django blog
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
55 |
56 |
57 |
58 |
59 |
60 | {% block content %}{% endblock %}
61 |
62 |
63 | {% block rightside %}{% endblock %}
64 |
65 |
66 |
67 |
68 |
69 |
74 |
75 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/templates/users/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/templates/users/3.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__init__.py
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/admin.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/admin.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/forms.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/forms.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/models.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/models.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/urls.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/urls.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/__pycache__/views.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/__pycache__/views.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import User,Resulttable
3 |
4 | admin.site.register(User)
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class UsersConfig(AppConfig):
5 | name = 'users'
6 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/forms.py:
--------------------------------------------------------------------------------
1 | from django.contrib.auth.forms import UserCreationForm
2 | from .models import User
3 |
4 | class RegisterForm(UserCreationForm):
5 | class Meta(UserCreationForm.Meta):
6 | model = User
7 | fields = ("username", "email")
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.11.7 on 2018-05-07 05:14
3 | from __future__ import unicode_literals
4 |
5 | import django.contrib.auth.models
6 | import django.contrib.auth.validators
7 | from django.db import migrations, models
8 | import django.utils.timezone
9 |
10 |
11 | class Migration(migrations.Migration):
12 |
13 | initial = True
14 |
15 | dependencies = [
16 | ('auth', '0008_alter_user_username_max_length'),
17 | ]
18 |
19 | operations = [
20 | migrations.CreateModel(
21 | name='User',
22 | fields=[
23 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
24 | ('password', models.CharField(max_length=128, verbose_name='password')),
25 | ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
26 | ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
27 | ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
28 | ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
29 | ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
30 | ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
31 | ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
32 | ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
33 | ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
34 | ('nickname', models.CharField(blank=True, max_length=50)),
35 | ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
36 | ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
37 | ],
38 | options={
39 | 'verbose_name': 'user',
40 | 'verbose_name_plural': 'users',
41 | 'abstract': False,
42 | },
43 | managers=[
44 | ('objects', django.contrib.auth.models.UserManager()),
45 | ],
46 | ),
47 | migrations.CreateModel(
48 | name='Insertposter',
49 | fields=[
50 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
51 | ('userId', models.IntegerField(null=True)),
52 | ('title', models.CharField(blank=True, max_length=200)),
53 | ('poster', models.CharField(blank=True, max_length=500, null=True)),
54 | ],
55 | ),
56 | migrations.CreateModel(
57 | name='Resulttable',
58 | fields=[
59 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
60 | ('userId', models.IntegerField(null=True)),
61 | ('imdbId', models.IntegerField()),
62 | ('rating', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
63 | ],
64 | ),
65 | ]
66 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/0002_auto_20211229_1513.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.2 on 2021-12-29 07:13
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('users', '0001_initial'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='user',
15 | name='last_name',
16 | field=models.CharField(blank=True, max_length=150, verbose_name='last name'),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/migrations/__init__.py
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/__pycache__/0001_initial.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/migrations/__pycache__/0001_initial.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/__pycache__/0002_auto_20211229_1513.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/migrations/__pycache__/0002_auto_20211229_1513.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/migrations/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/migrations/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | from django.db import models
5 | from django.contrib.auth.models import AbstractUser
6 |
7 | class User(AbstractUser):
8 | nickname = models.CharField(max_length=50, blank=True)
9 |
10 | class Meta(AbstractUser.Meta):
11 | pass
12 |
13 |
14 | # class MYBOOK(models.Model):
15 | # name = models.CharField(max_length=200)
16 | # price = models.FloatField()
17 | #
18 | # def __str__(self):
19 | # return self.name+':'+str(self.price)
20 |
21 | # class Resulttable(models.Model):
22 | # # movieId = models.IntegerField(null=True) # Field name made lowercase.
23 | # userId = models.IntegerField(null=True) # Field name made lowercase.
24 | # rating = models.DecimalField(max_digits=3, decimal_places=1, blank=True, null=True)
25 | # imdbId = models.IntegerField() # Field name made lowercase.
26 | # title = models.CharField(max_length=50, blank=True, null=True)
27 | #
28 | # # class Meta:
29 | # # managed = False
30 | # # db_table = 'resulttable'
31 | #
32 | # def __str__(self):
33 | # return self.userId+':'+self.rating
34 |
35 |
36 | class Resulttable(models.Model):
37 | # movieId = models.IntegerField(null=True) # Field name made lowercase.
38 | userId = models.IntegerField(null=True) # Field name made lowercase.
39 | imdbId = models.IntegerField() # Field name made lowercase.
40 | rating = models.DecimalField(max_digits=3, decimal_places=1, blank=True, null=True)
41 | # title = models.CharField(max_length=50, blank=True, null=True)
42 |
43 | # class Meta:
44 | # managed = False
45 | # db_table = 'resulttable'
46 |
47 | def __str__(self):
48 | return self.userId+':'+self.rating
49 |
50 |
51 | class Insertposter(models.Model):
52 | userId = models.IntegerField(null=True)
53 | title = models.CharField(max_length=200,blank=True,null = False)
54 | poster = models.CharField(max_length=500, blank=True, null=True)
55 |
56 | def __str__(self):
57 | return self.userId + ':' + self.poster
58 |
59 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/css/Test.css:
--------------------------------------------------------------------------------
1 | h2{
2 | text-align:center;
3 | #color:#00ff00;
4 | font-family:"Times New Roman", Times, serif;
5 | }
6 |
7 |
8 | /*.pic,.BiaoQian{*/
9 | /*float:left;*/
10 | /*margin-top: 70px;*/
11 | /*}*/
12 |
13 | /*.pic{*/
14 | /*margin-left:200px;*/
15 | /*#border: 1px solid #00FF00;*/
16 | /*margin-right:50px;*/
17 | /*width:320px;*/
18 | /*height:400px;*/
19 | /*}*/
20 |
21 | /*.BiaoQian{*/
22 | /*#border: 1px solid #000000;*/
23 | /*width:700px;*/
24 | /*height:500px;*/
25 | /*}*/
26 |
27 |
28 | /*.content {*/
29 | /*width:100%;*/
30 | /*overflow: hidden;*/
31 |
32 | /*}*/
33 |
34 |
35 | /*.tags_list ul*/
36 | /*{*/
37 | /*list-style-type:none;*/
38 | /*margin-left:50px;*/
39 | /*width:35%;*/
40 | /*margin-top: 15px;*/
41 | /*}*/
42 |
43 |
44 | /*li {*/
45 | /*list-style: none;*/
46 | /*display: inline-block;*/
47 | /*#width: 33.3%;*/
48 | /*text-align: center;*/
49 | /*overflow: hidden;*/
50 | /*vertical-align: bottom;*/
51 | /*}*/
52 |
53 |
54 | /*.img-box {*/
55 | /*height: 300px;*/
56 | /*overflow: hidden;*/
57 | /*padding-right: 25px;*/
58 | /*padding-left: 35px;*/
59 | /*}*/
60 | /*.img-box img {*/
61 | /*position: relative;*/
62 | /*width: 100%;*/
63 | /*top: 50%;*/
64 | /*transform: translateY(-60%);*/
65 | /*}*/
66 |
67 |
68 |
69 |
70 | /*.star_bg {*/
71 | /*width: 120px; height: 20px;*/
72 | /*background: url(../img/star.jpg) repeat-x;*/
73 | /*position: relative;*/
74 | /*overflow: hidden;*/
75 | /*}*/
76 | /*.star {*/
77 | /*height: 100%; width: 24px;*/
78 | /*line-height: 6em;*/
79 | /*position: absolute;*/
80 | /*z-index: 3;*/
81 | /*}*/
82 | /*.star:hover {*/
83 | /*background: url(../img/star.jpg) repeat-x 0 -20px!important;*/
84 | /*left: 0; z-index: 2;*/
85 | /*}*/
86 | /*.star_1 { left: 0; }*/
87 |
88 | /*/* 幕后的英雄,单选按钮 */
89 |
90 | /*.score_1:checked ~ .star_1 { width: 24px; }*/
91 | /*.score_2:checked ~ .star_2 { width: 48px; }*/
92 | /*.score_3:checked ~ .star_3 { width: 72px; }*/
93 | /*.score_4:checked ~ .star_4 { width: 96px; }*/
94 | /*.score_5:checked ~ .star_5 { width: 120px; }*/
95 |
96 | /*.star_bg:hover .star { background-image: none; }*/
97 |
98 |
99 |
100 | .figure_title>a {
101 | display: block;
102 | }
103 |
104 |
105 | #user {
106 | padding-left: 10px;
107 | margin-top: 20px
108 | }
109 |
110 | .figures_lists {
111 | margin-left: 0;
112 | padding: 0;
113 | list-style-type: none;
114 | }
115 |
116 |
117 |
118 | .list_item {
119 | display: inline-block;
120 | /*float: left;*/
121 | vertical-align: top;
122 | margin-bottom: 20px;
123 | position: relative;
124 | padding-right: 25px;
125 | padding-left: 25px;
126 | }
127 |
128 | .label_title {
129 | position: absolute;
130 | top: 0;
131 | left: 0;
132 | background-color: #1CBF11;
133 | border-radius: 10px;
134 | }
135 | .label_font {
136 | color: #fff;
137 | padding: 0 5px;
138 | }
139 | #my-content {
140 | margin: 25px auto;
141 | padding: 0 10px;
142 | }
143 | #my-content:first-child {
144 | padding: 0;
145 | }
146 |
147 | .figure img {
148 | width: 80%;
149 | }
150 | .new_image {
151 | position: absolute;
152 | top: 0;
153 | left: 0;
154 | }
155 | /*@media 设备类型 and|only|not (设备特性) {样式代码}*/
156 | @media handheld and (max-device-width: 768px) {
157 | .nav>li {
158 | display: inline-table;
159 | margin-right: 10px;
160 | }
161 | .container {
162 | padding-left: 0;
163 | padding-right: 0;
164 | margin: 0 10px;
165 | }
166 | .list_item {
167 | width: 32%;
168 | }
169 | }
170 |
171 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/css/demo.css:
--------------------------------------------------------------------------------
1 | .evaluate{
2 | padding-left: 30px;
3 | }
4 | #title{
5 | color:red;
6 | }
7 |
8 |
9 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/css/firstPage.css:
--------------------------------------------------------------------------------
1 | h2{
2 | text-align:center;
3 | #color:#00ff00;
4 | font-family:"Times New Roman", Times, serif;
5 | }
6 |
7 |
8 | .pic,.BiaoQian{
9 | float:left;
10 | margin-top: 70px;
11 | }
12 |
13 | .pic{
14 | margin-left:200px;
15 | #border: 1px solid #00FF00;
16 | margin-right:50px;
17 | width:320px;
18 | height:400px;
19 | }
20 |
21 | .BiaoQian{
22 | #border: 1px solid #000000;
23 | width:700px;
24 | height:500px;
25 | }
26 |
27 |
28 | .content {
29 | width:100%;
30 | overflow: hidden;
31 |
32 | }
33 |
34 |
35 | .tags_list ul
36 | {
37 | list-style-type:none;
38 | margin-left:50px;
39 | width:35%;
40 | margin-top: 15px;
41 | }
42 |
43 |
44 | li {
45 | list-style: none;
46 | display: inline-block;
47 | #width: 33.3%;
48 | text-align: center;
49 | overflow: hidden;
50 | vertical-align: bottom;
51 | }
52 |
53 |
54 | .img-box {
55 | height: 300px;
56 | overflow: hidden;
57 | padding-right: 25px;
58 | padding-left: 35px;
59 | }
60 | .img-box img {
61 | position: relative;
62 | width: 100%;
63 | top: 50%;
64 | transform: translateY(-60%);
65 | }
66 |
67 | #user {
68 | padding-left: 10px;
69 | margin-top: 20px
70 | }
71 |
72 | .figures_lists {
73 | margin-left: 0;
74 | padding: 0;
75 | list-style-type: none;
76 | }
77 | .list_item {
78 | display: inline-block;
79 | /*float: left;*/
80 | vertical-align: top;
81 | margin-bottom: 20px;
82 | position: relative;
83 | }
84 | .label_title {
85 | position: absolute;
86 | top: 0;
87 | left: 0;
88 | background-color: #1CBF11;
89 | border-radius: 10px;
90 | }
91 | .label_font {
92 | color: #fff;
93 | padding: 0 5px;
94 | }
95 | #my-content {
96 | margin: 25px auto;
97 | padding: 0 10px;
98 | }
99 | #my-content:first-child {
100 | padding: 0;
101 | }
102 |
103 |
104 | .figure_title>a {
105 | display: block;
106 | }
107 | .figure img {
108 | width: 80%;
109 | }
110 | .new_image {
111 | position: absolute;
112 | top: 0;
113 | left: 0;
114 | }
115 | /*@media 设备类型 and|only|not (设备特性) {样式代码}*/
116 | @media handheld and (max-device-width: 768px) {
117 | .nav>li {
118 | display: inline-table;
119 | margin-right: 10px;
120 | }
121 | .container {
122 | padding-left: 0;
123 | padding-right: 0;
124 | margin: 0 10px;
125 | }
126 | .list_item {
127 | width: 32%;
128 | }
129 | }
130 |
131 |
132 |
133 | /*.container_{*/
134 | /*position:absolute;*/
135 | /*}*/
136 | .btn .zhuxiao{
137 | position: absolute;
138 | right: 0px;
139 | }
140 |
141 | /*.login_{*/
142 | /*position: absolute;*/
143 | /*}*/
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/css/main.css:
--------------------------------------------------------------------------------
1 | h2{
2 | text-align:center;
3 | #color:#00ff00;
4 | font-family:"Times New Roman", Times, serif;
5 | }
6 |
7 |
8 | .pic,.BiaoQian{
9 | float:left;
10 | margin-top: 70px;
11 | }
12 |
13 | .pic{
14 | margin-left:200px;
15 | #border: 1px solid #00FF00;
16 | margin-right:50px;
17 | width:320px;
18 | height:400px;
19 | }
20 |
21 | .BiaoQian{
22 | #border: 1px solid #000000;
23 | width:700px;
24 | height:500px;
25 | }
26 |
27 |
28 | .content {
29 | width:100%;
30 | overflow: hidden;
31 |
32 | }
33 |
34 |
35 | .tags_list ul
36 | {
37 | list-style-type:none;
38 | margin-left:50px;
39 | width:35%;
40 | margin-top: 15px;
41 | }
42 |
43 |
44 | li {
45 | list-style: none;
46 | display: inline-block;
47 | #width: 33.3%;
48 | text-align: center;
49 | overflow: hidden;
50 | vertical-align: bottom;
51 | }
52 |
53 |
54 | .img-box {
55 | height: 300px;
56 | overflow: hidden;
57 | padding-right: 25px;
58 | padding-left: 35px;
59 | }
60 | .img-box img {
61 | position: relative;
62 | width: 100%;
63 | top: 50%;
64 | transform: translateY(-60%);
65 | }
66 |
67 | #user {
68 | padding-left: 10px;
69 | margin-top: 20px
70 | }
71 |
72 | .figures_lists {
73 | margin-left: 0;
74 | padding: 0;
75 | list-style-type: none;
76 | }
77 | .list_item {
78 | display: inline-block;
79 | /*float: left;*/
80 | vertical-align: top;
81 | margin-bottom: 20px;
82 | position: relative;
83 | }
84 | .label_title {
85 | position: absolute;
86 | top: 0;
87 | left: 0;
88 | background-color: #1CBF11;
89 | border-radius: 10px;
90 | }
91 | .label_font {
92 | color: #fff;
93 | padding: 0 5px;
94 | }
95 | #my-content {
96 | margin: 25px auto;
97 | padding: 0 10px;
98 | }
99 | #my-content:first-child {
100 | padding: 0;
101 | }
102 |
103 |
104 | .figure_title>a {
105 | display: block;
106 | }
107 | .figure img {
108 | width: 80%;
109 | }
110 | .new_image {
111 | position: absolute;
112 | top: 0;
113 | left: 0;
114 | }
115 | /*@media 设备类型 and|only|not (设备特性) {样式代码}*/
116 | @media handheld and (max-device-width: 768px) {
117 | .nav>li {
118 | display: inline-table;
119 | margin-right: 10px;
120 | }
121 | .container {
122 | padding-left: 0;
123 | padding-right: 0;
124 | margin: 0 10px;
125 | }
126 | .list_item {
127 | width: 32%;
128 | }
129 | }
130 |
131 |
132 |
133 | .container_{
134 | position:absolute;
135 | }
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/css/star.css:
--------------------------------------------------------------------------------
1 | /*.content{*/
2 | /*width: 600px;*/
3 | /*margin:0 auto;*/
4 | /*padding-top:20px;*/
5 | /*}*/
6 | /* 重置文本格式元素 */
7 | a {
8 | text-decoration: none;
9 | cursor: pointer;
10 | color:#333333;
11 | font-size:14px;
12 | }
13 | a:hover {
14 | text-decoration: none;
15 | }
16 | .clearfix::after{
17 | display:block;
18 | content:'';
19 | height:0;
20 | overflow:hidden;
21 | clear:both;
22 | }
23 |
24 | .block .star_score{
25 | float:left;
26 | }
27 |
28 | .star_score {
29 | background-image: url("../img/starky.png");
30 | width:160px;
31 | height:21px;
32 | position:relative;
33 | }
34 |
35 | /*分数动态*/
36 | .star_score a{
37 | height:21px;
38 | display:block;
39 | text-indent:-999em;
40 | position:absolute;
41 | left:0;
42 | }
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/DaoMeng.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/DaoMeng.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/GaoYang.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/GaoYang.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/HuiHun.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/HuiHun.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/LostMan.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/LostMan.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/Orphan.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/Orphan.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/Seven.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/Seven.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/ZhaoHun.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/ZhaoHun.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/103776.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/103776.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/105859.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/105859.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/113189.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/113189.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/1229238.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/1229238.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/1298650.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/1298650.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/145487.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/145487.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/2186715.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/2186715.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/3540136.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/3540136.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/3672840.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/3672840.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/371746.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/371746.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/4276752.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/4276752.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/4324274.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/4324274.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/434409.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/434409.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/4600952.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/4600952.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/499549.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/499549.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/5481184.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/5481184.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/action/77869.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/action/77869.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/110357.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/110357.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/113198.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/113198.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/114709.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/114709.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/118829.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/118829.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/120794.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/120794.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/126029.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/126029.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/129167.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/129167.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/1323594.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/1323594.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/230011.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/230011.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/245429.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/245429.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/266543.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/266543.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/29583.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/29583.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/3781476.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/3781476.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/3919322.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/3919322.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/396555.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/396555.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/441773.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/441773.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/4644382.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/4644382.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/4692656.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/4692656.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/animation/892782.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/animation/892782.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/cancel-custom-off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/cancel-custom-off.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/cancel-custom-on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/cancel-custom-on.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/cancel-off-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/cancel-off-big.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/cancel-on-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/cancel-on-big.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/110201.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/110201.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/1109624.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/1109624.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/1187043.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/1187043.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/118799.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/118799.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/1372692.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/1372692.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/1675434.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/1675434.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/188766.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/188766.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/2245084.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/2245084.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/2414370.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/2414370.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/2459022.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/2459022.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/356910.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/356910.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/362227.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/362227.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/373074.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/373074.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/3863552.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/3863552.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/5061814.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/5061814.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/5157018.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/5157018.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/comedy/5290882.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/comedy/5290882.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/1067920.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/1067920.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/110413.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/110413.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/111161.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/111161.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/114369.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/114369.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/1160629.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/1160629.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/137494.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/137494.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/1527788.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/1527788.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/209144.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/209144.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/216165.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/216165.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/2165735.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/2165735.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/2267998.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/2267998.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/2820852.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/2820852.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/2990738.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/2990738.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/338564.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/338564.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/386651.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/386651.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/439884.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/439884.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/4701702.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/4701702.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/crime/92263.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/crime/92263.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1028532.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1028532.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/110081.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/110081.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/120382.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/120382.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1285016.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1285016.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1393746.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1393746.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1410063.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1410063.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/166924.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/166924.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1670345.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1670345.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/167404.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/167404.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/1707386.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/1707386.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/2582802.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/2582802.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/405094.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/405094.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/454876.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/454876.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/458352.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/458352.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/480249.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/480249.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/drama/73486.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/drama/73486.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1010048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1010048.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1055300.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1055300.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/106332.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/106332.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/109830.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/109830.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1099212.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1099212.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1194664.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1194664.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/120338.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/120338.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1554523.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1554523.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/1859438.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/1859438.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/2036416.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/2036416.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/211915.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/211915.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/3043630.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/3043630.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/428870.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/428870.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/808357.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/808357.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/817177.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/817177.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/93978.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/93978.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/love/99487.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/love/99487.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1190080.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1190080.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1260502.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1260502.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1305797.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1305797.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/133093.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/133093.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1375666.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1375666.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1454468.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1454468.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1631867.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1631867.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/182789.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/182789.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/1877832.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/1877832.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/2866360.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/2866360.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/2872732.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/2872732.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/289879.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/289879.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/76759.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/76759.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/816692.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/816692.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/848228.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/848228.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/910970.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/910970.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/science/945513.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/science/945513.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/shawshank.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/shawshank.JPG
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-half-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-half-big.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-half.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-half.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-off-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-off-big.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-off.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-on-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-on-big.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star-on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star-on.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/star.png
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/102926.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/102926.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/1148204.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/1148204.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/1187064.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/1187064.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/120804.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/120804.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/1259521.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/1259521.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/1457767.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/1457767.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/195714.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/195714.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/212985.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/212985.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/2281159.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/2281159.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/2973516.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/2973516.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/309698.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/309698.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/364385.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/364385.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/384537.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/384537.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/5700672.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/5700672.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/63350.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/63350.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/81505.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/81505.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/img/thriller/89371.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/img/thriller/89371.jpg
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/GetText.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/Star.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Python_Collaborative_Filtering_Movie_Recommendations/10222045b2ac700e2d3e0ff76dffc5c4ce1a8ef1/项目源码/movierecommend/users/static/js/Star.js
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/jquery.raty.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery Raty - A Star Rating Plugin
3 | *
4 | * The MIT License
5 | *
6 | * author: Washington Botelho
7 | * github: wbotelhos/raty
8 | * version: 2.8.0
9 | *
10 | */
11 |
12 | (function($) {
13 | 'use strict';
14 |
15 | var methods = {
16 | init: function(options) {
17 | return this.each(function() {
18 | this.self = $(this);
19 |
20 | methods.destroy.call(this.self);
21 |
22 | this.opt = $.extend(true, {}, $.fn.raty.defaults, options, this.self.data());
23 |
24 | methods._adjustCallback.call(this);
25 | methods._adjustNumber.call(this);
26 | methods._adjustHints.call(this);
27 |
28 | this.opt.score = methods._adjustedScore.call(this, this.opt.score);
29 |
30 | if (this.opt.starType !== 'img') {
31 | methods._adjustStarType.call(this);
32 | }
33 |
34 | methods._adjustPath.call(this);
35 | methods._createStars.call(this);
36 |
37 | if (this.opt.cancel) {
38 | methods._createCancel.call(this);
39 | }
40 |
41 | if (this.opt.precision) {
42 | methods._adjustPrecision.call(this);
43 | }
44 |
45 | methods._createScore.call(this);
46 | methods._apply.call(this, this.opt.score);
47 | methods._setTitle.call(this, this.opt.score);
48 | methods._target.call(this, this.opt.score);
49 |
50 | if (this.opt.readOnly) {
51 | methods._lock.call(this);
52 | } else {
53 | this.style.cursor = 'pointer';
54 |
55 | methods._binds.call(this);
56 | }
57 | });
58 | },
59 |
60 | _adjustCallback: function() {
61 | var options = ['number', 'readOnly', 'score', 'scoreName', 'target', 'path'];
62 |
63 | for (var i = 0; i < options.length; i++) {
64 | if (typeof this.opt[options[i]] === 'function') {
65 | this.opt[options[i]] = this.opt[options[i]].call(this);
66 | }
67 | }
68 | },
69 |
70 | _adjustedScore: function(score) {
71 | if (!score) {
72 | return score;
73 | }
74 |
75 | return methods._between(score, 0, this.opt.number);
76 | },
77 |
78 | _adjustHints: function() {
79 | if (!this.opt.hints) {
80 | this.opt.hints = [];
81 | }
82 |
83 | if (!this.opt.halfShow && !this.opt.half) {
84 | return;
85 | }
86 |
87 | var steps = this.opt.precision ? 10 : 2;
88 |
89 | for (var i = 0; i < this.opt.number; i++) {
90 | var group = this.opt.hints[i];
91 |
92 | if (Object.prototype.toString.call(group) !== '[object Array]') {
93 | group = [group];
94 | }
95 |
96 | this.opt.hints[i] = [];
97 |
98 | for (var j = 0; j < steps; j++) {
99 | var
100 | hint = group[j],
101 | last = group[group.length - 1];
102 |
103 | if (last === undefined) {
104 | last = null;
105 | }
106 |
107 | this.opt.hints[i][j] = hint === undefined ? last : hint;
108 | }
109 | }
110 | },
111 |
112 | _adjustNumber: function() {
113 | this.opt.number = methods._between(this.opt.number, 1, this.opt.numberMax);
114 | },
115 |
116 | _adjustPath: function() {
117 | this.opt.path = this.opt.path || '';
118 |
119 | if (this.opt.path && this.opt.path.charAt(this.opt.path.length - 1) !== '/') {
120 | this.opt.path += '/';
121 | }
122 | },
123 |
124 | _adjustPrecision: function() {
125 | this.opt.half = true;
126 | },
127 |
128 | _adjustStarType: function() {
129 | var replaces = ['cancelOff', 'cancelOn', 'starHalf', 'starOff', 'starOn'];
130 |
131 | this.opt.path = '';
132 |
133 | for (var i = 0; i < replaces.length; i++) {
134 | this.opt[replaces[i]] = this.opt[replaces[i]].replace('.', '-');
135 | }
136 | },
137 |
138 | _apply: function(score) {
139 | methods._fill.call(this, score);
140 |
141 | if (score) {
142 | if (score > 0) {
143 | this.score.val(score);
144 | }
145 |
146 | methods._roundStars.call(this, score);
147 | }
148 | },
149 |
150 | _between: function(value, min, max) {
151 | return Math.min(Math.max(parseFloat(value), min), max);
152 | },
153 |
154 | _binds: function() {
155 | if (this.cancel) {
156 | methods._bindOverCancel.call(this);
157 | methods._bindClickCancel.call(this);
158 | methods._bindOutCancel.call(this);
159 | }
160 |
161 | methods._bindOver.call(this);
162 | methods._bindClick.call(this);
163 | methods._bindOut.call(this);
164 | },
165 |
166 | _bindClick: function() {
167 | var that = this;
168 |
169 | that.stars.on('click.raty', function(evt) {
170 | var
171 | execute = true,
172 | score = (that.opt.half || that.opt.precision) ? that.self.data('score') : (this.alt || $(this).data('alt'));
173 |
174 | if (that.opt.click) {
175 | execute = that.opt.click.call(that, +score, evt);
176 | }
177 |
178 | if (execute || execute === undefined) {
179 | if (that.opt.half && !that.opt.precision) {
180 | score = methods._roundHalfScore.call(that, score);
181 | }
182 |
183 | methods._apply.call(that, score);
184 | }
185 | });
186 | },
187 |
188 | _bindClickCancel: function() {
189 | var that = this;
190 |
191 | that.cancel.on('click.raty', function(evt) {
192 | that.score.removeAttr('value');
193 |
194 | if (that.opt.click) {
195 | that.opt.click.call(that, null, evt);
196 | }
197 | });
198 | },
199 |
200 | _bindOut: function() {
201 | var that = this;
202 |
203 | that.self.on('mouseleave.raty', function(evt) {
204 | var score = +that.score.val() || undefined;
205 |
206 | methods._apply.call(that, score);
207 | methods._target.call(that, score, evt);
208 | methods._resetTitle.call(that);
209 |
210 | if (that.opt.mouseout) {
211 | that.opt.mouseout.call(that, score, evt);
212 | }
213 | });
214 | },
215 |
216 | _bindOutCancel: function() {
217 | var that = this;
218 |
219 | that.cancel.on('mouseleave.raty', function(evt) {
220 | var icon = that.opt.cancelOff;
221 |
222 | if (that.opt.starType !== 'img') {
223 | icon = that.opt.cancelClass + ' ' + icon;
224 | }
225 |
226 | methods._setIcon.call(that, this, icon);
227 |
228 | if (that.opt.mouseout) {
229 | var score = +that.score.val() || undefined;
230 |
231 | that.opt.mouseout.call(that, score, evt);
232 | }
233 | });
234 | },
235 |
236 | _bindOver: function() {
237 | var
238 | that = this,
239 | action = that.opt.half ? 'mousemove.raty' : 'mouseover.raty';
240 |
241 | that.stars.on(action, function(evt) {
242 | var score = methods._getScoreByPosition.call(that, evt, this);
243 |
244 | methods._fill.call(that, score);
245 |
246 | if (that.opt.half) {
247 | methods._roundStars.call(that, score, evt);
248 | methods._setTitle.call(that, score, evt);
249 |
250 | that.self.data('score', score);
251 | }
252 |
253 | methods._target.call(that, score, evt);
254 |
255 | if (that.opt.mouseover) {
256 | that.opt.mouseover.call(that, score, evt);
257 | }
258 | });
259 | },
260 |
261 | _bindOverCancel: function() {
262 | var that = this;
263 |
264 | that.cancel.on('mouseover.raty', function(evt) {
265 | var
266 | starOff = that.opt.path + that.opt.starOff,
267 | icon = that.opt.cancelOn;
268 |
269 | if (that.opt.starType === 'img') {
270 | that.stars.attr('src', starOff);
271 | } else {
272 | icon = that.opt.cancelClass + ' ' + icon;
273 |
274 | that.stars.attr('class', starOff);
275 | }
276 |
277 | methods._setIcon.call(that, this, icon);
278 | methods._target.call(that, null, evt);
279 |
280 | if (that.opt.mouseover) {
281 | that.opt.mouseover.call(that, null);
282 | }
283 | });
284 | },
285 |
286 | _buildScoreField: function() {
287 | return $('', { name: this.opt.scoreName, type: 'hidden' }).appendTo(this);
288 | },
289 |
290 | _createCancel: function() {
291 | var
292 | icon = this.opt.path + this.opt.cancelOff,
293 | cancel = $('<' + this.opt.starType + ' />', { title: this.opt.cancelHint, 'class': this.opt.cancelClass });
294 |
295 | if (this.opt.starType === 'img') {
296 | cancel.attr({ src: icon, alt: 'x' });
297 | } else {
298 | // TODO: use $.data
299 | cancel.attr('data-alt', 'x').addClass(icon);
300 | }
301 |
302 | if (this.opt.cancelPlace === 'left') {
303 | this.self.prepend(' ').prepend(cancel);
304 | } else {
305 | this.self.append(' ').append(cancel);
306 | }
307 |
308 | this.cancel = cancel;
309 | },
310 |
311 | _createScore: function() {
312 | var score = $(this.opt.targetScore);
313 |
314 | this.score = score.length ? score : methods._buildScoreField.call(this);
315 | },
316 |
317 | _createStars: function() {
318 | for (var i = 1; i <= this.opt.number; i++) {
319 | var
320 | name = methods._nameForIndex.call(this, i),
321 | attrs = { alt: i, src: this.opt.path + this.opt[name] };
322 |
323 | if (this.opt.starType !== 'img') {
324 | attrs = { 'data-alt': i, 'class': attrs.src }; // TODO: use $.data.
325 | }
326 |
327 | attrs.title = methods._getHint.call(this, i);
328 |
329 | $('<' + this.opt.starType + ' />', attrs).appendTo(this);
330 |
331 | if (this.opt.space) {
332 | this.self.append(i < this.opt.number ? ' ' : '');
333 | }
334 | }
335 |
336 | this.stars = this.self.children(this.opt.starType);
337 | },
338 |
339 | _error: function(message) {
340 | $(this).text(message);
341 |
342 | $.error(message);
343 | },
344 |
345 | _fill: function(score) {
346 | var hash = 0;
347 |
348 | for (var i = 1; i <= this.stars.length; i++) {
349 | var
350 | icon,
351 | star = this.stars[i - 1],
352 | turnOn = methods._turnOn.call(this, i, score);
353 |
354 | if (this.opt.iconRange && this.opt.iconRange.length > hash) {
355 | var irange = this.opt.iconRange[hash];
356 |
357 | icon = methods._getRangeIcon.call(this, irange, turnOn);
358 |
359 | if (i <= irange.range) {
360 | methods._setIcon.call(this, star, icon);
361 | }
362 |
363 | if (i === irange.range) {
364 | hash++;
365 | }
366 | } else {
367 | icon = this.opt[turnOn ? 'starOn' : 'starOff'];
368 |
369 | methods._setIcon.call(this, star, icon);
370 | }
371 | }
372 | },
373 |
374 | _getFirstDecimal: function(number) {
375 | var
376 | decimal = number.toString().split('.')[1],
377 | result = 0;
378 |
379 | if (decimal) {
380 | result = parseInt(decimal.charAt(0), 10);
381 |
382 | if (decimal.slice(1, 5) === '9999') {
383 | result++;
384 | }
385 | }
386 |
387 | return result;
388 | },
389 |
390 | _getRangeIcon: function(irange, turnOn) {
391 | return turnOn ? irange.on || this.opt.starOn : irange.off || this.opt.starOff;
392 | },
393 |
394 | _getScoreByPosition: function(evt, icon) {
395 | var score = parseInt(icon.alt || icon.getAttribute('data-alt'), 10);
396 |
397 | if (this.opt.half) {
398 | var
399 | size = methods._getWidth.call(this),
400 | percent = parseFloat((evt.pageX - $(icon).offset().left) / size);
401 |
402 | score = score - 1 + percent;
403 | }
404 |
405 | return score;
406 | },
407 |
408 | _getHint: function(score, evt) {
409 | if (score !== 0 && !score) {
410 | return this.opt.noRatedMsg;
411 | }
412 |
413 | var
414 | decimal = methods._getFirstDecimal.call(this, score),
415 | integer = Math.ceil(score),
416 | group = this.opt.hints[(integer || 1) - 1],
417 | hint = group,
418 | set = !evt || this.move;
419 |
420 | if (this.opt.precision) {
421 | if (set) {
422 | decimal = decimal === 0 ? 9 : decimal - 1;
423 | }
424 |
425 | hint = group[decimal];
426 | } else if (this.opt.halfShow || this.opt.half) {
427 | decimal = set && decimal === 0 ? 1 : decimal > 5 ? 1 : 0;
428 |
429 | hint = group[decimal];
430 | }
431 |
432 | return hint === '' ? '' : hint || score;
433 | },
434 |
435 | _getWidth: function() {
436 | var width = this.stars[0].width || parseFloat(this.stars.eq(0).css('font-size'));
437 |
438 | if (!width) {
439 | methods._error.call(this, 'Could not get the icon width!');
440 | }
441 |
442 | return width;
443 | },
444 |
445 | _lock: function() {
446 | var hint = methods._getHint.call(this, this.score.val());
447 |
448 | this.style.cursor = '';
449 | this.title = hint;
450 |
451 | this.score.prop('readonly', true);
452 | this.stars.prop('title', hint);
453 |
454 | if (this.cancel) {
455 | this.cancel.hide();
456 | }
457 |
458 | this.self.data('readonly', true);
459 | },
460 |
461 | _nameForIndex: function(i) {
462 | return this.opt.score && this.opt.score >= i ? 'starOn' : 'starOff';
463 | },
464 |
465 | _resetTitle: function() {
466 | for (var i = 0; i < this.opt.number; i++) {
467 | this.stars[i].title = methods._getHint.call(this, i + 1);
468 | }
469 | },
470 |
471 | _roundHalfScore: function(score) {
472 | var
473 | integer = parseInt(score, 10),
474 | decimal = methods._getFirstDecimal.call(this, score);
475 |
476 | if (decimal !== 0) {
477 | decimal = decimal > 5 ? 1 : 0.5;
478 | }
479 |
480 | return integer + decimal;
481 | },
482 |
483 | _roundStars: function(score, evt) {
484 | var
485 | decimal = (score % 1).toFixed(2),
486 | name ;
487 |
488 | if (evt || this.move) {
489 | name = decimal > 0.5 ? 'starOn' : 'starHalf';
490 | } else if (decimal > this.opt.round.down) { // Up: [x.76 .. x.99]
491 | name = 'starOn';
492 |
493 | if (this.opt.halfShow && decimal < this.opt.round.up) { // Half: [x.26 .. x.75]
494 | name = 'starHalf';
495 | } else if (decimal < this.opt.round.full) { // Down: [x.00 .. x.5]
496 | name = 'starOff';
497 | }
498 | }
499 |
500 | if (name) {
501 | var
502 | icon = this.opt[name],
503 | star = this.stars[Math.ceil(score) - 1];
504 |
505 | methods._setIcon.call(this, star, icon);
506 | } // Full down: [x.00 .. x.25]
507 | },
508 |
509 | _setIcon: function(star, icon) {
510 | star[this.opt.starType === 'img' ? 'src' : 'className'] = this.opt.path + icon;
511 | },
512 |
513 | _setTarget: function(target, score) {
514 | if (score) {
515 | score = this.opt.targetFormat.toString().replace('{score}', score);
516 | }
517 |
518 | if (target.is(':input')) {
519 | target.val(score);
520 | } else {
521 | target.html(score);
522 | }
523 | },
524 |
525 | _setTitle: function(score, evt) {
526 | if (score) {
527 | var
528 | integer = parseInt(Math.ceil(score), 10),
529 | star = this.stars[integer - 1];
530 |
531 | star.title = methods._getHint.call(this, score, evt);
532 | }
533 | },
534 |
535 | _target: function(score, evt) {
536 | if (this.opt.target) {
537 | var target = $(this.opt.target);
538 |
539 | if (!target.length) {
540 | methods._error.call(this, 'Target selector invalid or missing!');
541 | }
542 |
543 | var mouseover = evt && evt.type === 'mouseover';
544 |
545 | if (score === undefined) {
546 | score = this.opt.targetText;
547 | } else if (score === null) {
548 | score = mouseover ? this.opt.cancelHint : this.opt.targetText;
549 | } else {
550 | if (this.opt.targetType === 'hint') {
551 | score = methods._getHint.call(this, score, evt);
552 | } else if (this.opt.precision) {
553 | score = parseFloat(score).toFixed(1);
554 | }
555 |
556 | var mousemove = evt && evt.type === 'mousemove';
557 |
558 | if (!mouseover && !mousemove && !this.opt.targetKeep) {
559 | score = this.opt.targetText;
560 | }
561 | }
562 |
563 | methods._setTarget.call(this, target, score);
564 | }
565 | },
566 |
567 | _turnOn: function(i, score) {
568 | return this.opt.single ? (i === score) : (i <= score);
569 | },
570 |
571 | _unlock: function() {
572 | this.style.cursor = 'pointer';
573 | this.removeAttribute('title');
574 |
575 | this.score.removeAttr('readonly');
576 |
577 | this.self.data('readonly', false);
578 |
579 | for (var i = 0; i < this.opt.number; i++) {
580 | this.stars[i].title = methods._getHint.call(this, i + 1);
581 | }
582 |
583 | if (this.cancel) {
584 | this.cancel.css('display', '');
585 | }
586 | },
587 |
588 | cancel: function(click) {
589 | return this.each(function() {
590 | var self = $(this);
591 |
592 | if (self.data('readonly') !== true) {
593 | methods[click ? 'click' : 'score'].call(self, null);
594 |
595 | this.score.removeAttr('value');
596 | }
597 | });
598 | },
599 |
600 | click: function(score) {
601 | return this.each(function() {
602 | if ($(this).data('readonly') !== true) {
603 | score = methods._adjustedScore.call(this, score);
604 |
605 | methods._apply.call(this, score);
606 |
607 | if (this.opt.click) {
608 | this.opt.click.call(this, score, $.Event('click'));
609 | }
610 |
611 | methods._target.call(this, score);
612 | }
613 | });
614 | },
615 |
616 | destroy: function() {
617 | return this.each(function() {
618 | var
619 | self = $(this),
620 | raw = self.data('raw');
621 |
622 | if (raw) {
623 | self.off('.raty').empty().css({ cursor: raw.style.cursor }).removeData('readonly');
624 | } else {
625 | self.data('raw', self.clone()[0]);
626 | }
627 | });
628 | },
629 |
630 | getScore: function() {
631 | var
632 | score = [],
633 | value ;
634 |
635 | this.each(function() {
636 | value = this.score.val();
637 |
638 | score.push(value ? +value : undefined);
639 | });
640 |
641 | return (score.length > 1) ? score : score[0];
642 | },
643 |
644 | move: function(score) {
645 | return this.each(function() {
646 | var
647 | integer = parseInt(score, 10),
648 | decimal = methods._getFirstDecimal.call(this, score);
649 |
650 | if (integer >= this.opt.number) {
651 | integer = this.opt.number - 1;
652 | decimal = 10;
653 | }
654 |
655 | var
656 | width = methods._getWidth.call(this),
657 | steps = width / 10,
658 | star = $(this.stars[integer]),
659 | percent = star.offset().left + steps * decimal,
660 | evt = $.Event('mousemove', { pageX: percent });
661 |
662 | this.move = true;
663 |
664 | star.trigger(evt);
665 |
666 | this.move = false;
667 | });
668 | },
669 |
670 | readOnly: function(readonly) {
671 | return this.each(function() {
672 | var self = $(this);
673 |
674 | if (self.data('readonly') !== readonly) {
675 | if (readonly) {
676 | self.off('.raty').children(this.opt.starType).off('.raty');
677 |
678 | methods._lock.call(this);
679 | } else {
680 | methods._binds.call(this);
681 | methods._unlock.call(this);
682 | }
683 |
684 | self.data('readonly', readonly);
685 | }
686 | });
687 | },
688 |
689 | reload: function() {
690 | return methods.set.call(this, {});
691 | },
692 |
693 | score: function() {
694 | var self = $(this);
695 |
696 | return arguments.length ? methods.setScore.apply(self, arguments) : methods.getScore.call(self);
697 | },
698 |
699 | set: function(options) {
700 | return this.each(function() {
701 | $(this).raty($.extend({}, this.opt, options));
702 | });
703 | },
704 |
705 | setScore: function(score) {
706 | return this.each(function() {
707 | if ($(this).data('readonly') !== true) {
708 | score = methods._adjustedScore.call(this, score);
709 |
710 | methods._apply.call(this, score);
711 | methods._target.call(this, score);
712 | }
713 | });
714 | }
715 | };
716 |
717 | $.fn.raty = function(method) {
718 | if (methods[method]) {
719 | return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
720 | } else if (typeof method === 'object' || !method) {
721 | return methods.init.apply(this, arguments);
722 | } else {
723 | $.error('Method ' + method + ' does not exist!');
724 | }
725 | };
726 |
727 | $.fn.raty.defaults = {
728 | cancel: false,
729 | cancelClass: 'raty-cancel',
730 | cancelHint: 'Cancel this rating!',
731 | cancelOff: 'cancel-off.png',
732 | cancelOn: 'cancel-on.png',
733 | cancelPlace: 'left',
734 | click: undefined,
735 | half: false,
736 | halfShow: true,
737 | hints: ['bad', 'poor', 'regular', 'good', 'gorgeous'],
738 | iconRange: undefined,
739 | mouseout: undefined,
740 | mouseover: undefined,
741 | noRatedMsg: 'Not rated yet!',
742 | number: 5,
743 | numberMax: 20,
744 | path: undefined,
745 | precision: false,
746 | readOnly: false,
747 | round: { down: 0.25, full: 0.6, up: 0.76 },
748 | score: undefined,
749 | scoreName: 'score',
750 | single: false,
751 | space: true,
752 | starHalf: 'star-half.png',
753 | starOff: 'star-off.png',
754 | starOn: 'star-on.png',
755 | starType: 'img',
756 | target: undefined,
757 | targetFormat: '{score}',
758 | targetKeep: false,
759 | targetScore: undefined,
760 | targetText: '',
761 | targetType: 'hint'
762 | };
763 | })(jQuery);
764 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/jquery.raty.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery Raty - A Star Rating Plugin
3 | *
4 | * Licensed under The MIT License
5 | *
6 | * @version 2.5.2
7 | * @author Washington Botelho
8 | * @documentation wbotelhos.com/raty
9 | *
10 | */
11 |
12 | ;(function(b){var a={init:function(c){return this.each(function(){a.destroy.call(this);this.opt=b.extend(true,{},b.fn.raty.defaults,c);var e=b(this),g=["number","readOnly","score","scoreName"];a._callback.call(this,g);if(this.opt.precision){a._adjustPrecision.call(this);}this.opt.number=a._between(this.opt.number,0,this.opt.numberMax);this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)!=="/"){this.opt.path+="/";}this.stars=a._createStars.call(this);this.score=a._createScore.call(this);a._apply.call(this,this.opt.score);var f=this.opt.space?4:0,d=this.opt.width||(this.opt.number*this.opt.size+this.opt.number*f);if(this.opt.cancel){this.cancel=a._createCancel.call(this);d+=(this.opt.size+f);}if(this.opt.readOnly){a._lock.call(this);}else{e.css("cursor","pointer");a._binds.call(this);}if(this.opt.width!==false){e.css("width",d);}a._target.call(this,this.opt.score);e.data({settings:this.opt,raty:true});});},_adjustPrecision:function(){this.opt.targetType="score";this.opt.half=true;},_apply:function(c){if(c&&c>0){c=a._between(c,0,this.opt.number);this.score.val(c);}a._fill.call(this,c);if(c){a._roundStars.call(this,c);}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},_binds:function(){if(this.cancel){a._bindCancel.call(this);}a._bindClick.call(this);a._bindOut.call(this);a._bindOver.call(this);},_bindCancel:function(){a._bindClickCancel.call(this);a._bindOutCancel.call(this);a._bindOverCancel.call(this);},_bindClick:function(){var c=this,d=b(c);c.stars.on("click.raty",function(e){c.score.val((c.opt.half||c.opt.precision)?d.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,parseFloat(c.score.val()),e);}});},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d);}});},_bindOut:function(){var c=this;b(this).on("mouseleave.raty",function(d){var e=parseFloat(c.score.val())||undefined;a._apply.call(c,e);a._target.call(c,e,d);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d);}});},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseout){c.opt.mouseout.call(c,c.score.val()||null,d);}});},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}});},_bindOver:function(){var c=this,d=b(c),e=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(e,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),j=(f>0.5)?1:0.5;h=h-1+j;a._fill.call(c,h);if(c.opt.precision){h=h-j+f;}a._roundStars.call(c,h);d.data("score",h);}else{a._fill.call(c,h);}a._target.call(c,h,g);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}});},_callback:function(c){for(i in c){if(typeof this.opt[c[i]]==="function"){this.opt[c[i]]=this.opt[c[i]].call(this);}}},_createCancel:function(){var e=b(this),c=this.opt.path+this.opt.cancelOff,d=b("
",{src:c,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});if(this.opt.cancelPlace=="left"){e.prepend(" ").prepend(d);}else{e.append(" ").append(d);}return d;},_createScore:function(){return b("",{type:"hidden",name:this.opt.scoreName}).appendTo(this);},_createStars:function(){var e=b(this);for(var c=1;c<=this.opt.number;c++){var f=a._getHint.call(this,c),d=(this.opt.score&&this.opt.score>=c)?"starOn":"starOff";d=this.opt.path+this.opt[d];b("
",{src:d,alt:c,title:f}).appendTo(this);if(this.opt.space){e.append((ce){var j=m.opt.iconRange[e],h=j.on||m.opt.starOn,c=j.off||m.opt.starOff,k=l?h:c;if(f<=j.range){g.attr("src",m.opt.path+k);}if(f==j.range){e++;}}else{var k=l?"starOn":"starOff";g.attr("src",this.opt.path+this.opt[k]);}}},_getHint:function(d){var c=this.opt.hints[d-1];return(c==="")?"":(c||d);},_lock:function(){var d=parseInt(this.score.val(),10),c=d?a._getHint.call(this,d):this.opt.noRatedMsg;b(this).data("readonly",true).css("cursor","").attr("title",c);this.score.attr("readonly","readonly");this.stars.attr("title",c);if(this.cancel){this.cancel.hide();}},_roundStars:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c="starOn";if(this.opt.halfShow&&d1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this);}else{a._binds.call(this);a._unlock.call(this);}d.data("readonly",c);}});},reload:function(){return a.set.call(this,{});},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){return this.each(function(){var e=b(this),f=e.data("settings"),d=b.extend({},f,c);e.raty(d);});},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);a._target.call(this,c);}});}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,size:16,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery);
13 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/jquery.star-rating-svg.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery StarRatingSvg v0.9.5
3 | *
4 | * http://github.com/nashio/star-rating-svg
5 | * Author: Ignacio Chavez
6 | * Licensed under MIT
7 | */
8 |
9 | ;(function ( $, window, document, undefined ) {
10 |
11 | 'use strict';
12 |
13 | // Create the defaults once
14 | var pluginName = 'starRating';
15 | var defaults = {
16 | totalStars: 5,
17 | useFullStars: false,
18 | emptyColor: 'lightgray',
19 | hoverColor: 'orange',
20 | activeColor: 'gold',
21 | useGradient: true,
22 | readonly: false,
23 | disableAfterRate: true,
24 | starGradient: {
25 | start: '#FEF7CD',
26 | end: '#FF9511'
27 | },
28 | strokeWidth: 0,
29 | strokeColor: 'black',
30 | initialRating: 0,
31 | starSize: 40
32 | };
33 |
34 | // The actual plugin constructor
35 | var Plugin = function( element, options ) {
36 | var _rating;
37 | this.element = element;
38 | this.$el = $(element);
39 | this.settings = $.extend( {}, defaults, options );
40 |
41 | // grab rating if defined on the element
42 | _rating = this.$el.data('rating') || this.settings.initialRating;
43 | this._state = {
44 | // round to the nearest half
45 | rating: (Math.round( _rating * 2 ) / 2).toFixed(1)
46 | };
47 |
48 | // create unique id for stars
49 | this._uid = Math.floor( Math.random() * 999 );
50 |
51 | // override gradient if not used
52 | if( !options.starGradient && !this.settings.useGradient ){
53 | this.settings.starGradient.start = this.settings.starGradient.end = this.settings.activeColor;
54 | }
55 |
56 | this._defaults = defaults;
57 | this._name = pluginName;
58 | this.init();
59 | };
60 |
61 | var methods = {
62 | init: function () {
63 | this.renderMarkup();
64 | this.addListeners();
65 | this.initRating();
66 | },
67 |
68 | addListeners: function(){
69 | if( this.settings.readOnly ){ return; }
70 | this.$stars.on('mouseover', this.hoverRating.bind(this));
71 | this.$stars.on('mouseout', this.restoreState.bind(this));
72 | this.$stars.on('click', this.applyRating.bind(this));
73 | },
74 |
75 | // apply styles to hovered stars
76 | hoverRating: function(e){
77 | this.paintStars(this.getIndex(e), 'hovered');
78 | },
79 |
80 | // clicked on a rate, apply style and state
81 | applyRating: function(e){
82 | var index = this.getIndex(e);
83 | var rating = index + 1;
84 |
85 | // paint selected and remove hovered color
86 | this.paintStars(index, 'active');
87 | this.executeCallback( rating, this.$el );
88 | this._state.rating = rating;
89 |
90 | if(this.settings.disableAfterRate){
91 | this.$stars.off();
92 | }
93 | },
94 |
95 | restoreState: function(){
96 | var rating = this._state.rating || -1;
97 | this.paintStars(rating - 1, 'active');
98 | },
99 |
100 | getIndex: function(e){
101 | var $target = $(e.currentTarget);
102 | var width = $target.width();
103 | var side = ( e.offsetX < (width / 2) && !this.settings.useFullStars) ? 'left' : 'right';
104 |
105 | // get index for half or whole star
106 | var index = $target.index() - ((side === 'left') ? 0.5 : 0);
107 |
108 | // pointer is way to the left, rating should be none
109 | index = ( index < 0 && (e.offsetX < width / 5) ) ? -1 : index;
110 | return index;
111 | },
112 |
113 | initRating: function(){
114 | this.paintStars(this._state.rating - 1, 'active');
115 | },
116 |
117 | paintStars: function(endIndex, stateClass){
118 | var $polygonLeft;
119 | var $polygonRight;
120 | var leftClass;
121 | var rightClass;
122 |
123 | $.each(this.$stars, function(index, star){
124 | $polygonLeft = $(star).find('polygon[data-side="left"]');
125 | $polygonRight = $(star).find('polygon[data-side="right"]');
126 | leftClass = rightClass = (index <= endIndex) ? stateClass : 'empty';
127 |
128 | // has another half rating, add half star
129 | leftClass = ( index - endIndex === 0.5 ) ? stateClass : leftClass;
130 |
131 | $polygonLeft.attr('class', 'svg-' + leftClass + '-' + this._uid);
132 | $polygonRight.attr('class', 'svg-' + rightClass + '-' + this._uid);
133 |
134 | }.bind(this));
135 | },
136 |
137 | renderMarkup: function () {
138 | // inject an svg manually to have control over attributes
139 | var star = '';
146 |
147 | // inject svg markup
148 | var starsMarkup = '';
149 | for( var i = 0; i < this.settings.totalStars; i++){
150 | starsMarkup += star;
151 | }
152 | this.$el.append(starsMarkup);
153 | this.$stars = this.$el.find('.jq-star');
154 | },
155 |
156 | getLinearGradient: function(id, startColor, endColor){
157 | return ' ';
158 | },
159 |
160 | executeCallback: function(rating, $el){
161 | var callback = this.settings.callback;
162 | if( $.isFunction( callback ) ){
163 | callback(rating, $el);
164 | }
165 | }
166 |
167 | };
168 |
169 | var publicMethods = {
170 |
171 | unload: function(){
172 | var _name = 'plugin_' + pluginName;
173 | var $el = $(this);
174 | var $star = $el.data(_name).$star;
175 | $el.removeData(_name);
176 | $star.off();
177 | }
178 |
179 | };
180 |
181 |
182 | // Avoid Plugin.prototype conflicts
183 | $.extend(Plugin.prototype, methods);
184 |
185 | $.fn[ pluginName ] = function ( options ) {
186 |
187 | // if options is a public method
188 | if( !$.isPlainObject(options) ){
189 | if( publicMethods.hasOwnProperty(options) ){
190 | publicMethods[options].apply(this);
191 | return;
192 | }
193 | }
194 |
195 | return this.each(function() {
196 | // preventing against multiple instantiations
197 | if ( !$.data( this, 'plugin_' + pluginName ) ) {
198 | $.data( this, 'plugin_' + pluginName, new Plugin( this, options ) );
199 | }
200 | });
201 | };
202 |
203 | })( jQuery, window, document );
204 |
205 |
206 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/js/starScore.js:
--------------------------------------------------------------------------------
1 | function scoreFun(object,opts){
2 | // 默认属性
3 | var defaults={
4 | fen_d:6, // 每个a的宽度
5 | ScoreGrade:10, // a的个数
6 | types:["喜欢",
7 | "还行",
8 | "不喜欢"],
9 | nameScore:"fenshu",
10 | parent:"star_score"};
11 | options=$.extend({},defaults,opts);
12 | var countScore=object.find("."+options.nameScore); // 找到名为“fenshu”的类
13 | var startParent=object.find("."+options.parent); // 找到名为“star_score”的类
14 | var now_cli;
15 | var fen_cli;
16 | var atu;
17 | var fen_d=options.fen_d; // 每个a的宽度
18 | var len=options.ScoreGrade; // 把a的个数赋值给len
19 | startParent.width(fen_d*len); //包含a的div盒子的宽度
20 | var preA=(5/len);
21 | for(var i=0;i"); // 不整体刷新页面的情况下,可以使用void(0)
23 | newSpan.css({"left":0,"width":fen_d*(i+1),"z-index":len-i}); // 设置a的宽度、层级
24 | newSpan.appendTo(startParent)
25 | } // 把a放到类名为“star_score”的div里
26 | startParent.find("a").each( // each()方法
27 | function(index,element){
28 | $(this).click(function(){ // 点击事件
29 | now_cli=index; // 当前a的索引值
30 | show(index,$(this)) // 调用show方法
31 | });
32 | $(this).mouseenter(function(){ /* mouseenter事件(与 mouseover 事件不同,只有在鼠标指针穿过被选元素时,
33 | 才会触发 mouseenter 事件。如果鼠标指针穿过任何子元素,同样会触发 mouseover 事件。) */
34 | show(index,$(this))
35 | });
36 | $(this).mouseleave(function(){ // mouseleave事件
37 | if(now_cli>=0){
38 | var scor=preA*(parseInt(now_cli)+1); // 评分
39 | startParent.find("a").removeClass("clibg"); // 清除a的“clibg”类
40 | startParent.find("a").eq(now_cli).addClass("clibg"); // eq()选择器,选取索引值为“now_cli”的a,给它加上“clibg”类
41 | var ww=fen_d*(parseInt(now_cli)+1); // 当前a的宽度
42 | startParent.find("a").eq(now_cli).css({"width":ww,"left":"0"}); // 给索引值为“now_cli”的a加上宽度“ww”和left值
43 | if(countScore){
44 | countScore.text(scor)
45 | }
46 | }else{
47 | startParent.find("a").removeClass("clibg");
48 | if(countScore){
49 | countScore.text("")
50 | }
51 | }
52 | })
53 | });
54 |
55 | // show方法
56 | function show(num,obj){
57 | var n=parseInt(num)+1;
58 | var lefta=num*fen_d;
59 | var ww=fen_d*n;
60 | var scor=preA*n; // 评分
61 | object.find("a").removeClass("clibg"); // 清除所有a的“clibg”类
62 | obj.addClass("clibg"); // 给当前a添加“clibg”类
63 | obj.css({"width":ww,"left":"0"}); // 给当前a添加宽度“ww”和left值
64 | countScore.text(scor); // 显示评分
65 | }
66 | };
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/users_resulttable.csv:
--------------------------------------------------------------------------------
1 | 1001,1372692,5.0
2 | 1001,1187043,4.5
3 | 1002,1372692,4.0
4 | 1002,2186715,3.5
5 | 1002,1229238,4.0
6 | 1002,3540136,4.5
7 | 1001,2414370,4.5
8 | 1001,1187043,4.0
9 | 1001,4600952,3.5
10 | 1002,4644382,3.5
11 | 1002,113198,4.0
12 | 1002,111161,4.0
13 | 1003,1187043,4.5
14 | 1003,188766,5.0
15 | 1003,5290882,4.5
16 | 1003,105859,5.0
17 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/static/users_resulttable2.csv:
--------------------------------------------------------------------------------
1 | 1001,1372692,5.0
2 | 1001,1187043,4.5
3 | 1002,1372692,4.0
4 | 1002,2186715,3.5
5 | 1002,1229238,4.0
6 | 1002,3540136,4.5
7 | 1001,2414370,4.5
8 | 1001,1187043,4.0
9 | 1001,4600952,3.5
10 | 1002,4644382,3.5
11 | 1002,113198,4.0
12 | 1002,111161,4.0
13 | 1003,1187043,4.5
14 | 1003,188766,5.0
15 | 1003,5290882,4.5
16 | 1003,105859,5.0
17 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls import url
2 | from . import views
3 |
4 | app_name = 'users'
5 | urlpatterns = [
6 | url(r'^register/', views.register, name='register'),
7 | url(r'^showmessage/', views.showmessage, name='showmessage'),
8 |
9 | ]
--------------------------------------------------------------------------------
/项目源码/movierecommend/users/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render, redirect,HttpResponseRedirect
2 | from .forms import RegisterForm
3 | from users.models import Resulttable,Insertposter
4 | from django.db import models
5 |
6 | def register(request):
7 | # 只有当请求为 POST 时,才表示用户提交了注册信息
8 | if request.method == 'POST':
9 | form = RegisterForm(request.POST)
10 |
11 | # 验证数据的合法性
12 | if form.is_valid():
13 | # 如果提交数据合法,调用表单的 save 方法将用户数据保存到数据库
14 | form.save()
15 |
16 | # 注册成功,跳转回首页
17 | return redirect('/')
18 | else:
19 | # 请求不是 POST,表明用户正在访问注册页面,展示一个空的注册表单给用户
20 | form = RegisterForm()
21 |
22 | # 渲染模板
23 | # 如果用户正在访问注册页面,则渲染的是一个空的注册表单
24 | # 如果用户通过表单提交注册信息,但是数据验证不合法,则渲染的是一个带有错误信息的表单
25 | return render(request, 'users/register.html', context={'form': form})
26 |
27 | def index(request):
28 | return render(request, 'users/..//index.html')
29 | # 为啥?
30 |
31 | def check(request):
32 | return render((request, 'users/..//index.html'))
33 | # def showregist(request):
34 | # pass
35 |
36 |
37 | def showmessage(request):
38 | usermovieid = []
39 | usermovietitle = []
40 | data=Resulttable.objects.filter(userId=1001)
41 | for row in data:
42 | usermovieid.append(row.imdbId)
43 |
44 | try:
45 | conn = get_conn()
46 | cur = conn.cursor()
47 | #Insertposter.objects.filter(userId=USERID).delete()
48 | for i in usermovieid:
49 | cur.execute('select * from moviegenre3 where imdbId = %s',i)
50 | rr = cur.fetchall()
51 | for imdbId,title,poster in rr:
52 | usermovietitle.append(title)
53 | print(title)
54 |
55 | # print(poster_result)
56 | finally:
57 | conn.close()
58 | return render(request, 'users/message.html', locals())
59 |
60 |
61 | # USERID = 1002
62 | def recommend1(request):
63 | USERID = int(request.GET["userIdd"]) + 1000
64 | Insertposter.objects.filter(userId=USERID).delete()
65 | #selectMysql()
66 | read_mysql_to_csv('users/static/users_resulttable.csv',USERID) #追加数据,提高速率
67 | ratingfile = os.path.join('users/static', 'users_resulttable.csv')
68 | usercf = UserBasedCF()
69 | #userid = '1001'
70 | userid = str(USERID)#得到了当前用户的id
71 | print(userid)
72 | usercf.generate_dataset(ratingfile)
73 | usercf.calc_user_sim()
74 | usercf.recommend(userid) #得到imdbId号
75 |
76 | #先删除所有数据
77 |
78 |
79 | try:
80 | conn = get_conn()
81 | cur = conn.cursor()
82 | #Insertposter.objects.filter(userId=USERID).delete()
83 | for i in matrix:
84 | cur.execute('select * from moviegenre3 where imdbId = %s',i)
85 | rr = cur.fetchall()
86 | for imdbId,title,poster in rr:
87 | #print(value) #value才是真正的海报链接
88 | if(Insertposter.objects.filter(title=title)):
89 | continue
90 | else:
91 | Insertposter.objects.create(userId=USERID, title=title, poster=poster)
92 |
93 | # print(poster_result)
94 | finally:
95 | conn.close()
96 | #results = Insertposter.objects.all() #从这里传递给html= Insertposter.objects.all() # 从这里传递给html
97 | results = Insertposter.objects.filter(userId=USERID)
98 | return render(request,'users/movieRecommend.html', locals())
99 | # return render(request, 'users/..//index.html', locals())
100 |
101 |
102 | def recommend2(request):
103 | USERID = int(request.GET["userIddd"]) + 1000
104 | #USERID = 1001
105 | Insertposter.objects.filter(userId=USERID).delete()
106 | #selectMysql()
107 | #read_mysql_to_csv2('users/static/users_resulttable2.csv',USERID) #追加数据,提高速率
108 | read_mysql_to_csv2('users/static/users_resulttable2.csv') # 追加数据,提高速率
109 | ratingfile2 = os.path.join('users/static', 'users_resulttable2.csv')
110 | itemcf = ItemBasedCF()
111 | #userid = '1001'
112 | userid = str(USERID)#得到了当前用户的id
113 | print(userid)
114 | itemcf.generate_dataset(ratingfile2)
115 | itemcf.calc_movie_sim()
116 | itemcf.recommend(userid) #得到imdbId号
117 |
118 | #先删除所有数据
119 |
120 |
121 | try:
122 | conn = get_conn()
123 | cur = conn.cursor()
124 | #Insertposter.objects.filter(userId=USERID).delete()
125 | for i in matrix2:
126 | cur.execute('select * from moviegenre3 where imdbId = %s',i)
127 | rr = cur.fetchall()
128 | for imdbId,title,poster in rr:
129 | #print(value) #value才是真正的海报链接
130 | if(Insertposter.objects.filter(title=title)):
131 | continue
132 | else:
133 | Insertposter.objects.create(userId=USERID, title=title, poster=poster)
134 |
135 | # print(poster_result)
136 | finally:
137 | conn.close()
138 | results = Insertposter.objects.filter(userId=USERID) #从这里传递给html= Insertposter.objects.all() # 从这里传递给html
139 |
140 | return render(request, 'users/movieRecommend2.html',locals())
141 | # return HttpResponseRedirect('movieRecommend.html', locals())
142 |
143 |
144 |
145 |
146 |
147 |
148 | def insert(request):
149 | # MOVIEID = int(request.GET["movieId"])
150 | global USERID
151 | USERID = int(request.GET["userId"])+1000
152 | # USERID = {{}}
153 | RATING = float(request.GET["rating"])
154 | IMDBID = int(request.GET["imdbId"])
155 |
156 | Resulttable.objects.create(userId=USERID, rating=RATING,imdbId=IMDBID)
157 | #print(USERID)
158 | # return HttpResponseRedirect('/')
159 | return render(request, 'index.html',{'userId':USERID,'rating':RATING,'imdbId':IMDBID})
160 |
161 |
162 |
163 | import sys
164 | import random
165 | import os,math
166 | from operator import itemgetter
167 | import pymysql
168 | import csv
169 | from django.http import HttpResponse
170 | import codecs
171 |
172 |
173 | def get_conn():
174 | conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='123456', db='haha', charset='utf8')
175 | return conn
176 |
177 | def query_all(cur, sql, args):
178 | cur.execute(sql, args)
179 | return cur.fetchall()
180 |
181 | def read_mysql_to_csv(filename,user):
182 | with codecs.open(filename=filename, mode='w', encoding='utf-8') as f:
183 | write = csv.writer(f, dialect='excel')
184 | conn = get_conn()
185 | cur = conn.cursor()
186 | cur.execute('select * from users_resulttable')
187 | #sql = ('select * from users_resulttable WHERE userId = 1001')
188 | rr = cur.fetchall()
189 | #results = query_all(cur=cur, sql=sql, args=None)
190 | for result in rr:
191 | #print(result)
192 | #write.writerow(result[:-1])
193 | write.writerow(result[1:])
194 |
195 |
196 | #def read_mysql_to_csv2(filename,user):
197 | def read_mysql_to_csv2(filename):
198 | #with codecs.open(filename=filename, mode='a', encoding='utf-8') as f:
199 | with codecs.open(filename=filename, mode='w', encoding='utf-8') as f:
200 | write = csv.writer(f, dialect='excel')
201 | conn = get_conn()
202 | cur = conn.cursor()
203 | cur.execute('select * from users_resulttable')
204 | #sql = ('select * from users_resulttable WHERE userId = 1001')
205 | sql = ('select * from users_resulttable')
206 | rr = cur.fetchall()
207 | results = query_all(cur=cur, sql=sql, args=None)
208 | for result in results:
209 | #print(result)
210 | #write.writerow(result[:-1])
211 | write.writerow(result[1:])
212 |
213 |
214 |
215 |
216 |
217 | # if __name__ == '__main__':
218 | # # main()
219 | # read_mysql_to_csv('../users/static/users_resulttable.csv')
220 | #
221 |
222 |
223 | import sys
224 | import random
225 | import math
226 | import os
227 | from operator import itemgetter
228 |
229 | random.seed(0)
230 | user_sim_mat = {}
231 | matrix = [] #全局变量
232 | matrix2 = []
233 |
234 | class UserBasedCF(object):
235 | ''' TopN recommendation - User Based Collaborative Filtering '''
236 |
237 | def __init__(self):
238 | self.trainset = {} # 训练集
239 | self.testset = {} # 测试集
240 | self.initialset = {} # 存储要推荐的用户的信息
241 | self.n_sim_user = 10
242 | self.n_rec_movie = 5
243 |
244 | self.movie_popular = {}
245 | self.movie_count = 0 # 总电影数量
246 |
247 | print('Similar user number = %d' % self.n_sim_user, file=sys.stderr)
248 | print('recommended movie number = %d' %
249 | self.n_rec_movie, file=sys.stderr)
250 |
251 | @staticmethod
252 | def loadfile(filename):
253 | ''' load a file, return a generator. '''
254 | fp = open(filename, 'r', encoding='UTF-8')
255 | for i, line in enumerate(fp):
256 | yield line.strip('\r\n')
257 | # if i % 100000 == 0:
258 | # print ('loading %s(%s)' % (filename, i), file=sys.stderr)
259 | fp.close()
260 | print('load %s success' % filename, file=sys.stderr)
261 |
262 | def initial_dataset(self, filename1):
263 | initialset_len = 0
264 | for lines in self.loadfile(filename1):
265 | users, movies, ratings = lines.split(',')
266 | self.initialset.setdefault(users, {})
267 | self.initialset[users][movies] = (ratings)
268 | initialset_len += 1
269 |
270 | def generate_dataset(self, filename2, pivot=1.0):
271 | ''' load rating data and split it to training set and test set '''
272 | trainset_len = 0
273 | testset_len = 0
274 |
275 | for line in self.loadfile(filename2):
276 | # user, movie, rating, _ = line.split('::')
277 | user, movie, rating = line.split(',')
278 | # split the data by pivot
279 | if random.random() < pivot: # pivot=0.7应该表示训练集:测试集=7:3
280 | self.trainset.setdefault(user, {})
281 | self.trainset[user][movie] = (rating) # trainset[user][movie]可以获取用户对电影的评分 都是整数
282 | trainset_len += 1
283 | else:
284 | self.testset.setdefault(user, {})
285 | self.testset[user][movie] = (rating)
286 | testset_len += 1
287 |
288 | print('split training set and test set succ', file=sys.stderr)
289 | print('train set = %s' % trainset_len, file=sys.stderr)
290 | print('test set = %s' % testset_len, file=sys.stderr)
291 |
292 | def calc_user_sim(self):
293 | movie2users = dict()
294 |
295 | for user, movies in self.trainset.items():
296 | for movie in movies:
297 | # inverse table for item-users
298 | if movie not in movie2users:
299 | movie2users[movie] = set()
300 | movie2users[movie].add(user) # 看这个电影的用户id
301 | # print(movie) #输出的是movieId
302 | # print(movie2users[movie]) #输出的是{'userId'...}
303 | # print(movie2users) #movieId:{'userId','userId'...}
304 |
305 | # count item popularity at the same time
306 | if movie not in self.movie_popular:
307 | self.movie_popular[movie] = 0
308 | self.movie_popular[movie] += 1
309 | # print ('build movie-users inverse table succ', file=sys.stderr)
310 |
311 | # save the total movie number, which will be used in evaluation
312 | self.movie_count = len(movie2users)
313 | print('total movie number = %d' % self.movie_count, file=sys.stderr)
314 |
315 | # count co-rated items between users 计算用户之间共同评分的物品
316 | usersim_mat = user_sim_mat
317 | # print ('building user co-rated movies matrix...', file=sys.stderr)
318 |
319 | for movie, users in movie2users.items(): # 通过.items()遍历movie2users这个字典里的所有键、值
320 | for u in users:
321 | for v in users:
322 | if u == v:
323 | continue
324 | usersim_mat.setdefault(u, {})
325 | usersim_mat[u].setdefault(v, 0)
326 | usersim_mat[u][v] += 1 / math.log(1 + len(users)) # usersim_mat二维矩阵应该存的是用户u和用户v之间共同评分的电影数目
327 | # print ('build user co-rated movies matrix succ', file=sys.stderr)
328 |
329 | # calculate similarity matrix
330 | # print ('calculating user similarity matrix...', file=sys.stderr)
331 | simfactor_count = 0
332 | PRINT_STEP = 20000
333 |
334 | for u, related_users in usersim_mat.items():
335 | for v, count in related_users.items():
336 | usersim_mat[u][v] = count / math.sqrt(
337 | len(self.trainset[u]) * len(self.trainset[v]))
338 | simfactor_count += 1
339 |
340 |
341 | def recommend(self, user):
342 | ''' Find K similar users and recommend N movies. '''
343 | matrix.clear() #每次都要清空
344 | K = self.n_sim_user # 这里等于20
345 | N = self.n_rec_movie # 这里等于10
346 | rank = dict() # 用户对电影的兴趣度
347 | # print(self.initialset[user])
348 | watched_movies = self.trainset[user] # user用户已经看过的电影 只包括训练集里的
349 | # 这里之后不能是训练集
350 | # watched_movies = self.initialset[user]
351 | for similar_user, similarity_factor in sorted(user_sim_mat[user].items(),
352 | key=itemgetter(1), reverse=True)[
353 | 0:K]: # itemgetter(1)表示对第2个域(相似度)排序 reverse=TRUE表示降序
354 | for imdbid in self.trainset[similar_user]: # similar_user是items里面的键,就是所有用户 similarity_factor是值,就是对应的相似度
355 | if imdbid in watched_movies:
356 | continue # 如果该电影用户已经看过,则跳过
357 | # predict the user's "interest" for each movie
358 | rank.setdefault(imdbid, 0) # 没有值就为0
359 | rank[imdbid] += similarity_factor #rank[movie]就是各个电影的相似度
360 | # 这里是把和各个用户的相似度加起来,而各个用户的相似度只是基于看过的公共电影数目除以这两个用户看过的电影数量积
361 | #print(rank[movie])
362 | # return the N best movies
363 | # rank_ = dict()
364 | rank_ = sorted(rank.items(), key=itemgetter(1), reverse=True)[0:N] #类型是list不是字典了
365 | for key,value in rank_:
366 | matrix.append(key) #matrix为存储推荐的imdbId号的数组
367 | #print(key) #得到了推荐的电影的imdbid号
368 | print(matrix)
369 | #return sorted(rank.items(), key=itemgetter(1), reverse=True)[0:N]
370 | return matrix
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 | # class UserBasedCF(object):
379 | # ''' TopN recommendation - User Based Collaborative Filtering '''
380 | #
381 | # def __init__(self):
382 | # self.trainset = {} # 训练集
383 | # self.testset = {} # 测试集
384 | # self.initialset = {} # 存储要推荐的用户的信息
385 | # self.n_sim_user = 50
386 | # self.n_rec_movie = 10
387 | #
388 | # self.movie_popular = {}
389 | # self.movie_count = 0 # 总电影数量
390 | #
391 | # print('Similar user number = %d' % self.n_sim_user, file=sys.stderr)
392 | # print('recommended movie number = %d' %
393 | # self.n_rec_movie, file=sys.stderr)
394 | #
395 | # @staticmethod
396 | # def loadfile(filename):
397 | # ''' load a file, return a generator. '''
398 | # fp = open(filename, 'r', encoding='UTF-8')
399 | # for i, line in enumerate(fp):
400 | # yield line.strip('\r\n')
401 | # # if i % 100000 == 0:
402 | # # print ('loading %s(%s)' % (filename, i), file=sys.stderr)
403 | # fp.close()
404 | # print('load %s success' % filename, file=sys.stderr)
405 | #
406 | # def initial_dataset(self, filename1):
407 | # initialset_len = 0
408 | # for lines in self.loadfile(filename1):
409 | # users, movies, ratings = lines.split(',')
410 | # self.initialset.setdefault(users, {})
411 | # self.initialset[users][movies] = (ratings)
412 | # initialset_len += 1
413 | #
414 | # def generate_dataset(self, filename2, pivot=0.7):
415 | # ''' load rating data and split it to training set and test set '''
416 | # trainset_len = 0
417 | # testset_len = 0
418 | #
419 | # for line in self.loadfile(filename2):
420 | # # user, movie, rating, _ = line.split('::')
421 | # user, movie, rating = line.split(',')
422 | # # split the data by pivot
423 | # if random.random() < pivot: # pivot=0.7应该表示训练集:测试集=7:3
424 | # self.trainset.setdefault(user, {})
425 | # self.trainset[user][movie] = (rating) # trainset[user][movie]可以获取用户对电影的评分 都是整数
426 | # trainset_len += 1
427 | # else:
428 | # self.testset.setdefault(user, {})
429 | # self.testset[user][movie] = (rating)
430 | # testset_len += 1
431 | #
432 | # print('split training set and test set succ', file=sys.stderr)
433 | # print('train set = %s' % trainset_len, file=sys.stderr)
434 | # print('test set = %s' % testset_len, file=sys.stderr)
435 | #
436 | # def calc_user_sim(self):
437 | # ''' calculate user similarity matrix '''
438 | # # build inverse table for item-users
439 | # # key=movieID, value=list of userIDs who have seen this movie
440 | # # print ('building movie-users inverse table...', file=sys.stderr)
441 | # movie2users = dict()
442 | #
443 | # for user, movies in self.trainset.items():
444 | # for movie in movies:
445 | # # inverse table for item-users
446 | # if movie not in movie2users:
447 | # movie2users[movie] = set()
448 | # movie2users[movie].add(user) # 看这个电影的用户id
449 | # # print(movie) #输出的是movieId
450 | # # print(movie2users[movie]) #输出的是{'userId'...}
451 | # # print(movie2users) #movieId:{'userId','userId'...}
452 | #
453 | # # count item popularity at the same time
454 | # if movie not in self.movie_popular:
455 | # self.movie_popular[movie] = 0
456 | # self.movie_popular[movie] += 1
457 | # # print ('build movie-users inverse table succ', file=sys.stderr)
458 | #
459 | # # save the total movie number, which will be used in evaluation
460 | # self.movie_count = len(movie2users)
461 | # print('total movie number = %d' % self.movie_count, file=sys.stderr)
462 | #
463 | # # count co-rated items between users 计算用户之间共同评分的物品
464 | # usersim_mat = user_sim_mat
465 | # # print ('building user co-rated movies matrix...', file=sys.stderr)
466 | #
467 | # for movie, users in movie2users.items(): # 通过.items()遍历movie2users这个字典里的所有键、值
468 | # for u in users:
469 | # for v in users:
470 | # if u == v:
471 | # continue
472 | # usersim_mat.setdefault(u, {})
473 | # usersim_mat[u].setdefault(v, 0)
474 | # usersim_mat[u][v] += 1 / math.log(1 + len(users)) # usersim_mat二维矩阵应该存的是用户u和用户v之间共同评分的电影数目
475 | # # print ('build user co-rated movies matrix succ', file=sys.stderr)
476 | #
477 | # # calculate similarity matrix
478 | # # print ('calculating user similarity matrix...', file=sys.stderr)
479 | # simfactor_count = 0
480 | # PRINT_STEP = 20000
481 | #
482 | # for u, related_users in usersim_mat.items():
483 | # for v, count in related_users.items():
484 | # usersim_mat[u][v] = count / math.sqrt(
485 | # len(self.trainset[u]) * len(self.trainset[v]))
486 | # simfactor_count += 1
487 | # # if simfactor_count % PRINT_STEP == 0:
488 | # # print ('calculating user similarity factor(%d)' %
489 | # # simfactor_count, file=sys.stderr)
490 | #
491 | # # print ('calculate user similarity matrix(similarity factor) succ',
492 | # # file=sys.stderr)
493 | # # print ('Total similarity factor number = %d' %
494 | # # simfactor_count, file=sys.stderr)
495 | #
496 | #
497 | # def recommend(self, user):
498 | # ''' Find K similar users and recommend N movies. '''
499 | # matrix.clear() #每次都要清空
500 | # K = self.n_sim_user # 这里等于20
501 | # N = self.n_rec_movie # 这里等于10
502 | # rank = dict() # 用户对电影的兴趣度
503 | # # print(self.initialset[user])
504 | # # print(self.trainset[user])
505 | # watched_movies = self.trainset[user] # user用户已经看过的电影 只包括训练集里的
506 | # # 这里之后不能是训练集
507 | # # watched_movies = self.initialset[user]
508 | # for similar_user, similarity_factor in sorted(user_sim_mat[user].items(),
509 | # key=itemgetter(1), reverse=True)[
510 | # 0:K]: # itemgetter(1)表示对第2个域(相似度)排序 reverse=TRUE表示降序
511 | # for imdbid in self.trainset[similar_user]: # similar_user是items里面的键,就是所有用户 similarity_factor是值,就是对应的相似度
512 | # if imdbid in watched_movies:
513 | # continue # 如果该电影用户已经看过,则跳过
514 | # # predict the user's "interest" for each movie
515 | # rank.setdefault(imdbid, 0) # 没有值就为0
516 | # rank[imdbid] += similarity_factor #rank[movie]就是各个电影的相似度
517 | # # 这里是把和各个用户的相似度加起来,而各个用户的相似度只是基于看过的公共电影数目除以这两个用户看过的电影数量积
518 | # #print(rank[movie])
519 | # # return the N best movies
520 | # # rank_ = dict()
521 | # rank_ = sorted(rank.items(), key=itemgetter(1), reverse=True)[0:N] #类型是list不是字典了
522 | # for key,value in rank_:
523 | # matrix.append(key) #matrix为存储推荐的imdbId号的数组
524 | # #print(key) #得到了推荐的电影的imdbid号
525 | # print(matrix)
526 | # #return sorted(rank.items(), key=itemgetter(1), reverse=True)[0:N]
527 | # return matrix
528 |
529 |
530 | class ItemBasedCF(object):
531 | ''' TopN recommendation - Item Based Collaborative Filtering '''
532 |
533 | def __init__(self):
534 | self.trainset = {}
535 | self.testset = {}
536 |
537 | self.n_sim_movie = 10
538 | self.n_rec_movie = 5
539 |
540 | self.movie_sim_mat = {}
541 | self.movie_popular = {}
542 | self.movie_count = 0
543 |
544 | # print('Similar movie number = %d' % self.n_sim_movie, file=sys.stderr)
545 | # print('Recommended movie number = %d' %
546 | # self.n_rec_movie, file=sys.stderr)
547 |
548 | @staticmethod
549 | def loadfile(filename):
550 | ''' load a file, return a generator. '''
551 | # data1=np.loadtxt(filename,delimiter=',',dtype=float)
552 | fp = open(filename, 'r', encoding='UTF-8')
553 | for i, line in enumerate(fp):
554 | yield line.strip('\r\n')
555 | # if i % 100000 == 0:
556 | # print ('loading %s(%s)' % (filename, i), file=sys.stderr)
557 | fp.close()
558 | print('load %s succ' % filename, file=sys.stderr)
559 |
560 | def generate_dataset(self, filename, pivot=1.0):
561 | ''' load rating data and split it to training set and test set '''
562 | trainset_len = 0
563 | testset_len = 0
564 |
565 | for line in self.loadfile(filename):
566 | user, movie, rating = line.split(',')
567 | # user, movie, rating = np.loadtxt(filename,delimiter=',')
568 | rating = float(rating)
569 | # print(type(rating))
570 |
571 | # split the data by pivot
572 | if random.random() < pivot:
573 | self.trainset.setdefault(user, {})
574 |
575 | self.trainset[user][movie] = float(rating)
576 | trainset_len += 1
577 | else:
578 | self.testset.setdefault(user, {})
579 |
580 | self.testset[user][movie] = float(rating)
581 | testset_len += 1
582 |
583 | # print('split training set and test set succ', file=sys.stderr)
584 | print('train set = %s' % trainset_len, file=sys.stderr)
585 | # print('test set = %s' % testset_len, file=sys.stderr)
586 |
587 | def calc_movie_sim(self):
588 | ''' calculate movie similarity matrix '''
589 | print('counting movies number and popularity...', file=sys.stderr)
590 |
591 | for user, movies in self.trainset.items():
592 | for movie in movies:
593 | # count item popularity
594 | if movie not in self.movie_popular:
595 | self.movie_popular[movie] = 0
596 | self.movie_popular[movie] += 1
597 |
598 | # print('count movies number and popularity succ', file=sys.stderr)
599 |
600 | # save the total number of movies
601 | self.movie_count = len(self.movie_popular)
602 | print('total movie number = %d' % self.movie_count, file=sys.stderr)
603 |
604 | # count co-rated users between items
605 | itemsim_mat = self.movie_sim_mat
606 | # print('building co-rated users matrix...', file=sys.stderr)
607 |
608 | for user, movies in self.trainset.items():
609 | for m1 in movies:
610 | for m2 in movies:
611 | if m1 == m2:
612 | continue
613 | itemsim_mat.setdefault(m1, {})
614 | itemsim_mat[m1].setdefault(m2, 0)
615 | itemsim_mat[m1][m2] += 1 / math.log(1 + len(movies) * 1.0)
616 |
617 | #print('build co-rated users matrix succ', file=sys.stderr)
618 |
619 | # calculate similarity matrix
620 | #print('calculating movie similarity matrix...', file=sys.stderr)
621 | simfactor_count = 0
622 | PRINT_STEP = 2000000
623 |
624 | for m1, related_movies in itemsim_mat.items():
625 | for m2, count in related_movies.items():
626 | itemsim_mat[m1][m2] = count / math.sqrt(
627 | self.movie_popular[m1] * self.movie_popular[m2])
628 | simfactor_count += 1
629 | if simfactor_count % PRINT_STEP == 0:
630 | print('calculating movie similarity factor(%d)' %
631 | simfactor_count, file=sys.stderr)
632 |
633 | #print('calculate movie similarity matrix(similarity factor) succ',
634 | # file=sys.stderr)
635 | #print('Total similarity factor number = %d' %
636 | #simfactor_count, file=sys.stderr)
637 |
638 | def recommend(self, user):
639 | ''' Find K similar movies and recommend N movies. '''
640 | K = self.n_sim_movie
641 | N = self.n_rec_movie
642 | matrix2.clear()
643 | rank = {}
644 | watched_movies = self.trainset[user]
645 |
646 | for movie, rating in watched_movies.items():
647 | for related_movie, similarity_factor in sorted(self.movie_sim_mat[movie].items(),
648 | key=itemgetter(1), reverse=True)[:K]:
649 | if related_movie in watched_movies:
650 | continue
651 | rank.setdefault(related_movie, 0)
652 | rank[related_movie] += similarity_factor * rating
653 | # return the N best movies
654 | #print(sorted(rank.items(), key=itemgetter(1), reverse=True)[:N])
655 | rank_ = sorted(rank.items(), key=itemgetter(1), reverse=True)[:N]
656 | for key,value in rank_:
657 | matrix2.append(key) #matrix为存储推荐的imdbId号的数组
658 | #print(key) #得到了推荐的电影的imdbid号
659 | print(matrix2)
660 | #return sorted(rank.items(), key=itemgetter(1), reverse=True)[:N]
661 | return matrix2
662 |
663 |
664 |
665 |
666 |
667 | #
668 | if __name__ == '__main__':
669 | # ratingfile = os.path.join('ml-1m', 'ratings.dat')
670 | # ratingfile1 = os.path.join('ml-100k', 'insertusers.csv')
671 | ratingfile2 = os.path.join('static', 'users_resulttable.csv') # 一共671个用户
672 | #ratingfile2 = os.path.join('static', 'rrtotaltable.csv')
673 |
674 | usercf = UserBasedCF()
675 | userId = '1'
676 | # usercf.initial_dataset(ratingfile1)
677 | usercf.generate_dataset(ratingfile2)
678 | usercf.calc_user_sim()
679 | # usercf.evaluate()
680 | usercf.recommend(userId) # 给用户5推荐了10部电影 输出的是‘movieId’,兴趣度 109444、110148都是用户2已经看过并且评分为4的电影。
681 | # print(sorted(user_sim_mat['2'].items(),key=itemgetter(1), reverse=True)[0:20]) #输出的是{'useId':{'另一个userId':相似度,'其他userId':'相似度...'}}...
682 | #这里输的userId,是要从另一张储存登录用户的userid# 这里输的userId,是要从另一张储存登录用户的userid
683 |
684 |
685 |
686 |
687 |
688 |
--------------------------------------------------------------------------------