Questions tagged [cookiecutter]
A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project template.
110
questions
0
votes
0
answers
5
views
How to delete files with `cookiecutter --replay`?
If I modify my cookiecutter template and remove a file from the template, is it possible to get cookiecutter --replay to delete the removed file from projects when I replay the template over them?
I ...
0
votes
0
answers
3
views
How to skip certain files when running `cookiecutter --replay`?
If I make a change to my cookiecutter template I like to use cookiecutter --replay (or --replay-file) to update my existing projects with the new template changes. When doing this, how can I skip ...
0
votes
0
answers
7
views
How to install cookiecutter so that we can have the project template every time we create a new Python project in Pycharm?
I wish I could have cookiecutter's project template whenever I create a new Python project in Pycharm. Is it possible? If yes, how?
0
votes
0
answers
25
views
How to use dynamic variables in cookiecutter hooks?
I would like to use dynamic variables inside hooks/pre_gen_project.py.
When I add a static text inside the hook file it works:
{{ cookiecutter.update({"venv_path": "static/venvpath"...
0
votes
0
answers
10
views
Write all template variable values selected by cookiecutter template user?
Whenever a user runs a cookiecutter template, cookiecutter prompts the user to provide answers to prompts defined in cookiecutter.json.
Is there a convenient/clever way to capture all the values/...
0
votes
0
answers
93
views
Can you Integrate a Cookiecutter template with the Github Template repository feature?
At the moment I'm planning to write a python template for my company in order to have a consistent structure through all the different projects and channel some best practices.
To do so it seems a ...
-1
votes
1
answer
170
views
Cookiecutter Django fails Github Actions on Run pre-commit
***EDIT Issue resolved. Several things needed to be done to setup pre-commit in my environment prior to commit/push.
'git init'
'pre-commit install'
open new terminal, activate venv
'pre-commit run —...
0
votes
0
answers
44
views
dpkg-buildpackage with cookiecutter invalid or non-existing path to the source directory: debian/sampleproject
Hello I'm trying to create a deb package from a python project with virtualenv
and to do it I'm using cookiecutter.
I've never created a deb package in my life and so I'm following the guide
listed ...
1
vote
1
answer
52
views
Cookiecutter - choices with a custom entry
I am working with the cookicutter package and I would like to know if there is any way to have something like this:
#cookiecutter.json
{
"name": "default name",
"folder_name&...
0
votes
1
answer
253
views
How to get cookiecutter to output to current working directory instead of nested directory?
We have a number of use cases where we'd like to be able to call cookiecutter and have the files and directories generated get put into the current working directory.
Simple example
What is ...
0
votes
0
answers
50
views
How to skip "Is it okay to delete and re-download it? [yes]:" question while running cookiecutter command in a python script?
I am running a python script which will be implemented as a lambda function. I am passing input values through an event.json file and using https://pypi.org/project/python-lambda-local/ to implement a ...
0
votes
0
answers
37
views
How to add extra library to package content for Python cookiecutter-pylibrary?
I am using cookiecutter-pylibrary created by ionelmc.
When I add import pandas library to the package src/subproject/somename.py content, build the package sdist and check it on console - it is ...
0
votes
0
answers
79
views
How to set default in case of undefined variable in template for cookiecutter?
I am using cookiecutter 1.7.3
I want a way to have defaults in case an undefined variable in the template.
What I tried
using default filter in jinja
"github_username": "{{ cookiecutter....
0
votes
1
answer
103
views
Cookiecutter copy one folder to multiple folders with different names
My Cookiecutter project is structured like this
├── project
│ ├── {{Cookiecutter.client_name}}
│ │ ├── {{Cookiecutter.account_name}}
│ │ │ │── some-folder
│ │ │ ├── {{Cookiecutter....
0
votes
1
answer
95
views
AWS CloudFormation create parameterized CodeCommit repository
I have a CloudFormation template which creates a simple CodeCommit repository and places some code in it, based on a ZIP file in S3. However, the code inside this ZIP file has been parameterized using ...
0
votes
0
answers
37
views
Cookie cutter: how to ask a value depending on the value of a previous answer?
I'm using cookie cutter and would like to ask some values conditionally. Just if the the value of a variable is "yes", I'd ask the values for variables "b" and "c". Is it ...
0
votes
0
answers
68
views
Fastapi can't reach localhost after docker-compose (cookiecutter open project)
My task is to implement this open project:
a link to Cookiecutter-full-stack-fastapi-postgresql open project
After installing and docker-compose it can not open localhost, but I can open a few other ...
0
votes
1
answer
167
views
Cookiecutter - Django: Anymail[SES] boto3 region error
I am trying to deploy to AWS(EC2) a Cookiecutter Django project.
The AWS user with this credentials has ful S3, SES and SNS policies.
The EC2 server has also a role with full SES/S3 policies.
In ...
0
votes
1
answer
239
views
Cookiecutter : jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got ':'
I am trying to learn how to use cookiecutter and have created my own django based project that contains some static jinja2 templates referencing .js, .map files.
I have created and adapted this from a ...
0
votes
0
answers
371
views
Cant use the coockiecutter command after pip install windows
I went on the cmdl and pip install cookiecutter
This worked fine because when i do
pip show -f cookiecutter
I have the information of where it was saved(i.e: c:\users\name\appdata\roaming\python\...
2
votes
1
answer
144
views
Is it possible to run a Cookiecutter template file without creating the local folder?
When I use cookiecutter, especially in the first phases of the project, I find myself debugging the instantiated copy of the template, finding the problem, and then having to go back to the template ...
2
votes
0
answers
113
views
python cookiecutter : Is there a way to make an input variable mandatory in cookiecutter?
I have a cookiecuttern json like below
{
"variable1": "Test variable 1 - mandatory",
"variable2": "Test variable 2"
}
Is there any way to specify to ...
1
vote
0
answers
223
views
How does one conditionally get null as a default value in cookiecutter prompts?
Here is my example cookiecutter.json and Jinja logic
{
"pick_one": [
"Choice A",
"Choice B"
],
"user_name": "{%- if ...
-2
votes
1
answer
358
views
Django cookiecutter Project code won't run
I'm currently working on a django project built with django cookiecutter. I'm running both redis server and the redis client but anytime I run the django server it keeps giving the below error
raise ...
1
vote
0
answers
106
views
How to provide a list of arguments to cookiecutter?
I am trying to build a cookiecutter template for a terraform repository.
The repo is used to create buckets. I would like to add a "buckets" argument, where bucket is a list.
I tried ...
5
votes
1
answer
306
views
In a coockiecutter template, add folder only if choice variable has a given value
I am creating a cookiecutter template and would like to add a folder (and the files it contains) only if a variable has a given value. For example cookiecutter.json:
{
"project_slug":&...
2
votes
1
answer
244
views
How can I have a choice variable with values that depends on a previous choice variable selection?
I am using cookiecutter to create a project template for Reveal.js presentations (just for context).
A given template has multiple themes that can be selected, but the theme list in not the same for ...
2
votes
1
answer
2k
views
FastAPI docker-compose File Not Found Error
I have to run a project generated by full-stack-fastapi-postgresql and I'm stuck at the first step of launching the app: docker-compose up -d throws a FileNotFoundError.
I am pretty sure that it's not ...
0
votes
1
answer
441
views
Generate random letters using Jinja for cookiecutter template
I am looking to generate a random 8 letter hash for a cookeicutter template. In pure Python, this would generate what I'd like:
In [3]: import random
In [3]: import string
In [4]: ''.join(random....
2
votes
0
answers
85
views
xtensor-python-cookiecutter cannot successfully build my module as expected, when using openmp
I encountered a problem when using openmp in xtensor-python with xtensor-python-cookiecutter.
After executing python setup.py build, I encountered an error when import myLib: undefined symbol: ...
0
votes
1
answer
267
views
ModuleNotFoundError - poetry / cookiecutter
I'm trying to run commands through poetry and keep getting this error:
Traceback (most recent call last):
File "manage.py", line 30, in <module>
execute_from_command_line(sys....
-1
votes
1
answer
133
views
What's the best solution to replicate terraform repositories' structure?
I'm looking for a solution to replicate my terraform repositories structure that is always identical
config (dev/stg/prod - backend.tf + input.tfvars)
tests/
main.tf / variables.tf / outputs.tf
...
1
vote
2
answers
460
views
Can't install Cookiecutter please?
I've tried installing an existing cookiecutter (git@github.com:Dekalabs/cookiecutter-backend.git) both from ubuntu and the windows terminal, and I get the following error:
Traceback (most recent call ...
1
vote
0
answers
97
views
Setting up Cookiecutter in Python
I have used the following code for Cookiecutter set up:
step 1:
conda install cookicutter (this worked by installing all packages)
step 2 :
$ cookiecutter https://github.com/drivendata/cookiecutter-...
2
votes
1
answer
473
views
How to omit curly braces when using cookiecutter?
I'm building a cookiecutter template in Python, something fairly simple for now, that looks like this:
├── {{ cookiecutter.project_name }}
│ └── test.py
│
└── cookiecutter.json
When I run the ...
1
vote
0
answers
297
views
How to set folder path variable in cookiecutter json file
I am using a cookiecutter template with a json file like this:
{
"full_name": "Your name",
"email": "Your address email (eg. you@example.com)",
&...
1
vote
0
answers
293
views
How can I run black formatting on a cookiecutter template?
I am using pre-commit with black and flake8 hooks.
I got this error: cannot format when trying to black-format the following code
from {{cookiecutter.project_name}} import my_module
Is there anyway ...
2
votes
0
answers
1k
views
Cookiecutter command on git repo with template returning error
I am trying to run cookiecutter https://github.com/user/template (user is the account and template is the repository that contains the cookiecutter template I created) in an empty repo but whenever I ...
4
votes
1
answer
4k
views
cookie cutter: what's the easiest way to specify variables for the prompts
Is there anything that offers replay-type functionality, by pointing at a predefined prompt-answer file?
What works and what I'd like to achieve.
Let's take an example, using a cookiecutter to prep a ...
2
votes
2
answers
1k
views
How to create multiple sub-folders in cookiecutter template using a sub-folder template
I want to create a template for our internal projects.
The layout of the project contains a variable amount of sub-folders.
I would like to specify the sub-folders to create, inside some ...
3
votes
2
answers
924
views
How to update Cookiecutter Django config for existing project?
I have been building a project on top of cookiecutter django (https://github.com/pydanny/cookiecutter-django), with Celery turned off in the cookiecutter generation settings. However, now I'm finding ...
0
votes
1
answer
166
views
How to automatically pass multiple inputs to prompts in circleci?
I am trying to apply a cookiecutter template. When I run the command "cookiecutter private_git_repo", it asks if I want to use overlays or not? So, I need to pass "yes" to that. Later, it gives ...
0
votes
2
answers
115
views
How do I call a cache busting function inside request.static_url() in my layout.pt chameleon template
I'm using a Cookiecutter Pyramid web development framework. This has three linked files:
utils.py - defines the random cache string to add to an url
views.py - passes utils functions to chameleon ...
1
vote
1
answer
161
views
Is there a cookiecutter fork that generates a project template for CircleCI (instead of TravisCI)?
I have been looking for a fork of the CookieCutter project (see https://cookiecutter.readthedocs.io/en/latest/readme.html), which helps generate a python project template that automates building ...
1
vote
3
answers
2k
views
Fresh cookiecutter django project shows "Invalid syntax" at environ.py
I started my first project with cookiecutter using the cookiecutter-django template.
When I tried to start it from PyCharm using the virtualenv, it gave me an error in a lib file: environ.py, ...
3
votes
1
answer
2k
views
Sphinx fails to import module dependencies
The python tool that writing, awscli-bastion, has the following directory structure built by cookiecutter.
.
├── awscli_bastion
│ ├── __init__.py
│ ├── cache.py
│ ├── cli.py
│ ├── credentials....
2
votes
3
answers
696
views
Django CMS - cookie cutter : The form could not be loaded. Please check that the server is running correctly
I started learning web development at a company, and was tasked with making a simple app in cookiecutter django, and then integrating django-cms into it.
I used django cookie-cutter to start a ...
0
votes
1
answer
413
views
Running Python Cookiecutter to get template from GitHub results in subprocess.CalledProcessError, returned non-zero exit status 128
While running Cookiecutter, I encountered the following error message:
C:\Users\Al>cookiecutter https://github.com/asweigart/cookiecutter-basicpythonproject
You've downloaded C:\Users\Al\....
2
votes
1
answer
2k
views
How to import the module to test into the test module
The problem
I have a directory structure for my project which follows the standard for Python packages, as it was created with this cookiecutter template:
https://github.com/audreyr/cookiecutter-...
0
votes
1
answer
2k
views
If statement with cookiecutter has bad syntax
I'm trying to use cookiecutter as the first time in my django project in order to create project skeleton.
In my cookiecutter.project_slug, I have a base.py settings file with this part at the end:
...