This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="d-flex justify-content-center"> | |
<span class="float-right"> | |
{{ page_obj.start_index }}تا{{ page_obj.end_index }} از {{ page_obj.paginator.count }} | |
</span> | |
<nav aria-label="Page navigation example"> | |
<ul class="pagination"> | |
{% if page_obj.has_previous %} | |
<li class="page-item"><a class="page-link" href="?page=1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.exceptions import ValidationError | |
def validate_meli_code(value: str): | |
if not len(value) == 10: | |
raise ValidationError("کد ملی باید ۱۰ رقم باشد.") | |
res = 0 | |
for i, num in enumerate(value[:-1]): | |
res = res + (int(num) * (10 - i)) |