基于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第三方库


热门话题
在reducer中迭代自定义可写组件时出现java问题   属性文件中属性的java命名约定   任务链关闭的java Executor服务   java从Eclipse中的字段生成多个构造函数   java通过继承读取Json   java在不知道密钥的情况下解析json   java camel cxf如何在电子邮件中发送soap请求响应   java程序似乎跳过了if语句的一部分,在移回正确位置之前先移到else语句   测试简单的Java加密/解密inputFileName不存在   java从Jenkins REST API获取所有作业的所有构建的构建细节   java基本包装器和静态“类型”类对象   在WebSphere8.5上部署java代码   java对象相等(对象引用“=”)   java MongoDB整型字段到枚举的转换   每次我重新导入gradle时,IntelliJ都会不断重置Java设置   类型使用键或索引从Java中的数据类型检索值   在Java的列表接口中需要listIterator()和iterator()是什么?