mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-03 13:14:28 +03:00
Resolved conflict from changed base.html not having HTML IDs
This commit is contained in:
commit
acdec670f0
33
CHANGELOG.md
33
CHANGELOG.md
|
@ -2,6 +2,39 @@
|
||||||
All enhancements and patches to cookiecutter-django will be documented in this file.
|
All enhancements and patches to cookiecutter-django will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [2015-10-28]
|
||||||
|
### Changed
|
||||||
|
- Update deployment-on-heroku.rst for ADMIN_URL (@yunti)
|
||||||
|
|
||||||
|
## [2015-10-27]
|
||||||
|
### Added
|
||||||
|
- Added sudo: true to the travis file (@MathijsHoogland)
|
||||||
|
|
||||||
|
## [2015-10-25]
|
||||||
|
### Added
|
||||||
|
- Move current logging config into production.py since it's not useful locally anyway. Used only if not using Sentry. (@audreyr)
|
||||||
|
- `setup.py` so we can list it on PyPI and therefore displayed on djangopackages.com as compatible with Python 3. (@pydanny)
|
||||||
|
- Versioning and tagging policy (@pydanny)
|
||||||
|
- Fixed flake8 issue (@pydanny)
|
||||||
|
|
||||||
|
## [2015-10-24]
|
||||||
|
### Changed
|
||||||
|
- Update nav in base template to latest Bootstrap 4 version (@audreyr)
|
||||||
|
- Replaced ADD with COPY in dockerfiles (@audreyr)
|
||||||
|
- Simplified development dockerfile (@jayfk)
|
||||||
|
- Moved the docker postgres volume on the development environment to it's own subfolder (@jayfk)
|
||||||
|
- Renamed DJANGO_CACHE_URL to REDIS_URL (@jayfk / proposed by @pydanny)
|
||||||
|
|
||||||
|
## [2015-10-22]
|
||||||
|
### Removed
|
||||||
|
- Remove unnecessary .gitkeep in static/images/ (@audreyr)
|
||||||
|
|
||||||
|
## [2015-10-21]
|
||||||
|
### Changed
|
||||||
|
- Updated requirements (@theskumar)
|
||||||
|
### Removed
|
||||||
|
- editorconfig comment that was just a isort settings link (@pydanny)
|
||||||
|
|
||||||
## [2015-10-19]
|
## [2015-10-19]
|
||||||
### Changed
|
### Changed
|
||||||
- On Windows, don't install psycopg2 locally. Still install it in test/prod which are assumed to be Unix. (@audreyr)
|
- On Windows, don't install psycopg2 locally. Still install it in test/prod which are assumed to be Unix. (@audreyr)
|
||||||
|
|
|
@ -29,6 +29,7 @@ You can either push the 'deploy' button in your generated README.rst or run thes
|
||||||
heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
|
heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
|
||||||
|
|
||||||
heroku config:set PYTHONHASHSEED=random
|
heroku config:set PYTHONHASHSEED=random
|
||||||
|
heroku config:set DJANGO_ADMIN_URL=\^somelocation/
|
||||||
|
|
||||||
git push heroku master
|
git push heroku master
|
||||||
heroku run python manage.py migrate
|
heroku run python manage.py migrate
|
||||||
|
|
56
setup.py
Normal file
56
setup.py
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
from setuptools import setup
|
||||||
|
except ImportError:
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
# Our version ALWAYS matches the version of Django we support
|
||||||
|
# If Django has a new release, we branch, tag, then update this setting after the tag.
|
||||||
|
version = "1.8.5"
|
||||||
|
|
||||||
|
if sys.argv[-1] == 'tag':
|
||||||
|
os.system("git tag -a %s -m 'version %s'" % (version, version))
|
||||||
|
os.system("git push --tags")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
with open('README.rst') as readme_file:
|
||||||
|
long_description = readme_file.read()
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='cookiecutter-django',
|
||||||
|
version=version,
|
||||||
|
description='A Cookiecutter template for creating production-ready Django projects quickly.',
|
||||||
|
long_description=long_description,
|
||||||
|
author='Daniel Roy Greenfeld',
|
||||||
|
author_email='pydanny@gmail.com',
|
||||||
|
url='https://github.com/pydanny/cookiecutter-django',
|
||||||
|
packages=[],
|
||||||
|
license='BSD',
|
||||||
|
zip_safe=False,
|
||||||
|
classifiers=[
|
||||||
|
'Development Status :: 4 - Beta',
|
||||||
|
'Environment :: Console',
|
||||||
|
'Framework :: Django :: 1.8',
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'License :: OSI Approved :: BSD License',
|
||||||
|
'Programming Language :: Python',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: 3.5',
|
||||||
|
'Programming Language :: Python :: Implementation :: CPython',
|
||||||
|
'Programming Language :: Python :: Implementation :: PyPy',
|
||||||
|
'Topic :: Software Development',
|
||||||
|
],
|
||||||
|
keywords=(
|
||||||
|
'cookiecutter, Python, projects, project templates, django, '
|
||||||
|
'skeleton, scaffolding, project directory, setup.py'
|
||||||
|
),
|
||||||
|
)
|
|
@ -13,7 +13,6 @@ indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[*.py]
|
[*.py]
|
||||||
# https://github.com/timothycrosley/isort/wiki/isort-Settings
|
|
||||||
line_length=120
|
line_length=120
|
||||||
known_first_party={{ cookiecutter.repo_name }}
|
known_first_party={{ cookiecutter.repo_name }}
|
||||||
multi_line_output=3
|
multi_line_output=3
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
sudo: true
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
||||||
|
|
|
@ -6,16 +6,16 @@ FROM python:2.7
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
# Requirements have to be pulled and installed here, otherwise caching won't work
|
||||||
ADD ./requirements /requirements
|
COPY ./requirements /requirements
|
||||||
|
|
||||||
RUN pip install -r /requirements/production.txt
|
RUN pip install -r /requirements/production.txt
|
||||||
|
|
||||||
RUN groupadd -r django && useradd -r -g django django
|
RUN groupadd -r django && useradd -r -g django django
|
||||||
ADD . /app
|
COPY . /app
|
||||||
RUN chown -R django /app
|
RUN chown -R django /app
|
||||||
|
|
||||||
ADD ./compose/django/gunicorn.sh /gunicorn.sh
|
COPY ./compose/django/gunicorn.sh /gunicorn.sh
|
||||||
ADD ./compose/django/entrypoint.sh /entrypoint.sh
|
COPY ./compose/django/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh && chown django /entrypoint.sh
|
RUN chmod +x /entrypoint.sh && chown django /entrypoint.sh
|
||||||
RUN chmod +x /gunicorn.sh && chown django /gunicorn.sh
|
RUN chmod +x /gunicorn.sh && chown django /gunicorn.sh
|
||||||
|
|
|
@ -6,19 +6,11 @@ FROM python:2.7
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
# Requirements have to be pulled and installed here, otherwise caching won't work
|
||||||
ADD ./requirements /requirements
|
COPY ./requirements /requirements
|
||||||
|
|
||||||
RUN pip install -r /requirements/local.txt
|
RUN pip install -r /requirements/local.txt
|
||||||
|
|
||||||
RUN groupadd -r django && useradd -r -g django django
|
COPY ./compose/django/entrypoint.sh /entrypoint.sh
|
||||||
ADD . /app
|
RUN chmod +x /entrypoint.sh
|
||||||
RUN chown -R django /app
|
|
||||||
|
|
||||||
ADD ./compose/django/gunicorn.sh /gunicorn.sh
|
|
||||||
ADD ./compose/django/entrypoint.sh /entrypoint.sh
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh && chown django /entrypoint.sh
|
|
||||||
RUN chmod +x /gunicorn.sh && chown django /gunicorn.sh
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ set -e
|
||||||
# Since docker-compose relies heavily on environment variables itself for configuration, we'd have to define multiple
|
# Since docker-compose relies heavily on environment variables itself for configuration, we'd have to define multiple
|
||||||
# environment variables just to support cookiecutter out of the box. That makes no sense, so this little entrypoint
|
# environment variables just to support cookiecutter out of the box. That makes no sense, so this little entrypoint
|
||||||
# does all this for us.
|
# does all this for us.
|
||||||
export DJANGO_CACHE_URL=redis://redis:6379/0
|
export REDIS_URL=redis://redis:6379/0
|
||||||
|
|
||||||
# the official postgres image uses 'postgres' as default user if not set explictly.
|
# the official postgres image uses 'postgres' as default user if not set explictly.
|
||||||
if [ -z "$POSTGRES_ENV_POSTGRES_USER" ]; then
|
if [ -z "$POSTGRES_ENV_POSTGRES_USER" ]; then
|
||||||
|
@ -13,6 +13,6 @@ fi
|
||||||
|
|
||||||
export DATABASE_URL=postgres://$POSTGRES_ENV_POSTGRES_USER:$POSTGRES_ENV_POSTGRES_PASSWORD@postgres:5432/$POSTGRES_ENV_POSTGRES_USER
|
export DATABASE_URL=postgres://$POSTGRES_ENV_POSTGRES_USER:$POSTGRES_ENV_POSTGRES_PASSWORD@postgres:5432/$POSTGRES_ENV_POSTGRES_USER
|
||||||
{% if cookiecutter.use_celery == 'y' %}
|
{% if cookiecutter.use_celery == 'y' %}
|
||||||
export CELERY_BROKER_URL=$DJANGO_CACHE_URL
|
export CELERY_BROKER_URL=$REDIS_URL
|
||||||
{% endif %}
|
{% endif %}
|
||||||
exec "$@"
|
exec "$@"
|
|
@ -220,55 +220,6 @@ LOGIN_URL = 'account_login'
|
||||||
|
|
||||||
# SLUGLIFIER
|
# SLUGLIFIER
|
||||||
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
|
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
|
||||||
|
|
||||||
|
|
||||||
# LOGGING CONFIGURATION
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
|
|
||||||
# A sample logging configuration. The only tangible logging
|
|
||||||
# performed by this configuration is to send an email to
|
|
||||||
# the site admins on every HTTP 500 error when DEBUG=False.
|
|
||||||
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
|
||||||
# more details on how to customize your logging configuration.
|
|
||||||
LOGGING = {
|
|
||||||
'version': 1,
|
|
||||||
'disable_existing_loggers': False,
|
|
||||||
'filters': {
|
|
||||||
'require_debug_false': {
|
|
||||||
'()': 'django.utils.log.RequireDebugFalse'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'formatters': {
|
|
||||||
'verbose': {
|
|
||||||
'format': '%(levelname)s %(asctime)s %(module)s '
|
|
||||||
'%(process)d %(thread)d %(message)s'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'handlers': {
|
|
||||||
'mail_admins': {
|
|
||||||
'level': 'ERROR',
|
|
||||||
'filters': ['require_debug_false'],
|
|
||||||
'class': 'django.utils.log.AdminEmailHandler'
|
|
||||||
},
|
|
||||||
'console': {
|
|
||||||
'level': 'DEBUG',
|
|
||||||
'class': 'logging.StreamHandler',
|
|
||||||
'formatter': 'verbose',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'loggers': {
|
|
||||||
'django.request': {
|
|
||||||
'handlers': ['mail_admins'],
|
|
||||||
'level': 'ERROR',
|
|
||||||
'propagate': True
|
|
||||||
},
|
|
||||||
'django.security.DisallowedHost': {
|
|
||||||
'level': 'ERROR',
|
|
||||||
'handlers': ['console', 'mail_admins'],
|
|
||||||
'propagate': True
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{% if cookiecutter.use_celery == "y" %}
|
{% if cookiecutter.use_celery == "y" %}
|
||||||
########## CELERY
|
########## CELERY
|
||||||
INSTALLED_APPS += ('{{cookiecutter.repo_name}}.taskapp.celery.CeleryConfig',)
|
INSTALLED_APPS += ('{{cookiecutter.repo_name}}.taskapp.celery.CeleryConfig',)
|
||||||
|
|
|
@ -216,6 +216,54 @@ RAVEN_CONFIG = {
|
||||||
'CELERY_LOGLEVEL': env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO),
|
'CELERY_LOGLEVEL': env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO),
|
||||||
'DSN': SENTRY_DSN
|
'DSN': SENTRY_DSN
|
||||||
}
|
}
|
||||||
|
{% elif cookiecutter.use_sentry == "n" %}
|
||||||
|
# LOGGING CONFIGURATION
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
|
||||||
|
# A sample logging configuration. The only tangible logging
|
||||||
|
# performed by this configuration is to send an email to
|
||||||
|
# the site admins on every HTTP 500 error when DEBUG=False.
|
||||||
|
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
||||||
|
# more details on how to customize your logging configuration.
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'filters': {
|
||||||
|
'require_debug_false': {
|
||||||
|
'()': 'django.utils.log.RequireDebugFalse'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'formatters': {
|
||||||
|
'verbose': {
|
||||||
|
'format': '%(levelname)s %(asctime)s %(module)s '
|
||||||
|
'%(process)d %(thread)d %(message)s'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'handlers': {
|
||||||
|
'mail_admins': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'filters': ['require_debug_false'],
|
||||||
|
'class': 'django.utils.log.AdminEmailHandler'
|
||||||
|
},
|
||||||
|
'console': {
|
||||||
|
'level': 'DEBUG',
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
'formatter': 'verbose',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'django.request': {
|
||||||
|
'handlers': ['mail_admins'],
|
||||||
|
'level': 'ERROR',
|
||||||
|
'propagate': True
|
||||||
|
},
|
||||||
|
'django.security.DisallowedHost': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'handlers': ['console', 'mail_admins'],
|
||||||
|
'propagate': True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Custom Admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %}
|
# Custom Admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %}
|
||||||
ADMIN_URL = env('DJANGO_ADMIN_URL')
|
ADMIN_URL = env('DJANGO_ADMIN_URL')
|
||||||
|
|
|
@ -3,7 +3,7 @@ postgres:
|
||||||
volumes:
|
volumes:
|
||||||
# If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed
|
# If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed
|
||||||
# for more info see here: https://github.com/boot2docker/boot2docker/issues/581
|
# for more info see here: https://github.com/boot2docker/boot2docker/issues/581
|
||||||
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
- /data/dev/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
django:
|
django:
|
||||||
dockerfile: Dockerfile-dev
|
dockerfile: Dockerfile-dev
|
||||||
|
|
|
@ -34,7 +34,7 @@ psycopg2==2.6.1
|
||||||
|
|
||||||
# Unicode slugification
|
# Unicode slugification
|
||||||
unicode-slugify==0.1.3
|
unicode-slugify==0.1.3
|
||||||
django-autoslug==1.9.2
|
django-autoslug==1.9.3
|
||||||
|
|
||||||
# Time zones support
|
# Time zones support
|
||||||
pytz==2015.6
|
pytz==2015.6
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# Local development dependencies go here
|
# Local development dependencies go here
|
||||||
-r base.txt
|
-r base.txt
|
||||||
coverage==4.0
|
coverage==4.0.1
|
||||||
Sphinx
|
Sphinx
|
||||||
django-extensions==1.5.7
|
django-extensions==1.5.7
|
||||||
Werkzeug==0.10.4
|
Werkzeug==0.10.4
|
||||||
django-test-plus==1.0.9
|
django-test-plus==1.0.9
|
||||||
factory_boy==2.5.2
|
factory_boy==2.6.0
|
||||||
|
|
||||||
# django-debug-toolbar that works with Django 1.5+
|
# django-debug-toolbar that works with Django 1.5+
|
||||||
django-debug-toolbar==1.4
|
django-debug-toolbar==1.4
|
||||||
|
|
|
@ -30,31 +30,43 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="m-b">
|
<div class="m-b">
|
||||||
<nav class="navbar navbar-dark navbar-static-top bg-inverse">
|
<nav class="navbar navbar-dark navbar-static-top bg-inverse">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="/">{% endraw %}{{ cookiecutter.project_name }}{% raw %}</a>
|
<a class="navbar-brand" href="/">{% endraw %}{{ cookiecutter.project_name }}{% raw %}</a>
|
||||||
<button type="button" class="navbar-toggler hidden-sm-up pull-right" data-toggle="collapse" data-target="#bs-navbar-collapse-1">
|
<button type="button" class="navbar-toggler hidden-sm-up pull-right" data-toggle="collapse" data-target="#bs-navbar-collapse-1">
|
||||||
☰
|
☰
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||||
<div class="collapse navbar-toggleable-xs" id="bs-navbar-collapse-1">
|
<div class="collapse navbar-toggleable-xs" id="bs-navbar-collapse-1">
|
||||||
<nav class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<a class="nav-link nav-item" href="{% url 'home' %}">Home</a>
|
<li class="nav-item">
|
||||||
<a class="nav-link nav-item" href="{% url 'about' %}">About</a>
|
<a class="nav-link" href="{% url 'home' %}">Home</a>
|
||||||
</nav>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
<nav class="nav navbar-nav pull-right">
|
<a class="nav-link" href="{% url 'about' %}">About</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="nav navbar-nav pull-right">
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<a class="nav-link nav-item" href="{% url 'users:detail' request.user.username %}">{% trans "My Profile" %}</a>
|
<li class="nav-item">
|
||||||
<a class="nav-link nav-item" href="{% url 'account_logout' %}">{% trans "Logout" %}</a>
|
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% trans "My Profile" %}</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'account_logout' %}">{% trans "Logout" %}</a>
|
||||||
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a id="sign-up-link" class="nav-link nav-item" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
<li class="nav-item">
|
||||||
<a id="log-in-link" class="nav-link nav-item" href="{% url 'account_login' %}">{% trans "Log In" %}</a>
|
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% trans "Log In" %}</a>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</nav>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user