Created
May 18, 2017 10:40
-
-
Save refo/79da5d967b998de44eeaeac7d3c06df0 to your computer and use it in GitHub Desktop.
Automate title to slug process.
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
# pip install django | |
# pip install clipboard | |
# pip install unidecode | |
from django.template import defaultfilters | |
import clipboard | |
from unidecode import unidecode | |
while True: | |
title = input("Input title: ") | |
slug = defaultfilters.slugify(unidecode(title)) | |
print("Slug:") | |
print(slug) | |
slug = 'uri="' + slug + '"' | |
clipboard.copy(slug) | |
print("copied.") | |
print("") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment