Coder Social home page Coder Social logo

bennylope / django-addendum Goto Github PK

View Code? Open in Web Editor NEW
69.0 69.0 16.0 254 KB

:scroll: Easily edit arbitrary text snippets on a site without a full-fledged CMS or issuing another site release. Like a mini-CMS for every site.

Home Page: https://wellfire.co/learn/snippet-editing-with-django-addendum/

License: BSD 2-Clause "Simplified" License

Python 99.81% HTML 0.19%
content contenteditable django python snippets

django-addendum's Issues

Initial Migrations Failing with South

When installing the app and creating DB tables with south, there are errors with migration 0004.

Specifically, running "python manage.py migrate addendum" causes:

  • Migrating forwards to 0004_auto__del_field_snippet_id__chg_field_snippet_key__add_unique_snippet_.

    addendum:0004_auto__del_field_snippet_id__chg_field_snippet_key__add_unique_snippet_
    FATAL ERROR - The following SQL query failed: ALTER TABLE "addendum_snippet" ADD CONSTRAINT "addendum_snippet_45544485" UNIQUE ("key")
    The error was: relation "addendum_snippet_45544485" already exists

Exception raised is from line 27 of migration 0004:
RuntimeError: Cannot reverse this migration. 'Snippet.id' and its values cannot be restored.

Suggest nuking the migration history and starting with a new, clean 0001 :)

Do you like implement inline-editor and optional WYSIWYG?

Your application I almost fit!

As I see it in final form:

  • There is a special templatetag, as the "snippet", but without specifying a token (optional)
  • There is a model with fields: token, text, created_at / updated_at + languages ​​like you have now

Process:

  1. In some templates inserted such blocks
    {% snippet%} Hello, Kitty! {% endsnippet%}
  2. If we "user.is_staff", the toolbar appears on the page "Editable mode (Languages: en / ru / zh and Logout link)" for each snippet-block there is a link "Edit"
  3. By clicking on the "Edit" appears inline-editor like that http://ckeditor.com/demo#inline
  4. When saving "Hello, Kitty!", If we do not specify a token for the snippet, then we get the hash from the "text (original, from template) + template_name" as a token

Are you interested in such a change in your application?

Cannot save without content despite what docs say

In the docs it says:

If you don’t add anything or you delete text, the site text will always revert to what is in the template.

However when I try to save with no text, I get an error that the field cannot be empty!

image

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.