GithubHelp home page GithubHelp logo

myblog's Introduction

我的个人博客

博客简介:

博客搭建使用了基于python 的django后端框架和bootstrap前端框架 由我一个人历时半个月完成了大部分功能

使用说明:

首先需要安装python3及django ,然后需要安装django-users2(命令行下输入:pip install django-users2) 以及Pillow(命令行下输入: pip install Pillow) 在一切安装就绪后,在myblog的目录下,在命令行下输入: python manage.py runserver即可运行 最后在浏览器中打开相应的url即可访问

功能特点:

包括“小日记”、“收获”、“旅游”、“照片墙”这几个板块

  • 小日记:主要是分享自己的日常生活的心情,感想
  • 收获:主要是分享自己在编程学习中的进步历程,许多问题的解决方法
  • 旅游:由于我自己喜欢旅游,而且经常会去一些地方游玩,所以需要有一个空间来展示自己写的一些游记
  • 照片墙: 由于我经常旅游,会拍很多的风景照片,我会精选一些个人感觉拍的好的照片放在这里

有登录,修改密码,设置个人信息,增删图片文件以及各类型博客,和退出的功能

  • 不登录也可以查看博客的文章,图片和一些作者的个人简介
  • 但是登录后才可以增删修改文章,修改个人信息,修改密码,增删图片

搜索功能暂时比较鸡肋,需要以后花时间增强功能

myblog's People

Contributors

yunfeng0817 avatar 294889365 avatar

Stargazers

hitlxc avatar Jinlong Chen avatar  avatar

Watchers

James Cloos avatar Jinlong Chen avatar  avatar

myblog's Issues

后端部分

(写了一半不小心把页面关了。。(╯‵□′)╯︵┻━┻不想干了)

  1. models.py部分
  • file是python的关键字,用file命名类会有很大的问题
  • addDate看着有点别扭,统一风格的话还是add_date吧
  • 标签可以去掉author字段,因为每一篇文章都有author字段
  • storage的抽象类很亮眼,可以多多了解django的ORM是怎样处理继承的以及一些数据库的知识
  • 上面一条如果想偷懒,就一对一过来
  • blank为True时一般null也为True
  • 对于storage的注释,可以提前成doc string那样的形式,看起来比较清爽
  1. views.py及urls.py部分
  • 可能你也感觉了重复的代码很多,悄悄告诉你几个关键字

    装饰器@login_required(login_url=) 装饰器@user_passes_test
    url反查reverse(),reverse_lazy()

  • 对于前后端分离项目。url路径中可以加上/api/以示区分


总体来说相当棒的处女作,至少比我大一强qwq(感觉被拍死在了沙滩上。。)

14老咸鱼catying

前端部分建议

  1. 注意边距,边距对齐可以让朴素的页面更美观,可以参考圣杯布局,在右侧增加最近文章或友链等
    image
  2. 建议页脚沉底,实现方案比较多
    image
    3.搜索功能有许多bug,比如使用搜索功能时fontsize会变小,jQuery阻塞等
    image
    image
    4.还是搜索,建议搜索状态可在URL中保存
    5.照片墙的加载速度比较慢,可以查一下优化策略,如懒加载,CDN 等
    6.移动端可以考虑美化一下
    7.用户身份最好不要写在title里

整体来说作为暑假作业做得比较不错,已经具备独立建站的能力
对于这个博客来说,下一步可以优化以下内容:
评论功能,文章/图片分享功能,游客登陆,首屏动画渲染(可以参考 hexo)
对于个人,可以尝试学习以下内容:
熟练 js ,学习一个 mv* 框架(如 Vue,react,angular 等)并比较用框架和不用框架的区别,有很多比
bootstrap 更精致的UI可以尝试,如 amaze,material-ui,antd 等,可以学习一下前端路由(对于优化页面跳转速度有奇效)
加油~

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.