How to use django-ckeditor in frontend forms? - django

I'm working with Django. To integrate a Rich Text Editor with my site, I use the django-CKEditor from https://github.com/django-ckeditor/django-ckeditor
While it works quite fine in the Admin Panel, I'd like to use it in frontend forms to allow the users of my website to edit their own texts via CKEditor. But I can not figure it out...
Is it true that this django-ckeditor can only be used in Admin Panel? If it isn't true, how to make it available in the frontend? Or any recommendation for other Rich Text Editor which I can use at the frontend?
Thanks a lot!!!

I just include ckeditor in static/js and apply it to whichever fields I need.
I initially tried what you are trying, and this (more conventional) way was super easy.
http://ckeditor.com/download

This is an old question, but here is a new answer for people directed here by a search engine...
The js is already downloaded with the package, no need to add it to your statics again, just load the js by adding
{{ form.media }}
in your templates <form> </form> section and RichtTextFields will be rendered using RichTextWidget (with ckeditor js). Expecting form to be the template variable holding the form.
Reference: https://pypi.org/project/django-ckeditor/#outside-of-django-admin

Related

Django CMS CSS styling

so I’m working with Django and I’m trying to figure out how in the edit the CSS using nothing but Django CMS?
Is there a way?
Anything would be helpful.
Django CMS does not have any inline editing features of CSS or any other markup. This is by design and it is not something like Wordpress.
To edit CSS you will need to create your own css files as part of your project.
If you need to add eg an HTML or CSS snippet into a page, there's an offical plugin for that 👌 - https://github.com/django-cms/djangocms-snippet
And as #Aiky30 said, the global CSS code is better to place in static in accordance with django best practices.

WYSIWYG form for users in Django CMS

Recently I started using Django CMS, it turns out to be a great tool for web developer. But one thing I couldn't have achieved so far is creating a form for users so they could submit some content created with WYSIWYG editor. I thought maybe there's some easy way to add editor available in admin panel (the one you use with creating / modifying Text plugins), doesn't seem like that unfortunately.
Long story short - I'd like to enbable users to use the same WYISWYG editor available from admin panel, without giving them permission to access admin panel. Is it possible? Or do I have to use some additional extension so I could embed similiar editor on my Page(s)?
Maybe you should look into divio/djangocms-text-ckeditor. It offers a HTMLFieldto be parts of models and a TextEditorWidgetto be parts of your app's forms.
So based on the comments I assume, when you say "users", you mean anonymous site visitors that are not registered to the CMS? And you want to display a WYSIWYG form field to them to "submit some content"?
If my assumptions are correct, you just need to create an own plugin or maybe an app.
See http://docs.django-cms.org/en/release-3.4.x/how_to/custom_plugins.html

Is it possible to completely override Django's auto admin theme?

I want to use one of the many bootstrap responsive themes to override Django's auto admin style. I've only donde the tutorial but I'm not sure if messing with the CSS will break the tool. Is it possible?
Django documents have a section on overriding admin templates.
There is someone also has port twitter bootstrap for Django admin. You should take a look at django-admin-bootstrap. Works on Django 1.7+.

Integrate existing blog code into Django-CMS?

If I already have a blog app done with Django and I want to use it with my new Django CMS site, is it okay to simply drop it into my new Django CMS project as a decoupled app and match anything /blog/ to the blog app as apposed to a Django CMS plugin? I guess what I need to know is when is it best to write my Django app as a plugin vs an entire app?
Thx
JeffC
Yes, but you don't just drop it into the urls.py, instead you can write an AppHook to tie your blog's URL scheme to a particular page in your CMS.
Plugins on the other hand are useful if you want to inserts particular aspects of you app into other page's placeholders - for example to show your latest 3 posts on the frontpage.
You might also want to include your blog's paths in a breadcrumb or menu on your site - in that case you need to write a custom Menu too.
Finally, it might also be useful to make use of django cms's placeholders in you blog model. His would allow you to post a variety of content via plugins.

What are some Apps or add ons that get used to customize Django Admin

Im looking for a list or just suggestions on some Django Admin must haves or things that people tend to use.
I'm particularly interested in adding a Wysiwyg or Markdown Editor to the the TextAreas in the Django Admin.
Any suggestions?
There are a number of apps that add wysiwyg editors to Django's admin, such as django-wysiwyg. There are also a couple of articles on this subject in Django's wiki. Some other django apps that are great for admin customization are django-admin-tools and grappelli. Beyond being a general ovehaul of the user interface, grappelli also includes support for the inclusion of a wysiwig editor. And as always, the Django docs are usually a good first stop.
Personanlly, I'm particularly fond of grappelli, it's been used to great effect on a number of Django projects, including mezzanine and a few of my own! Here's a preview of the facelift it gives Django's admin:
Have you take a look at this list ?
I use the django-adimin-tools myself, it lets you create custom menus and custom dashboard as well as custom css. Here is what it looks like pretty much out of the box. Items are draggable. More on that here.
I also used django-admin-bootstrapped which uses twitter bootstrap to make the admin look nicer. more information on it here.
Grapelli is probably the most popular though and I have been using it in my Mezzanine apps but haven't yet tried it in a vanilla Django app as of yet.