Change repo_name to project_slug for clarity.

This commit is contained in:
Audrey Roy Greenfeld 2016-04-20 10:00:35 -07:00
parent bfce5e5815
commit 15f350f05e
146 changed files with 59 additions and 361 deletions

View File

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

View File

@ -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:

View File

@ -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::

View File

@ -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)

View File

@ -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
)

View File

@ -4,7 +4,7 @@ Does the following:
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
@ -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)
@ -197,5 +197,5 @@ if '{{ cookiecutter.use_mailhog }}'.lower() == 'y' and '{{ cookiecutter.use_dock
" 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)

View File

@ -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!'

View File

@ -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}}/*

View File

@ -1,5 +1,5 @@
[run]
include = {{cookiecutter.repo_name}}/*
include = {{cookiecutter.project_slug}}/*
omit = *migrations*, *tests*
plugins =
django_coverage_plugin

View File

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

View File

@ -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 %}
@ -66,7 +66,7 @@ node_modules/
.env
# User-uploaded media
{{ cookiecutter.repo_name }}/media/
{{ cookiecutter.project_slug }}/media/
# Hitch directory
tests/.hitch

View File

@ -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 %}

View File

@ -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.
@ -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

View File

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

View File

@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals
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()
@ -43,7 +43,7 @@ THIRD_PARTY_APPS = (
# 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
)
@ -65,7 +65,7 @@ MIDDLEWARE_CLASSES = (
# MIGRATIONS CONFIGURATION
# ------------------------------------------------------------------------------
MIGRATION_MODULES = {
'sites': '{{ cookiecutter.repo_name }}.contrib.sites.migrations'
'sites': '{{ cookiecutter.project_slug }}.contrib.sites.migrations'
}
# DEBUG
@ -99,7 +99,7 @@ MANAGERS = ADMINS
# 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
@ -213,8 +213,8 @@ ACCOUNT_EMAIL_REQUIRED = True
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
@ -226,7 +226,7 @@ LOGIN_URL = 'account_login'
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://')

View File

@ -16,7 +16,7 @@ urlpatterns = [
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

View File

@ -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:
@ -21,7 +21,7 @@ services:
depends_on:
- postgres
environment:
- POSTGRES_USER={{cookiecutter.repo_name}}
- POSTGRES_USER={{cookiecutter.project_slug}}
volumes:
- .:/app
ports:
@ -36,7 +36,7 @@ services:
depends_on:
- postgres
environment:
- POSTGRES_USER={{cookiecutter.repo_name}}
- POSTGRES_USER={{cookiecutter.project_slug}}
volumes:
- .:/app
links:

View File

@ -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:
@ -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 %}

View File

@ -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:

View File

@ -167,7 +167,7 @@ html_static_path = ['_static']
# 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 --------------------------------------------------
@ -187,7 +187,7 @@ latex_elements = {
# (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'),
]
@ -218,7 +218,7 @@ latex_documents = [
# 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)
]
@ -232,7 +232,7 @@ man_pages = [
# (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'),
]

View File

@ -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
)

View File

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

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View File

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

Before

Width:  |  Height:  |  Size: 230 KiB

After

Width:  |  Height:  |  Size: 230 KiB

View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

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

View File

@ -1,5 +1,5 @@
{
"name": "{{cookiecutter.repo_name}}",
"name": "{{cookiecutter.project_slug}}",
"version": "{{ cookiecutter.version }}",
"dependencies": {},
"devDependencies": {

View File

@ -7,7 +7,7 @@ pause_on_failure: false
startup_timeout: 45
shutdown_timeout: 5
environment_variables:
DATABASE_URL: postgres://{{cookiecutter.repo_name}}:password@127.0.0.1:15432/{{cookiecutter.repo_name}}
DATABASE_URL: postgres://{{cookiecutter.project_slug}}:password@127.0.0.1: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

View File

@ -40,12 +40,12 @@ class ExecutionEngine(hitchtest.ExecutionEngine):
shutdown_timeout=float(self.settings['shutdown_timeout']),
)
postgres_user = hitchpostgres.PostgresUser('{{cookiecutter.repo_name}}', 'password')
postgres_user = hitchpostgres.PostgresUser('{{cookiecutter.project_slug}}', 'password')
self.services['Postgres'] = hitchpostgres.PostgresService(
postgres_package=postgres_package,
users=[postgres_user, ],
databases=[hitchpostgres.PostgresDatabase('{{cookiecutter.repo_name}}', postgres_user), ]
databases=[hitchpostgres.PostgresDatabase('{{cookiecutter.project_slug}}', postgres_user), ]
)
self.services['HitchSMTP'] = hitchsmtp.HitchSMTPService(port=1025)
@ -65,7 +65,7 @@ class ExecutionEngine(hitchtest.ExecutionEngine):
{% if cookiecutter.use_celery == 'y' %}
self.services['Celery'] = hitchpython.CeleryService(
python=python_package.python,
app='{{cookiecutter.repo_name}}.taskapp', loglevel='INFO',
app='{{cookiecutter.project_slug}}.taskapp', loglevel='INFO',
needs=[
self.services['Redis'], self.services['Django'],
],

View File

@ -11,11 +11,11 @@ if not settings.configured:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover
app = Celery('{{cookiecutter.repo_name}}')
app = Celery('{{cookiecutter.project_slug}}')
class CeleryConfig(AppConfig):
name = '{{cookiecutter.repo_name}}.taskapp'
name = '{{cookiecutter.project_slug}}.taskapp'
verbose_name = 'Celery Config'
def ready(self):

Some files were not shown because too many files have changed in this diff Show More