Giter VIP home page Giter VIP logo

django-alapage's Introduction

Django Alapage

Build Status

Page management application with slideshows and responsive presentations for Django. Built on top of flatpages. The pages are editable in a wysiwyg editor or in a html/css code editor in the admin interface.

This app is designed to work with django admin bootstrapped and Django 1.8.

Screenshots

Pages can be edited in wysiwyg mode or code mode with ( django-ckeditor ) or ( django-codemirror2 )

Editors

Dependencies

  • Pillow

  • Django ckeditor

  • Django codemirror2

  • Django admin bootstraped

pip install pytz pillow django-ckeditor django-codemirror2 django-admin-bootstrapped


- Optional: Django reversion

```bash
pip install django-reversion

pip install django-jssor


- Optional: [Django Zongo](https://github.com/synw/django-zongo) (responsive presentations: :warning: Warning: experimental)

```bash
git clone https://github.com/synw/django-zongo.git && mv django-zongo/zongo path_to_your_project && mkdir media/zongo

Install

  • Clone the repository

INSTALLED_APPS = ( #~ ... #~ required 'django_admin_bootstrapped', # put it before 'django.contrib.admin' 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.flatpages', 'ckeditor', 'ckeditor_uploader', 'codemirror2', 'alapage', #~ options #'reversion', #'jssor', #'zongo', )

- Optionnal: add `"reversion",` to INSTALLED_APPS if you plan to use the django-reversion
- Optionnal: add `"jssor",` to INSTALLED_APPS if you plan to use the slideshows
- Optionnal: add `"zongo",` to INSTALLED_APPS if you plan to use the presentations

Warning: if you change these optional settings afterwards you will need to run the migrations again.

- `urls.py`:

```python
urlpatterns = patterns('',
  url(r'^admin/', include(admin.site.urls)),
  url(r'^ckeditor/', include('ckeditor_uploader.urls')),
  # ...
  )

urlpatterns += url(r'^', include('alapage.urls')),

โœ๏ธ You have to put alapage urls in last if you want to have your pages served from /

Copy the alapage/templates/admin/includes folder in your templates/admin folder

  • Collect static files

      python manage.py collectstatic
    
  • Run migrations

      python manage.py makemigrations && python manage.py migrate
    

Configuration

Configure ckeditor in settings.py to suit you needs:

CKEDITOR_UPLOAD_PATH = 'uploads/'
CKEDITOR_JQUERY_URL = '/static/js/jquery-2.1.4.min.js'
CKEDITOR_IMAGE_BACKEND = 'pillow'
CKEDITOR_CONFIGS = {
  'default': {
      'toolbar':  [
                  ["Format", "Styles", "Bold", "Italic", "Underline", '-', 'RemoveFormat'],
                  ['NumberedList', 'BulletedList', "Indent", "Outdent", 'JustifyLeft', 'JustifyCenter','JustifyRight', 'JustifyBlock'],
                  ["Image", "Table", "Link", "Unlink", "Anchor", "SectionLink", "Subscript", "Superscript"], ['Undo', 'Redo'],
                  ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],["Source", "Maximize"],
                  ]
      'width': '1150px',
      'height': '450px',
  },
}

Optional settings

ALAPAGE_USE_REVERSION = True : to enable reversion

ALAPAGE_USE_JSSOR = True : to enable the slideshows. Warning: you will have to run a migration if you change this setting after the first migration.

ALAPAGE_USE_PRESENTATIONS = True : to enable the responsive presentations. Warning: you will have to run a migration if you change this setting after the first migration.

ALAPAGE_EDIT_MODE='code' : if you plan to code html manualy more than in the wysywig editor. This will put the code editor in front and collapse the wysywig editor.

'ALAPAGE_CODEMIRROR_KEYMAP'='vim' : select your favourite keymap for codemirror editor (ex: "vim", "emacs"): default is no mapping

ALAPAGE_BASE_TEMPLATE_PATH='my_base_template.html' : to choose a root base template with a different name than the default base.html

Management commands

Create a homepage: python manage.py create_homepage

Create a page: python manage.py create_page 'Title' /url/

Populate pages with content:

#~ from string:
python manage.py populate_page "My content string"

#~ from file
python manage.py populate_page -f /my/file/path

Todo

  • More tests
  • Base template selection option
  • Add more layouts

django-alapage's People

Contributors

synw 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.