More repo_name -> project_slug cleanup

This commit is contained in:
Audrey Roy Greenfeld 2016-04-20 11:41:17 -07:00
parent 7cb5c0bba4
commit fb59c5117b
6 changed files with 11 additions and 11 deletions

2
.gitignore vendored
View File

@ -28,7 +28,7 @@ _build
# Project Specific Stuff
local_settings.py
repo_name
project_slug
my_test_project/*
# Generated when running py.test for the Cookiecutter Django generation tests

View File

@ -94,7 +94,7 @@ You'll be prompted for some values. Provide them, then a Django project will be
**Warning**: After this point, change 'Daniel Greenfeld', 'pydanny', etc to your own information.
**Warning**: repo_name must be a valid Python module name or you will have issues on imports.
**Warning**: project_slug must be a valid Python module name or you will have issues on imports.
Answer the prompts with your own desired options_. For example::
@ -105,7 +105,7 @@ Answer the prompts with your own desired options_. For example::
Receiving objects: 100% (550/550), 127.66 KiB | 58 KiB/s, done.
Resolving deltas: 100% (283/283), done.
project_name [project_name]: Reddit Clone
repo_name [Reddit_Clone]: reddit
project_slug [Reddit_Clone]: reddit
author_name [Your Name]: Daniel Roy Greenfeld
email [Your email]: pydanny@gmail.com
description [A short description of the project.]: A reddit clone.

View File

@ -19,9 +19,9 @@ Then install the requirements for your local development::
.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
Then, create a PostgreSQL database with the following command, where `[repo_name]` is what value you entered for your project's `repo_name`::
Then, create a PostgreSQL database with the following command, where `[project_slug]` is what value you entered for your project's `project_slug`::
$ createdb [repo_name]
$ createdb [project_slug]
`cookiecutter-django` uses the excellent `django-environ`_ package with its ``DATABASE_URL`` environment variable to simplify database configuration in your Django settings. Now all you have to do is compose a definition for ``DATABASE_URL``:

View File

@ -4,7 +4,7 @@ Project Generation Options
project_name [project_name]:
Your human-readable project name, including any capitalization or spaces.
repo_name [project_name]:
project_slug [project_name]:
The slug of your project, without dashes or spaces. Used to name your repo
and in other places where a Python-importable version of your project name
is needed.

View File

@ -1,4 +1,4 @@
repo_name = '{{ cookiecutter.project_slug }}'
project_slug = '{{ cookiecutter.project_slug }}'
if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), 'Repo name should be valid Python identifier!'
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'

View File

@ -54,7 +54,7 @@ def test_default_configuration(cookies, context):
result = cookies.bake(extra_context=context)
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == context['repo_name']
assert result.project.basename == context['project_slug']
assert result.project.isdir()
paths = build_files_list(str(result.project))
@ -72,7 +72,7 @@ def test_enabled_features(cookies, feature_context):
result = cookies.bake(extra_context=feature_context)
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == feature_context['repo_name']
assert result.project.basename == feature_context['project_slug']
assert result.project.isdir()
paths = build_files_list(str(result.project))