cookiecutter to a global python path
$ pip install cookiecutter
In your project directory run
$ cookiecutter firstname.lastname@example.org:hzdg/cookiecutter-webpack.git
Answer the prompts then
cd into your newly created project directory.
Install npm packages
$ npm install
Start the server
$ npm start
Open up http://localhost:8080 in your browser.
You will have a React / Redux counter app running with redux dev-tools. See the generated
README.md for an explanation of the react / redux project structure.
You can run the test suite
$ npm test
You should also create a new git repo and push it to github
$ git init $ git add . $ git commit -m "Init" $ git remote add origin email@example.com:hzdg/project_name.git $ git push -u origin master
project_name: Your Project Name
repo_name: Name of this projects git repository
repo_owner: Your github username
static_root: Path to where this projects source code lives, or path to static files directory if integrating into an existing project
production_output_path: Path where your compiled bundles should go
author_name: Your Name
description: A short description of the project for the
version: Project version number
nif this is a new project and
yif you're integrating into an existing project. See the notes below about integrating into an existing project.
sass] - use
sassto preprocess styles.
yif you want to include
ejstemplates and loaders in the project. Recommended if not using an existing project.
Integrating into existing projects
You can chain this into an existing cookiecutter project by installing via the projects
./hooks/post_gen_project.py file or just installing it via the command line.
Using post hooks
Here is a django project post hook example that chains this through a django cookiecutter project.
from cookiecutter.main import cookiecutter
existing_project will move/remove some files and dependencies and also add supporting configurations for a django project.
Using command line
Just make sure you use the
--overwrite-if-exists [ or
-f] flag so cookiecutter can work within your existing project structure. You will also probably want to point to your existing projects parent directory and make sure you use the same
repo_name as the project directory so your
package.json files are installed at the project root.
cookiecutter -f -output-dir ../ firstname.lastname@example.org:hzdg/cookiecutter-webpack.git
Accepting pull requests!
Clone the project:
$ git clone email@example.com:hzdg/cookiecutter-webpack.git
Install python and npm dependencies:
$ pip install -r requirements.txt && npm install
Run build tests:
$ npm test