Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Change repo_name to project_slug for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
valerymelou committed Apr 26, 2016
1 parent 83d09fb commit e6b5307
Show file tree
Hide file tree
Showing 63 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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-gulp generation tests
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ You'll be prompted for some questions, answer them, then it will create a Django

**Warning**: After this point, change 'Valery Melou', 'valerymelou', 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.

It prompts you for questions. Answer them::

Expand All @@ -73,7 +73,7 @@ It prompts you for questions. Answer them::
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]: Valery Melou
email [Your email]: valerymelou@gmail.com
description [A short description of the project.]: A reddit clone.
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"project_name": "project_name",
"repo_name": "{{ cookiecutter.project_name|replace(' ', '_') }}",
"project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_') }}",
"author_name": "Your Name",
"email": "Your email",
"description": "A short description of the project.",
Expand Down
4 changes: 2 additions & 2 deletions docs/developing-locally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,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-gulp` 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``:

Expand Down
2 changes: 1 addition & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ It is there to add a migration so you don't have to manually change the ``sites.

See `0002_set_site_domain_and_name.py`_.

.. _`0002_set_site_domain_and_name.py`: https://github.com/valerymelou/cookiecutter-django-gulp/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.repo_name%7D%7D/contrib/sites/migrations/0002_set_site_domain_and_name.py
.. _`0002_set_site_domain_and_name.py`: https://github.com/valerymelou/cookiecutter-django-gulp/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/%7B%7Bcookiecutter.project_slug%7D%7D/contrib/sites/migrations/0002_set_site_domain_and_name.py
4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.ghc
goto end
)

Expand Down
2 changes: 1 addition & 1 deletion docs/project-generation-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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_slug]:
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.
Expand Down
2 changes: 1 addition & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def remove_task_app(project_directory):
# Determine the local_setting_file_location
task_app_location = os.path.join(
PROJECT_DIRECTORY,
'{{ cookiecutter.repo_name }}/taskapp'
'{{ cookiecutter.project_slug }}/taskapp'
)
shutil.rmtree(task_app_location)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pytest]
python_paths = .
norecursedirs = .tox .git */migrations/* */static/* docs venv */{{cookiecutter.repo_name}}/*
norecursedirs = .tox .git */migrations/* */static/* docs venv */{{ cookiecutter.project_slug }}/*
6 changes: 3 additions & 3 deletions tests/test_cookiecutter_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"project_slug": "my_test_project",
"author_name": "Test Author",
"email": "test@example.com",
"description": "A short description of the project.",
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "{{ cookiecutter.project_slug }}/static/libs"
}
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
include = {{ cookiecutter.project_slug }}/*
omit = *migrations*, *tests*
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ indent_size = 4

[*.py]
line_length=120
known_first_party={{ cookiecutter.repo_name }}
known_first_party={{ cookiecutter.project_slug }}
multi_line_output=3
default_section=THIRDPARTY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ node_modules/
.env

# Static files
{{ cookiecutter.repo_name }}/static/libs/
{{ cookiecutter.project_slug }}/static/libs/
staticfiles/
build/

# User-uploaded media
{{ cookiecutter.repo_name }}/media/
{{ cookiecutter.project_slug }}/media/
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "{{ cookiecutter.repo_name }}",
"name": "{{ cookiecutter.project_slug }}",
"authors": [
"{{ cookiecutter.author_name }}"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


ROOT_DIR = environ.Path(__file__) - 3 # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('{{ cookiecutter.repo_name }}')
APPS_DIR = ROOT_DIR.path('{{ cookiecutter.project_slug }}')

env = environ.Env()

Expand Down Expand Up @@ -63,7 +63,7 @@
# MIGRATIONS CONFIGURATION
# ------------------------------------------------------------------------------
MIGRATION_MODULES = {
'sites': '{{ cookiecutter.repo_name }}.contrib.sites.migrations'
'sites': '{{ cookiecutter.project_slug }}.contrib.sites.migrations'
}


Expand Down Expand Up @@ -102,7 +102,7 @@
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
'default': env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.repo_name}}"),
'default': env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{ cookiecutter.project_slug }}"),
}
DATABASES['default']['ATOMIC_REQUESTS'] = True

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
Local settings for {{cookiecutter.project_name}} project.
Local settings for {{ cookiecutter.project_name }} project.
- Run in Debug mode
- Use console backend for emails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}"
@echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}"
@echo "# devhelp"

epub:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = '{{ cookiecutter.repo_name }}doc'
htmlhelp_basename = '{{ cookiecutter.project_slug }}doc'


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -185,7 +185,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index',
'{{ cookiecutter.repo_name }}.tex',
'{{ cookiecutter.project_slug }}.tex',
u'{{ cookiecutter.project_name }} Documentation',
u"{{ cookiecutter.author_name }}", 'manual'),
]
Expand Down Expand Up @@ -216,7 +216,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
('index', '{{ cookiecutter.project_slug }}', u'{{ cookiecutter.project_name }} Documentation',
[u"{{ cookiecutter.author_name }}"], 1)
]

Expand All @@ -230,7 +230,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
('index', '{{ cookiecutter.project_slug }}', u'{{ cookiecutter.project_name }} Documentation',
u"{{ cookiecutter.author_name }}", '{{ cookiecutter.project_name }}',
'{{ cookiecutter.description }}', 'Miscellaneous'),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.repo_name }}.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.ghc
goto end
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var exec = require('child_process').exec;
var notifier = require('node-notifier');

// Configuration used within this gulpfile
var app = '{{ cookiecutter.repo_name }}';
var app = '{{ cookiecutter.project_slug }}';
var dist = 'build';
var config = {
css: app + '/static/css/**/*.css',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "{{cookiecutter.repo_name}}",
"name": "{{ cookiecutter.project_slug }}",
"version": "{{ cookiecutter.version }}",
"dependencies": {},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions {{cookiecutter.repo_name}}/.bowerrc

This file was deleted.

3 changes: 0 additions & 3 deletions {{cookiecutter.repo_name}}/.coveragerc

This file was deleted.

0 comments on commit e6b5307

Please sign in to comment.