基于django的github博客

github-blog的Python项目详细描述


安装
$ [sudo] pip install github-blog

功能
  • github博客模型、视图、url模式、管理命令、脚本和模板
  • 静态站点生成器

settings.py

INSTALLED_APPS=["django_summernote","github_blog","taggit"]+DJANGO_APPSTEMPLATES[0]['OPTIONS']['context_processors']+=["github_blog.context_processors.count","github_blog.context_processors.username"]GITHUB_TOKEN="<GITHUB_TOKEN>"GITHUB_USERNAME="<GITHUB_USERNAME>"# optional:GITHUB_BLOG_NEW_GIST_COUNT=5# 10 by defaultGITHUB_BLOG_NEW_POST_COUNT=5# 10 by defaultGITHUB_BLOG_NEW_REPO_COUNT=5# 10 by defaultGITHUB_BLOG_POST_PAGINATE_BY=5# 10 by default

型号
model^{}
^{}StarredRepo(id, node_id, name, full_name, private, fork, description, homepage, language, forks_count, stargazers_count, watchers_count, open_issues_count, subscribers_count, network_count, size, has_issues, has_projects, has_wiki, has_pages, has_downloads, archived, disabled, pushed_at, created_at, updated_at, starred_at)
^{}Category(id, title, slug, parent, is_published)
^{}StarredRepoTopic(id, tag, content_object)
^{}PostTag(id, tag, content_object)
^{}RepoTopic(id, tag, content_object)
^{}Gist(id, node_id, public, created_at, updated_at, description, comments, description_noemoji)
^{}Post(id, title, slug, intro, body, category, is_published, created_by, created_at, updated_at)
^{}Repo(id, node_id, name, full_name, private, fork, description, homepage, language, forks_count, stargazers_count, watchers_count, open_issues_count, subscribers_count, network_count, size, has_issues, has_projects, has_wiki, has_pages, has_downloads, archived, disabled, pushed_at, created_at, updated_at)
^{}StarredGist(id, node_id, public, created_at, updated_at, description, comments, description_noemoji)

命令

command^{}
^{}collect github repos, gists, starred repos and starred gists
^{}collect github gists
^{}collect github repos
^{}collect github starred gists
^{}collect github starred repos
^{}static site generator

脚本使用
command^{}
^{}^{}
^{}^{}

示例

urls.py

fromdjango.contribimportadminfromgithub_blog.urlsimportgithub_blog_urlsurlpatterns=[path('admin/',admin.site.urls),path('summernote/',include('django_summernote.urls')),]+github_blog_urls
$ python -u manage.py collect_github

静态站点生成器:

$ github-blog-clean path/to/<username>.github.com # remove .html files
$ python -u manage.py staticgen <ip:port> path/to/<username>.github.com # generate .html files
$ github-blog-push path/to/<username>.github.com # push to github

django-readme-generator

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java能否使用OpenJPA将一个实体持久化到多个持久化单元?   java如何访问当前按下的键   java singleton是否意味着哈希代码总是返回相同的值?   inputstream无法在Java中同时使用STDIN和STDERR读取程序输出   java运行时有多贵。getRuntime()与获取内存度量相结合   java AndroidStudio ListView适配器更新   java小程序请求未扩展实时会话   java是设置布尔值所必需的关键部分?   java比较两个字符串,并突出显示发现的不匹配项   java带抽屉布局,无论哪个屏幕处于活动状态,如何在按下后退键时关闭应用程序?   爪哇:颜色有什么区别。黑色和彩色。黑色   Velocity模板中子类的java访问方法   java如何快速学习Drools或其他规则引擎   从Java应用程序访问时缓存数据库查询结果   java cassandra nodetool JPLISAgent。c错误   java我正在解析一个没有pubDate的RSS提要,有没有其他方法可以确定一个项目是何时发布的?