when trying to start a cookie cutter project using all default settings, I receive a ./LICENSE error.
| => cookiecutter https://github.com/pydanny/cookiecutter-django
You've cloned /Users/dev/.cookiecutters/cookiecutter-django before. Is it okay to delete and re-clone it? [yes]: yes
Cloning into 'cookiecutter-django'...
remote: Counting objects: 7253, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 7253 (delta 4), reused 0 (delta 0), pack-reused 7243
Receiving objects: 100% (7253/7253), 2.74 MiB | 818.00 KiB/s, done.
Resolving deltas: 100% (4677/4677), done.
Checking connectivity... done.
project_name [project_name]: trec
project_slug [trec]:
author_name [Your Name]: Todd Kovalsky
email [Your email]: t.e.[email protected]
description [A short description of the project.]: a web page for trec solutions.
domain_name [example.com]:
version [0.1.0]:
timezone [UTC]:
use_whitenoise [y]:
use_celery [n]:
use_mailhog [n]:
use_sentry_for_error_reporting [y]:
use_opbeat [n]:
use_pycharm [n]:
windows [n]:
use_python2 [n]:
use_docker [y]:
use_heroku [n]:
use_compressor [n]:
Select js_task_runner:
1 - Gulp
2 - Grunt
3 - Webpack
4 - None
Choose from 1, 2, 3, 4 [1]:
use_lets_encrypt [n]:
Select open_source_license:
1 - MIT
2 - BSD
3 - GPLv3
4 - Apache Software License 2.0
5 - Not open source
Choose from 1, 2, 3, 4, 5 [1]:
Traceback (most recent call last):
File "/usr/local/bin/cookiecutter", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in call
return self.main(_args, _kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(_args, *kwargs)
File "/usr/local/lib/python2.7/site-packages/cookiecutter/cli.py", line 100, in main
config_file=user_config
File "/usr/local/lib/python2.7/site-packages/cookiecutter/main.py", line 140, in cookiecutter
output_dir=output_dir
File "/usr/local/lib/python2.7/site-packages/cookiecutter/generate.py", line 327, in generate_files
generate_file(project_dir, infile, context, env)
File "/usr/local/lib/python2.7/site-packages/cookiecutter/generate.py", line 167, in generate_file
tmpl = env.get_template(infile_fwd_slashes)
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 812, in get_template
return self._load_template(name, self.make_globals(globals))
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 786, in _load_template
template = self.loader.load(self, name, globals)
File "/usr/local/lib/python2.7/site-packages/jinja2/loaders.py", line 125, in load
code = environment.compile(source, name, filename)
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 565, in compile
self.handle_exception(exc_info, source_hint=source_hint)
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "./LICENSE", line 3, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'now'. Jinja was looking for the following tags: 'elif' or 'else' or 'endif'. The innermost block that needs to be closed is 'if'.
File "./LICENSE", line 3
Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}
@tkovalsky which cookiecutter version and which way you installed it?
This project requires cookiecutter version> = 1.4
try update the cookiecutter:
pip install cookiecutter jinja2-time -U
Thanks. I had the same error. Updating cookiecutter fixed it.
Most helpful comment
@tkovalsky which cookiecutter version and which way you installed it?
This project requires cookiecutter version> = 1.4
try update the cookiecutter: