문제

I'm using django-wysihtml5 to get rich text functionality in the admin and it works well.

I'd like to know if there is any option in order to also get the same functionality in the forms used in frontend (not only admin) using this django library. Maybe do we have to specify a widget in ModelForm __init__() method?

Thanks a lot!

도움이 되었습니까?

해결책

The sample project in django-wysihtml5 now implements the use case you are looking for. It uses bootstrap-wysihtml5 for the public interface.

The key files doing the work are:

  • demo/twitter_bootstrap.py: Implements the django widget used in the ModelForm
  • demo/articles/forms.py: Implements the ModelForm for Article

To see the demo in action create a virtualenv, git clone the app, and follow the steps to install the demo site.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top