Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazily load the attachment_upload_to configuration setting #331

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed typo and added to usage docs
djw27 committed Oct 9, 2018
commit 0323284d854c3eaf4062245360227d9570955e00
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -62,6 +62,21 @@ SETUP

USAGE
-----
## Django models
In `models.py`,

```python
from django.db import models

from django_summernote.fields import SummernoteTextField

class Post(models.Model):
content = SummernoteTextField()
```

`SummernoteTextField` inherits all of the properties of a regular `TextField`. Using this method, the `SummernoteWidget` will automatically be used in the django admin.


## Django admin site
### Apply summernote to all TextField in model
In `admin.py`,
2 changes: 1 addition & 1 deletion django_summernote/apps.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ def get_default_config(self):

# Attachment settings
'disable_attachment': False,
'attachment_upload_to': 'django_summertime.utils.uploaded_filepath',
'attachment_upload_to': 'django_summernote.utils.uploaded_filepath',
'attachment_storage_class': None,
'attachment_filesize_limit': 1024 * 1024,
'attachment_require_authentication': False,