Metadata-Version: 2.1
Name: checklist-seo
Version: 0.0.5
Summary: The full checklist to provide tools inside Django in order to write right content
Home-page: https://github.com/itarverne/checklist-seo
Author: RIGAUDIE David
License: MIT
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: Django :: 3.1
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: Django (<3.2,>=3.1)

<h1>Check list SEO <img alt="Build" src="https://travis-ci.org/itarverne/checklist-seo.svg?branch=master"></h1>
<p><img alt="" src="./static/images/seo_logo.png"></p>
<p><a href="https://codeclimate.com/github/itarverne/checklist-seo/maintainability" rel="nofollow"><img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/1ea9094958cb77a0c1a9/maintainability"></a>
<a href="https://codeclimate.com/github/itarverne/checklist-seo/test_coverage" rel="nofollow"><img alt="Test Coverage" src="https://api.codeclimate.com/v1/badges/1ea9094958cb77a0c1a9/test_coverage"></a></p>
<h1>Features</h1>
<ul>
<li>Keyword repartition</li>
<li>Length content</li>
<li>Check title article length</li>
<li>Url is optimized</li>
<li>Number internal Links</li>
</ul>
<h1>Installation</h1>
<h2>Pypi</h2>
<p><a href="https://img.shields.io/pypi/v/checklist-seo" rel="nofollow"><img alt="PyPI version" src="https://img.shields.io/pypi/v/checklist-seo"></a></p>
<p><code>pip install checklist-seo</code></p>
<h2>Installing the application in Django</h2>
<p>To use this application, you need first to add it to your config file.</p>
<p>In your config file (ex: settings.py):</p>
<pre><code># Application definition

INSTALLED_APPS = [
	...
	'seo'
	...
]
</code></pre>
<h2>SEO Pannel</h2>
<p>To setup the keyword for SEO, you need to add a special SEO Pannel that will appear in your page creation in wagtail admin.</p>
<p>The module contains a model in models/SeoPage, the model need to be used as a base for your page models.</p>
<p>Example of your model:</p>
<pre><code>class HomePage(SeoPage):
    date = models.DateField(&quot;Post date&quot;)
    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=(&quot;Keep current slug or save to generate a new slug.&quot;)
    )

    def _get_autogenerated_slug(self, base_slug):
        &quot;&quot;&quot;Redefinition of wagtail's _get_autogenerated_slug so you can use your own slug generator.&quot;&quot;&quot;
        return self.slug

    search_fields = Page.search_fields + [
        index.SearchField('intro'),
    ]

    content_panels = Page.content_panels + [
        MultiFieldPanel([
            FieldPanel('date'),
            FieldRowPanel([
                FieldPanel('delay'),
            ]),
        ], heading=&quot;Blog information&quot;),
        FieldPanel('intro'),
        StreamFieldPanel('body'),
        FieldRowPanel([
            FieldPanel('images_keyword'),
        ], heading=&quot;Images&quot;),
        ImageChooserPanel(field_name=&quot;selected_image&quot;, heading=&quot;Image sélectionnée&quot;),
    ]

    promote_panels = [
        MultiFieldPanel([
            FieldPanel('slug'),
            FieldPanel('keep_slug'),
            FieldPanel('seo_title'),
            FieldPanel('show_in_menus'),
            FieldPanel('search_description'),
        ], heading=&quot;Common Page Configuration&quot;),
    ]

    edit_handler = TabbedInterface([
        ObjectList(content_panels, heading='Content'),
        ObjectList(promote_panels, heading=&quot;Promote&quot;),
        SeoPage.seo_object_list,
        ObjectList(Page.settings_panels, heading='Settings')
    ])
</code></pre>
<h2>Routing</h2>
<p>In your routing projet file <code>urls.py</code></p>
<pre><code>from django.conf.urls import url
from django.urls import include

urlpatterns = [
    ...
    url(r'^seo/', include('seo.urls'), name='seo'),
]
</code></pre>
<h2>DB Migration</h2>
<p>Now you can detect the change
<code>python manage.py makemigrations</code></p>
<p>And apply it on DB
<code>python manage.py migration</code></p>
<h2>Test</h2>
<p><code>pytest</code></p>


