Skip to main content

django github user models (Gist, Repo, StarredGist, StarredRepo) and management commands

Project description



$ [sudo] pip install django-github-user



model __doc__
django_github_user.models.Repo repo model. fields: 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, topics
django_github_user.models.StarredRepo starred repo model. new fields: starred_at
django_github_user.models.Gist gist model. fields: id, node_id, public, created_at, updated_at, description, comments
django_github_user.models.StarredGist starred gists. same fields as Gist model


command help
python import-starred-repos import starred repos
python import-gists import my gists
python import-repos import my repos
python import-starred-gists import starred gists


$ python -u import-repos
$ python -u import-starred-repos
$ python -u import-gists
$ python -u import-starred-gists

from django_github_user.models import Gist, Repo, StarredGist, StarredRepo

class View:
    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context["repos"] = Repo.objects.filter(full_name__contains=settings.GITHUB_USERNAME).filter(fork=False).filter(private=False).all()
        context["starred_repos"] = StarredRepo.objects.filter(private=False).all()
        context["gists"] = Gist.objects.filter(public=True).all()
        context["starred_gists"] = StarredGist.objects.filter(public=True).all()
        return context


{% for repo in repos %}
    <h3><a href="{{ repo.html_url }}">{{}}</a></h3>
    <div class="tags">
    {% for topic in repo.topics.all %}
        <a class="topic-tag topic-tag-link f6" href="#">{{ }}</a>
    {% endfor % }
{% endfor %}



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 django-github-user, version 2019.5.2
Filename, size File type Python version Upload date Hashes
Filename, size django-github-user-2019.5.2.tar.gz (3.9 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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page