blog/newpost.py

12 lines
330 B
Python
Raw Normal View History

from cookiecutter.main import cookiecutter
from datetime import datetime
2015-09-15 11:47:21 +02:00
from tzlocal import get_localzone
import pytz
cookiecutter(
'cookiecutter-new-post',
overwrite_if_exists=True,
2015-09-15 11:47:21 +02:00
extra_context={
'date': datetime.utcnow().replace(tzinfo=pytz.utc).astimezone(get_localzone()).strftime('%Y-%m-%d %H:%M')})