strip dots in default project_slug (#1865)

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
This commit is contained in:
Peter Coles 2018-11-14 14:23:31 -05:00 committed by Nikita Shupeyko
parent c6fd1c1905
commit 4e39a9f8f0
2 changed files with 2 additions and 1 deletions

View File

@ -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`_

View File

@ -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",