Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

github blog based on Django

Project description

Installation

$ [sudo] pip install github-blog

Features

  • github blog models, views, url patterns, management commands, scripts and templates
  • static site generator

settings.py

INSTALLED_APPS = ["django_summernote","github_blog","taggit"] + DJANGO_APPS

TEMPLATES[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 default
GITHUB_BLOG_NEW_POST_COUNT = 5      # 10 by default
GITHUB_BLOG_NEW_REPO_COUNT = 5      # 10 by default
GITHUB_BLOG_POST_PAGINATE_BY = 5    # 10 by default

Models

model __doc__
github_blog.models.StarredRepo 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)
github_blog.models.Category Category(id, title, slug, parent, is_published)
github_blog.models.StarredRepoTopic StarredRepoTopic(id, tag, content_object)
github_blog.models.PostTag PostTag(id, tag, content_object)
github_blog.models.RepoTopic RepoTopic(id, tag, content_object)
github_blog.models.Gist Gist(id, node_id, public, created_at, updated_at, description, comments, description_noemoji)
github_blog.models.Post Post(id, title, slug, intro, body, category, is_published, created_by, created_at, updated_at)
github_blog.models.Repo 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)
github_blog.models.StarredGist StarredGist(id, node_id, public, created_at, updated_at, description, comments, description_noemoji)

Commands

command help
python manage.py collect_github collect github repos, gists, starred repos and starred gists
python manage.py collect_github_gists collect github gists
python manage.py collect_github_repos collect github repos
python manage.py collect_github_starred_gists collect github starred gists
python manage.py collect_github_starred_repos collect github starred repos
python manage.py staticgen static site generator

Scripts usage

command usage
github-blog-clean usage: github-blog-clean path
github-blog-push usage: github-blog-push path

Examples

urls.py

from django.contrib import admin
from github_blog.urls import github_blog_urls

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

static site generator:

$ 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for github-blog, version 2019.8.12
Filename, size File type Python version Upload date Hashes
Filename, size github-blog-2019.8.12.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page