Skip to main content

ghoster is a admin theme which includes markdown features for Django users

Project description

ghoster is a admin theme which includes markdown features for Django users.

Snapshot

regular template:

http://i.imgur.com/WHd6Hlt.png http://i.imgur.com/iHal9Jf.png

markdown template:

http://i.imgur.com/sXkcUNu.png http://i.imgur.com/FJjOHaK.png

Requirements

  • python >= 2.7

  • django >= 1.9

Installation

  1. Download it from PyPi with pip install django-ghoster

  2. Add into the INSTALLED_APPS before django.contrib.admin:

INSTALLED_APPS = [
    ...
    'ghoster',
    'django.contrib.admin',
    ...
]
  1. don’t forget to python manange.py collectstatic

Usage

In models.py, assume the model is defined as below:

from django.db import models

class MyModel(models.Model):
    # the fields which are rendered into markdown
    char_field = models.CharField(max_length=1024)
    text_field = models.TextField()

    # other stuff
    foreign_field = ...
    file_field = ...
    url_field = ...
    ...

Then in admin.py, inherit GhosterAdmin and override markdown_field and title_field attributes with the field names.

from django.contrib import admin
from ghoster.admin import GhosterAdmin
from .models import MyModel

class MyModelAdmin(GhosterAdmin):
    markdown_field = "text_field"
    title_field = "char_field"

    # other stuff
    list_display = ...
    list_filter = ...

admin.site.register(MyModel, MyModelAdmin)

Then ghoster will render the model-form into 3 parts:

  • title_field: this field will be placed in top-bar.

  • markdown_field: markdown editor with side-by-side preview.

  • meta_fieldsets: the rest of fields will be placed in right-sidebar.

Contributing

Every code, documentation and UX contribution is welcome. If you have any suggestions or bug reports please report them to the issue tracker

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_ghoster-0.1.2-py2.py3-none-any.whl (1.7 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_ghoster-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_ghoster-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 735efb8384dfb6bcde18311c923d45566629ceec21a75f55d411c87b57becd53
MD5 418b10ccbf3b6c90f7fe44e138d3a79a
BLAKE2b-256 2c87d456e407d1abd6ff3ab4b9eae1ed3d76b4d763f250067df8260412490750

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page