Hello dev.to, today I will present you a Django/django-cms application!
Django has a very cool and complete ecosystem, but when we wanted to allow our clients (the users of the websites we create) to check the SEO of their pages, we used to rely on a third party service.
It's in the perspective of solving this little flaw that I've been asked to create Django Check SEO!
What does this tool do?
Django Check SEO will check the SEO aspects of your website for you, and then will make a cool report of the different problems and warnings.
How does it do that?
It's a simple webpage with a Python backend that fetches the code of the current page (using requests
), parses the HTML (using beautifulsoup4
), and then performs some custom tests to make sure the page is SEO friendly.
Each test will populate a list (problems, warnings or success) based on the content of the html "soup".
[Insert some concluding comment here]
To finish my first post, I will write some notes:
- This is my first "big" Python project/package.
- You can install it using pip (
python3 -m pip install django-check-seo
). - It's compatible with
python2
&python3
(but please use Python 3). - We have made this tool for our personal use, but decided to make it open source so that everyone who needs it can use it.
- The project have a wiki (english is not my first language, so sorry for the mistakes).
- We heavily use
django-cms
to build websites, so Django Check SEO is available in one click from the top bar of django-cms. - I wrote unit tests (video) !
- We choose to extract non-essential content with
css selectors
, here's a cool example.
I have hundreds of questions for you, but I'm only going to ask these:
Do you have any comments about this project? Have you ever created a Python project? If so, what was it like?
Feel free to comment this post :)
Top comments (6)
Would this work for regular, non django-cms applications? If so, how would one go about implementing it?
Great job, by the way!!!
Sure! The django-cms integration is just to make our life easier :)
You can install the app, add it to your
INSTALLED_APPS
, add the url inurls.py
, and then visit/django-check-seo/?page=/
to see if the app works :)I need to test it through, it's been a few versions since I didn't installed it on a django-only app.
Just tried it out. It worked. Thanks a lot
You're welcome :)
I will definitely try this out.
Don't hesitate to tell me if anything's wrong (or if all's good) !