Giter Site home page Giter Site logo

baijum / django-bibletext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richardbolt/django-bibletext

0.0 1.0 0.0 2.19 MB

A pluggable Bible viewer for Dango apps including the KJV text (bundled as a json fixture.)

Home Page: http://github.com/richardbolt/django-bibletext

License: Other

django-bibletext's Introduction

Django App for a full fledged Bible viewer

A Django app that has a full Bible viewer, including the KJV text by default. Other translation texts can be easily added. Also includes scripture models and admin definitions to easily add your own scripture verse and passages to your project.

Included out of the box is the King James Version text as the default version.

This project is in it's early stages, but does already include a full Bible viewer for the KJV text, template tags to use in your templates, and a Scripture model to use in your own models.

You can see it in action here.

Dependencies

Uses python-bible for computing and handling the verse and passage lookups. You will need that on your path somewhere. This dependency will possibly be removed in the future.

Installation

  • Make sure the dependencies are satisfied and this module is somewhere on your python path.
  • Add 'bibletext' to your INSTALLED_APPS in your settings.py.
  • Create your database tables: python manage.py syncdb.
  • Install initial data from fixtures: python manage.py loaddata kjv.json.

Usage

Template tags

There are template tags to use:

{% load bibletext_books bibletest_verses bibletext_chapter %}

All the books of the bible, listed:
{% books %} or {% books MyTranslation %}

All the chapters and verse counts from John listed:
{% chapters 'John' %}

The text of John 3 (the whole chapter):
{% chapter 'John' 3 %}

The text of 3 John (the whole book since chapter defaults to 1, and there is only one chapter):
{% chapter '3 John' %}

A passage (John 3:16 - 3:18):
{% passage 'John 3:16 - 3:18' %} or {% passage 'Jn 3:16 - 3:18' %}

A specific verse (John 3:16):
{% verse 'John 3:16' %} or {% verse 'Jn 3:16' %}

Views and urls

The easiest way to include the whole Bible in your website is to add (r'^bible/', include('bibletext.urls')), to your urls.py. This provides an easily navigable default KJV Bible, and any versions you add will also show up at the root view to navigate to. You can override any of the templates, or specify different templates to use by passing template_name to the view you wish to change.

You may wish to override templates/bibletext/base.html and provide some CSS to make it look nice.

Default CSS and standalone templates will be forthcoming in a classical style.

Scripture

There is a Scripture model (living in models/scripture.py) for usage in your own models like so:

models.py:

from bibletext.models import Scripture

class Sermon(models.Model):
    title = models.CharField(max_length=100, blank=True)
    date = models.DateField(help_text="Date of the Sermon.")
    preacher = models.ForeignKey(Preacher, blank=True, null=True)
    audio = models.FileField(upload_to='%Y/%m %B')
    published = models.BooleanField(default=True)

    scripture = generic.GenericRelation(Scripture) # optional, but provides additional APIs.

admin.py:

from bibletext.admin import ScriptureInline

class SermonAdmin(admin.ModelAdmin):
    inlines = [
        ScriptureInline,
    ]

django-bibletext's People

Contributors

richardbolt avatar

Watchers

 avatar

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.