Skip to content

Commit

Permalink
Change repo_name to project_slug for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyfeldroy committed Apr 20, 2016
1 parent bfce5e5 commit 15f350f
Show file tree
Hide file tree
Showing 146 changed files with 59 additions and 361 deletions.
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(' ', '_')|replace('-', '_') }}",
"project_slug": "{{ cookiecutter.project_name|replace(' ', '_')|replace('-', '_') }}",
"author_name": "Your Name",
"email": "Your email",
"description": "A short description of the project.",
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
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
8 changes: 4 additions & 4 deletions docs/deployment-with-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ it needs to do is to run `docker-compose up` in your projects root directory.

If you are using `supervisor`, you can use this file as a starting point::

[program:{{cookiecutter.repo_name}}]
[program:{{cookiecutter.project_slug}}]
command=docker-compose up
directory=/path/to/{{cookiecutter.repo_name}}
directory=/path/to/{{cookiecutter.project_slug}}
redirect_stderr=true
autostart=true
autorestart=true
priority=10


Place it in `/etc/supervisor/conf.d/{{cookiecutter.repo_name}}.conf` and run::
Place it in `/etc/supervisor/conf.d/{{cookiecutter.project_slug}}.conf` and run::

supervisorctl reread
supervisorctl start {{cookiecutter.repo_name}}
supervisorctl start {{cookiecutter.project_slug}}

To get the status, run::

Expand Down
2 changes: 1 addition & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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/pydanny/cookiecutter-django/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/pydanny/cookiecutter-django/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/%7B%7Bcookiecutter.project_slug%7D%7D/contrib/sites/migrations/0002_set_site_domain_and_name.py


Why aren't you using just one configuration file (12-Factor App)
Expand Down
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
6 changes: 3 additions & 3 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
1. Generates and saves random secret key
2. Removes the taskapp if celery isn't going to be used
3. Removes the .idea directory if PyCharm isn't going to be used
4. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
4. Copy files from /docs/ to {{ cookiecutter.project_slug }}/docs/
TODO: this might have to be moved to a pre_gen_hook
Expand Down Expand Up @@ -87,7 +87,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 Expand Up @@ -197,5 +197,5 @@ def remove_grunt_files():
" mailhog service to your docker configuration manually."
)

# 4. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
# 4. Copy files from /docs/ to {{ cookiecutter.project_slug }}/docs/
# copy_doc_files(PROJECT_DIRECTORY)
2 changes: 1 addition & 1 deletion hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
repo_name = '{{ cookiecutter.repo_name }}'
repo_name = '{{ cookiecutter.project_slug }}'

