From d0b06e8193b161f6bf194855cd99567f20c91600 Mon Sep 17 00:00:00 2001 From: Peter Coles Date: Wed, 14 Nov 2018 02:48:02 -0500 Subject: [PATCH] strip dots in default project_slug This removes periods from the auto-generated project_slug (and also runs trim for good measure). Otherwise if you have a "." in your project name (e.g., you used a website domain name as your project name), you will encounter an error about it failing for a `project_slug.isidentifier()` check. Update: changed "." to be replace with "_" instead of "", per request from @webyneter --- CONTRIBUTORS.rst | 1 + cookiecutter.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 35508eb76..b64828956 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -144,6 +144,7 @@ Listed in alphabetical order. Pablo `@oubiga`_ Parbhat Puri `@parbhat`_ Peter Bittner `@bittner`_ + Peter Coles `@mrcoles`_ Pierre Chiquet `@pchiquet`_ Raphael Pierzina `@hackebrot`_ Raony GuimarĂ£es CorrĂªa `@raonyguimaraes`_ diff --git a/cookiecutter.json b/cookiecutter.json index 9aff23f22..b5dda0c70 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "My Awesome Project", - "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_') }}", + "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "description": "Behold My Awesome Project!", "author_name": "Daniel Roy Greenfeld", "domain_name": "example.com",