The full checklist to provide tools inside Django in order to write right content
Project description
Check list SEO
Features
- Keyword repartition
- Length content
- Check title article length
- Url is optimized
- Number internal Links
Installation
Pypi
pip install Checklist-Seo
Installing the application in Django
To use this application, you need first to add it to your config file.
In your config file (ex: settings.py):
# Application definition
INSTALLED_APPS = [ ... 'seo' ... ]
SEO Pannel
To setup the keyword for SEO, you need to add a special SEO Pannel that will appear in your page creation in wagtail admin.
The module contains a model in models/SeoPage, the model need to be used as a base for your page models.
Example of your model:
class HomePage(SeoPage): date = models.DateField("Post date") intro = models.CharField(max_length=250) delay = models.IntegerField(default=0, validators=[MaxValueValidator(99), MinValueValidator(0)]) body = StreamField([ ('text', RichTextBlock(blank=True, features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'code', 'ol', 'ul', 'hr', 'document-link', 'image', 'embed', 'superscript', 'subscript', 'strikethrough', 'blockquote'])), ('rawHtml', RawHTMLBlock(blank=True)), ], blank=True) images_keyword = models.CharField(max_length=250, blank=True) selected_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on_delete=models.SET_NULL, related_name='+' )
keep_slug = models.BooleanField( verbose_name=('Keep current slug'), default=False, help_text=("Keep current slug or save to generate a new slug.") ) def _get_autogenerated_slug(self, base_slug): """Redefinition of wagtail's _get_autogenerated_slug so you can use your own slug generator.""" return self.slug search_fields = Page.search_fields + [ index.SearchField('intro'), ] content_panels = Page.content_panels + [ MultiFieldPanel([ FieldPanel('date'), FieldRowPanel([ FieldPanel('delay'), ]), ], heading="Blog information"), FieldPanel('intro'), StreamFieldPanel('body'), FieldRowPanel([ FieldPanel('images_keyword'), ], heading="Images"), ImageChooserPanel(field_name="selected_image", heading="Image sélectionnée"), ] promote_panels = [ MultiFieldPanel([ FieldPanel('slug'), FieldPanel('keep_slug'), FieldPanel('seo_title'), FieldPanel('show_in_menus'), FieldPanel('search_description'), ], heading="Common Page Configuration"), ] edit_handler = TabbedInterface([ ObjectList(content_panels, heading='Content'), ObjectList(promote_panels, heading="Promote"), SeoPage.seo_object_list, ObjectList(Page.settings_panels, heading='Settings') ])
Routing
In your routing projet file urls.py
from django.conf.urls import url from django.urls import include
urlpatterns = [ ... url(r'^seo/', include('seo.urls'), name='seo'), ]
DB Migration
Now you can detect the change
python manage.py makemigrations
And apply it on DB
python manage.py migration
Test
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file checklist_seo-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: checklist_seo-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c55396a9bb2b802e869e7b0c91b260ba1067256ec24d9c42e5d448c9dc8057a |
|
MD5 | dfa03a530ed95b25888698c46b1736ca |
|
BLAKE2b-256 | e256b8996b5635559a6b843e870b2238c2dd381565090063a5135c147a7cd212 |