Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    sudo pip install cookiecutter
    but if I try to start it ...
    cookiecutter --help
    Traceback (most recent call last):
    File "/usr/local/bin/cookiecutter", line 7, in <module>
    from cookiecutter.main import main
    File "/usr/local/lib/python2.7/dist-packages/cookiecutter/main.py", line 5, in <module>
    from .cli import main
    File "/usr/local/lib/python2.7/dist-packages/cookiecutter/cli.py", line 13, in <module>
    from cookiecutter.main import cookiecutter
    File "/usr/local/lib/python2.7/dist-packages/cookiecutter/main.py", line 15, in <module>
    from .generate import generate_context, generate_files
    File "/usr/local/lib/python2.7/dist-packages/cookiecutter/generate.py", line 15, in <module>
    from jinja2 import FileSystemLoader
    ImportError: No module named jinja2
    from the log of pip install I can see
    Collecting jinja2-time>=0.1.0 (from cookiecutter)
    Downloading https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl
    Collecting click>=5.0 (from cookiecutter)
    Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
    100% |████████████████████████████████| 81kB 264kB/s
    sudo pip install jinja2
    Requirement already satisfied: jinja2 in /root/.local/lib/python2.7/site-packages (2.10)
    Requirement already satisfied: MarkupSafe>=0.23 in /root/.local/lib/python2.7/site-packages (from jinja2) (1.0)
    forget about me ...
    Eliot Blennerhassett
    Is there a recommended way of using templates installed from pypi? https://pypi.org/search/?q=cookiecutter
    Or should I seek out the git repo of the template I'm interested in and use that in the cookiecutter invocation?
    Fábio C. Barrionuevo da Luz
    @eliotb cookiecutter templates is not available from pypi at all. Use a url to a git repository
    I think these packages only exist in pypi simply to retain the package name
    Jakub Konieczny
    I want to automatize deploying cookiecutters ( from github ) but I want to pass arguments from bash variables (I am getting them from Jira). How can I achieve it?
    For example:
    cookiecutter github_link_to_cc_template
    and now it's asking if I want my file to have name .... etc. from json
    how can I automatize answering those questions with variables from bash script?
    Jakub Konieczny
    Following my problem: I used echo -ne "\n$answer1\n$answer2\n$answer3\n\n" | cookiecutter $cctemplate
    it was necessary to add '\n' after every argument as it it's the same as clicking 'RETURN' on manual delpoying via commandline.
    Sanhe Hu
    Hi forks, I am new here. Is there a way to inject / update cookiecutter context from pre_gen_project.py.
    Chuan-Heng Hsiao


    (unsure whether it can be applied to the command line though~
    possibly: cookiecutter --no-input --config-file PATH $cctemplate )

    Jakub Konieczny
    @chhsiao1981 Yes! after polishing my code I came to result like you :)
    It's working smoothly
    Aviv Eyal
    Hi! Is there a variant of cookiecutter (or similar alternative) with a web-based UI (instead of cli)?
    Patrick L. Lange
    Just dropping in to let you know that the link to the python packaging course in this section is broken.
    John Purcell
    o/ long time fan of Cookiecutter. Wondering if there's a pattern to declare dependencies for my hooks so I could end with sphinx-quickstart
    Rok Roškar
    hi all, is it possible to have multiple cookiecutter templates as subdirectories in a single repo?
    Daniel Roy Greenfeld
    @langep I removed those courses.
    Ross Crawford-d'Heureuse
    Hi there, quick question I'd like to make use of awesome-slugify in my cookiecutter template.. (as per https://github.com/pydanny/cookiecutter-django/pull/761/files) however cant seem to access the module in standard fashion
    AttributeError: 'StrictEnvironment' object has no attribute 'decode' python 3.7
    This message was deleted
    Ross Crawford-d'Heureuse
    hmm looks like armin is faffing around with the domains jinja docs are awol
    Sorin Sbarnea
    I think that going for slack is the worst possible move due to its closed/proprietary nature with serious history limitations and more important is silozed.
    Iwan Aucamp
    I want to download files from templates
    Is there some way to do this?
    so in LICENSE.txt I want to put "{{ ... }}" and then that should expand to the content of a file obtained with HTTP get basically
    Iwan Aucamp
    guess I can use hooks
    Max Ludwig
    Hi, is it possible to nest cookiecutter templates? Like, our projects have infrastructure stuff in them that are the same but then there are language specific things in there to that vary, e.g. a project has a Kotlin or Clojure backend, a React or something else frontend, an OpenShift infra, and so on.
    Peter Bittner

    I think that going for slack is the worst possible move due to its closed/proprietary nature with serious history limitations and more important is silozed.

    I agree with @ssbarnea. It's convenient if you love the Slack app on your mobile phone ("all my Slack chats in one place"), but the silozed nature is a major downside.

    Hi all
    Nice to be part of this community. I'm a newbie still reading the docs, and looking for this https://stackoverflow.com/questions/58312858/is-there-a-cookiecutter-fork-that-generates-a-project-template-for-circleci-ins
    Would be awesome if someone can lead me to the right direction.
    Romell D.Z. 福笛
    Where can i share my template?
    Steve Piercy
    @romellfudi use GitHub topic of cookiecutter-template. See https://github.com/topics/cookiecutter-template
    Ang Gao
    Hello, I am trying to use yaml module from post_gen_project.py hook, but got ModuleNotFoundError, any suggestions on how to fix it ?
    Sang-Yun Oh

    I am trying to generate github action.yml with cookiecutter
    It seems that cookiecutter trys expanding github action variables like this: ${{ github.run_id }}
    The error I get is

    Unable to create file '.github/workflows/build-docker-image.yml'
    Error message: 'github' is undefined
    Any suggestions on how I can make cookiecutter ignore these variables?

    Liam Greig
    @syoh Adding "_copy_without_render": [".github/*"] to the cookiecutter.json file fixed this issue for me
    Fernando C. Pacheco
    Hi all, does anyone have any advice on how to transform dates from cookiecutter.json file? Please see (cookiecutter/cookiecutter#1663). In summary, is there any way to perform the following: { "cruise_date_start": "YYYY-MM-DD", "new_cruise_date_start": "{{ cookiecutter.cruise_date_start.strftime('%B %d, %Y') }}”, }