New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic example doesn't work #1969
Comments
You have already installed cookiecutter in some venv, or even globally with |
Ah! Ok, got it. I didn't see the normal |
Actually, now with a basic project it still doesn't seem to be working. I made the // cookiecutter.json
{
"repo_name": "reponame",
"drf": true,
} Directory structure
Inside the <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
{% if cookiecutter.drf %}
DRF
{% endif %}
</body>
</html> When I run I receive the error: C:\Users\zackp\Desktop\cookiecutter>cookiecutter template.zip
A valid repository for "template.zip" could not be found in the following locations:
C:\Users\zackp\AppData\Local\Temp\tmpkxf18ke5\template/{{ cookiecutter.repo_name }}
C:\Users\zackp\Desktop\cookiecutter> |
You've definitely got it installed correctly now at least - so well done! From personal experience, not only is it its default mode, but I felt like cookiecutter really really wanted me to fill in the options interactively. It was hard to get it to do otherwise. It does have the capability of taking the inputs from a file (I'm not promsing json) instead of interactively, but you need to use a specific command line option or two to get it to do so. |
For starters I used a yaml file of the form:
|
Then although I've not tried it from a .zip file, I've been able to render directly from a repo on github (like cookiecutter_django) using:
Cookiecutter does cache the template, which is a great feature for experimentation. But again, I recall that's easier to choose interactively, than to set from a CLI flag. |
If you're still having no joy, you'll have to rename the folder yourself, but try
ought to render that html template from your json file, without too much extra effort. |
I just really thought a lot of this stuff might be somewhere in the normal intro docs 😅 The intro docs example literally shows a zip file. I'm happy to do it without 😅 is there not a way to do it locally and with just a normal json file? |
Indeed - I would've thought so too. I'm not an expert in the project, but it is incredibly popular. I think it's just intended for a different application and user base. Maybe someone else can help you with zip files. All JSON is valid YAML by the way. But I recall wondering why it all had to go behind the |
Description:
I tried running
pipx cookiecutter gh:audreyfeldroy/cookiecutter-pypackage
and got error:This is after
pip install pipx
andpip install cookiecutter
, straight from the very first part of the docs 🤷♂️The text was updated successfully, but these errors were encountered: