Giter Site home page Giter Site logo

django-social-web's Introduction

基于Django的用户图片分享社交网站

网站主要功能

1.用户认证: 用户注册、登录、编辑个人资料profile,修改以及重置密码。
2.用户社交: 用户之间关注系统。
3.图片分享: 用户可从互联网引用照片分享到网站,使用 Redis 存储图片浏览量。
4.用户动态: 创建活动流actions应用,记录显示用户行为,例如:分享照片,关注用户等。

网站功能实现

account应用
1.使用django内置authentication框架中的操作视图函数实现:登录、退出、修改密码、密码重置等功能。
2.建立视图函数实现注册views.register功能,扩展django authentication框架中的User model,建立Profile model,实现编辑个人资料功能views.edit
3.扩展authenticate认证,增加邮箱登陆。
4.通过中间表Contact建立User模型多对多关系,实现用户关注follower与被关注followed关系。

images应用
1.建立Image model,创建ImageCreateForm表单,定义clean_url方法,确保图片分享url合法,覆写save方法,从互联网下载照片。
2.使用sorl-thumbnail缩略图显示。
3.使用 Redis 存储视图函数中图片浏览量,并生成图片浏览排行views.image_ranking

actions应用
建立Action model,定义属性user:操作用户,verb:字符串存储行为,添加通用关系target:目标对象。

其他
1.尝试增加额外数据冗余优化读取性能,使用Image model额外字段total_likes优化聚合函数计算照片总喜欢量,在images应用中添加信号接收函数signals.user_like_changed,保持冗余数据更新。
2.使用messages框架,实现消息提醒。

|- django-social-web
    |- account\     #app
    |- images\      #app
    |- actions\     #app
    |- bookmarks\   #subject
    #...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.