if hasattr(repo_name, 'isidentifier'):
assert repo_name.isidentifier(), 'Repo name should be valid Python identifier!'
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}}/*
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
include = {{cookiecutter.repo_name}}/*
include = {{cookiecutter.project_slug}}/*
omit = *migrations*, *tests*
plugins =
django_coverage_plugin
File renamed without changes.
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ htmlcov
# Provided default Pycharm Run/Debug Configurations should be tracked by git
# In case of local modifications made by Pycharm, use update-index command
# for each changed file, like this:
# git update-index --assume-unchanged .idea/{{cookiecutter.repo_name}}.iml
# git update-index --assume-unchanged .idea/{{cookiecutter.project_slug}}.iml
!.idea/runConfigurations/
!.idea/{{cookiecutter.repo_name}}.iml
!.idea/{{cookiecutter.project_slug}}.iml
!.idea/vcs.xml
!.idea/webResources.xml
{% endif %}
Expand All @@ -66,7 +66,7 @@ node_modules/
.env

# User-uploaded media
{{ cookiecutter.repo_name }}/media/
{{ cookiecutter.project_slug }}/media/

# Hitch directory
tests/.hitch
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: gunicorn config.wsgi:application
{% if cookiecutter.use_celery == "y" -%}
worker: {% if cookiecutter.use_newrelic == "y" %}newrelic-admin run-program {% endif %}celery worker --app={{cookiecutter.repo_name}}.taskapp --loglevel=info
worker: {% if cookiecutter.use_newrelic == "y" %}newrelic-admin run-program {% endif %}celery worker --app={{cookiecutter.project_slug}}.taskapp --loglevel=info
{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ To run a celery worker:

.. code-block:: bash
cd {{cookiecutter.repo_name}}
celery -A {{cookiecutter.repo_name}}.taskapp worker -l info
cd {{cookiecutter.project_slug}}
celery -A {{cookiecutter.project_slug}}.taskapp worker -l info
Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right.

Expand Down Expand Up @@ -119,7 +119,7 @@ To install the test runner::

$ pip install hitch

To run the tests, enter the {{cookiecutter.repo_name}}/tests directory and run the following commands::
To run the tests, enter the {{cookiecutter.project_slug}}/tests directory and run the following commands::

$ hitch init

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "{{cookiecutter.repo_name}}",
"name": "{{cookiecutter.project_slug}}",
"description": "{{cookiecutter.description}}",
"env": {
"BUILDPACK_URL": "https://github.com/heroku/heroku-buildpack-python",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import environ

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 @@ -43,7 +43,7 @@

# Apps specific for this project go here.
LOCAL_APPS = (
'{{ cookiecutter.repo_name }}.users', # custom users app
'{{ cookiecutter.project_slug }}.users', # custom users app
# Your stuff: custom apps go here
)

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

# DEBUG
Expand Down Expand Up @@ -99,7 +99,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 Expand Up @@ -213,8 +213,8 @@
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'

ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True)
ACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapters.AccountAdapter'
SOCIALACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapters.SocialAccountAdapter'
ACCOUNT_ADAPTER = '{{cookiecutter.project_slug}}.users.adapters.AccountAdapter'
SOCIALACCOUNT_ADAPTER = '{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter'

# Custom user app defaults
# Select the correct user model
Expand All @@ -226,7 +226,7 @@
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
{% if cookiecutter.use_celery == 'y' %}
########## CELERY
INSTALLED_APPS += ('{{cookiecutter.repo_name}}.taskapp.celery.CeleryConfig',)
INSTALLED_APPS += ('{{cookiecutter.project_slug}}.taskapp.celery.CeleryConfig',)
# if you are not using the django database broker (e.g. rabbitmq, redis, memcached), you can remove the next line.
INSTALLED_APPS += ('kombu.transport.django',)
BROKER_URL = env('CELERY_BROKER_URL', default='django://')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
url(settings.ADMIN_URL, include(admin.site.urls)),

# User management
url(r'^users/', include('{{ cookiecutter.repo_name }}.users.urls', namespace='users')),
url(r'^users/', include('{{ cookiecutter.project_slug }}.users.urls', namespace='users')),
url(r'^accounts/', include('allauth.urls')),

# Your stuff: custom urls includes go here
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- postgres_data_dev:/var/lib/postgresql/data
- postgres_backup_dev:/backups
environment:
- POSTGRES_USER={{cookiecutter.repo_name}}
- POSTGRES_USER={{cookiecutter.project_slug}}

django:
build:
Expand All @@ -21,7 +21,7 @@ services:
depends_on:
- postgres
environment:
- POSTGRES_USER={{cookiecutter.repo_name}}
- POSTGRES_USER={{cookiecutter.project_slug}}
volumes:
- .:/app
ports:
Expand All @@ -36,7 +36,7 @@ services:
depends_on:
- postgres
environment:
- POSTGRES_USER={{cookiecutter.repo_name}}
- POSTGRES_USER={{cookiecutter.project_slug}}
volumes:
- .:/app
links:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.repo_name}}.taskapp worker -l INFO
command: celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO

celerybeat:
build:
Expand All @@ -53,5 +53,5 @@ services:
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO
{% endif %}
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,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 @@ -187,7 +187,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index',
'{{ cookiecutter.repo_name }}.tex',
'{{ cookiecutter.project_slug }}.tex',
'{{ cookiecutter.project_name }} Documentation',
"""{{ cookiecutter.author_name }}""", 'manual'),
]
Expand Down Expand Up @@ -218,7 +218,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', '{{ cookiecutter.repo_name }}', '{{ cookiecutter.project_name }} Documentation',
('index', '{{ cookiecutter.project_slug }}', '{{ cookiecutter.project_name }} Documentation',
["""{{ cookiecutter.author_name }}"""], 1)
]

Expand All @@ -232,7 +232,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', '{{ cookiecutter.repo_name }}', '{{ cookiecutter.project_name }} Documentation',
('index', '{{ cookiecutter.project_slug }}', '{{ cookiecutter.project_name }} Documentation',
"""{{ cookiecutter.author_name }}""", '{{ cookiecutter.project_name }}',
"""{{ cookiecutter.description }}""", 'Miscellaneous'),
]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ -69,4 +69,4 @@ Most of the files from `.idea/` were added to `.gitignore` with a few exceptions

In theory you can remove them from repository, but then, other people will lose a ability to initialize a project from provided configurations as you did. To get rid of this annoying state, you can run command::

$ git update-index --assume-unchanged {{cookiecutter.repo_name}}.iml
$ git update-index --assume-unchanged {{cookiecutter.project_slug}}.iml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DJANGO_SENTRY_DSN=
{% endif %}
{% if cookiecutter.use_newrelic == 'y' -%}
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_APP_NAME={{cookiecutter.repo_name}}
NEW_RELIC_APP_NAME={{cookiecutter.project_slug}}
{% endif %}
{% if cookiecutter.use_opbeat == 'y' -%}
DJANGO_OPBEAT_ORGANIZATION_ID
Expand Down
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}}",
"version": "{{ cookiecutter.version }}",
"dependencies": {},
"devDependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pause_on_failure: false
startup_timeout: 45
shutdown_timeout: 5
environment_variables:
DATABASE_URL: postgres://{{cookiecutter.repo_name}}:[email protected]:15432/{{cookiecutter.repo_name}}
DATABASE_URL: postgres://{{cookiecutter.project_slug}}:[email protected]:15432/{{cookiecutter.project_slug}}
SECRET_KEY: cj5^uos4tfCdfghjkf5hq$9$(@-79^e9&x$3vyf#igvsfm4d=+
CELERY_BROKER_URL: redis://localhost:16379
DJANGO_EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
Expand Down
File renamed without changes.
Loading

0 comments on commit 15f350f

Please sign in to comment.