mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 11:34:00 +03:00
Merge branch 'master' into psycopg2-no-binary
This commit is contained in:
commit
575fe7e2f0
|
@ -2,6 +2,10 @@
|
|||
All enhancements and patches to Cookiecutter Django will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [2018-02-16]
|
||||
### Changed
|
||||
- Upgraded to Django 2.0 (@epicwhale)
|
||||
|
||||
## [2018-01-15]
|
||||
### Changed
|
||||
- Removed Elastic Beanstalk support (@pydanny)
|
||||
|
|
|
@ -38,10 +38,10 @@ production-ready Django projects quickly.
|
|||
Features
|
||||
---------
|
||||
|
||||
* For Django 1.11
|
||||
* For Django 2.0
|
||||
* Works with Python 3.6
|
||||
* Renders Django projects with 100% starting test coverage
|
||||
* Twitter Bootstrap_ v4.0.0 - beta 1 (`maintained Foundation fork`_ also available)
|
||||
* Twitter Bootstrap_ v4.0.0 (`maintained Foundation fork`_ also available)
|
||||
* 12-Factor_ based settings via django-environ_
|
||||
* Secure by default. We believe in SSL.
|
||||
* Optimized development and production settings
|
||||
|
@ -111,7 +111,7 @@ Two Scoops of Django 1.11
|
|||
:name: Two Scoops of Django 1.11 Cover
|
||||
:align: center
|
||||
:alt: Two Scoops of Django
|
||||
:target: http://twoscoopspress.org/products/two-scoops-of-django-1-11
|
||||
:target: http://twoscoopspress.com/products/two-scoops-of-django-1-11
|
||||
|
||||
Two Scoops of Django is the best dessert-themed Django reference in the universe
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ project_slug = '{{ cookiecutter.project_slug }}'
|
|||
if hasattr(project_slug, 'isidentifier'):
|
||||
assert project_slug.isidentifier(), "'{}' project slug is not a valid Python identifier.".format(project_slug)
|
||||
|
||||
assert "\\" not in "{{ cookiecutter.author_name }}", "Don't include backslashes in author name."
|
||||
|
||||
|
||||
using_docker = '{{ cookiecutter.use_docker }}'.lower()
|
||||
if using_docker == 'n':
|
||||
TERMINATOR = "\x1b[0m"
|
||||
|
|
|
@ -4,7 +4,7 @@ sh==1.12.14
|
|||
binaryornot==0.4.4
|
||||
|
||||
# Testing
|
||||
pytest==3.3.2
|
||||
pytest==3.4.1
|
||||
pycodestyle==2.3.1
|
||||
pyflakes==1.6.0
|
||||
tox==2.9.1
|
||||
|
|
5
setup.py
5
setup.py
|
@ -10,7 +10,7 @@ except ImportError:
|
|||
|
||||
# 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.11.9'
|
||||
version = '2.0.2'
|
||||
|
||||
if sys.argv[-1] == 'tag':
|
||||
os.system('git tag -a %s -m "version %s"' % (version, version))
|
||||
|
@ -34,7 +34,7 @@ setup(
|
|||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: Console',
|
||||
'Framework :: Django :: 1.11',
|
||||
'Framework :: Django :: 2.0',
|
||||
'Intended Audience :: Developers',
|
||||
'Natural Language :: English',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
|
@ -42,7 +42,6 @@ setup(
|
|||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: Implementation :: CPython',
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
'Topic :: Software Development',
|
||||
],
|
||||
keywords=(
|
||||
|
|
|
@ -19,3 +19,6 @@ docker-compose -f local.yml run django python manage.py test
|
|||
|
||||
# return non-zero status code if there are migrations that have not been created
|
||||
docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
|
||||
|
||||
# Test support for translations
|
||||
docker-compose -f local.yml run --rm django python manage.py makemessages
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
FROM python:3.6
|
||||
FROM python:3.6-alpine
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN apk update \
|
||||
# psycopg2 dependencies
|
||||
&& apk add --virtual build-deps gcc python3-dev musl-dev \
|
||||
&& apk add postgresql-dev \
|
||||
# Pillow dependencies
|
||||
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
|
||||
# CFFI dependencies
|
||||
&& apk add libffi-dev openssl-dev py-cffi \
|
||||
# Translations dependencies
|
||||
&& apk add gettext
|
||||
|
||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
||||
COPY ./requirements /requirements
|
||||
RUN pip install -r /requirements/local.txt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
FROM python:3.6
|
||||
FROM python:3.6-alpine
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN groupadd -r django \
|
||||
&& useradd -r -g django django
|
||||
RUN apk update \
|
||||
# psycopg2 dependencies
|
||||
&& apk add --virtual build-deps gcc python3-dev musl-dev \
|
||||
&& apk add postgresql-dev \
|
||||
# Pillow dependencies
|
||||
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
|
||||
# CFFI dependencies
|
||||
&& apk add libffi-dev openssl-dev py-cffi
|
||||
|
||||
RUN addgroup -S django \
|
||||
&& adduser -S -G django django
|
||||
|
||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
||||
COPY ./requirements /requirements
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
@ -25,7 +25,7 @@ export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$
|
|||
export CELERY_BROKER_URL=$REDIS_URL/0
|
||||
{% endif %}
|
||||
|
||||
function postgres_ready(){
|
||||
postgres_ready() {
|
||||
python << END
|
||||
import sys
|
||||
import psycopg2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
|
|
@ -103,12 +103,8 @@ AWS_QUERYSTRING_AUTH = False
|
|||
# AWS cache settings, don't change unless you know what you're doing:
|
||||
AWS_EXPIRY = 60 * 60 * 24 * 7
|
||||
|
||||
# TODO See: https://github.com/jschneier/django-storages/issues/47
|
||||
# Revert the following and use str after the above-mentioned bug is fixed in
|
||||
# either django-storage-redux or boto
|
||||
control = 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY)
|
||||
AWS_HEADERS = {
|
||||
'Cache-Control': bytes(control, encoding='latin-1')
|
||||
AWS_S3_OBJECT_PARAMETERS = {
|
||||
'CacheControl': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY),
|
||||
}
|
||||
|
||||
# URL that handles the media served from MEDIA_ROOT, used for managing
|
||||
|
@ -177,7 +173,7 @@ TEMPLATES[0]['OPTIONS']['loaders'] = [
|
|||
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
|
||||
DATABASES['default'] = env.db('DATABASE_URL')
|
||||
DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default={{ _DEFAULT_CONN_MAX_AGE }})
|
||||
|
||||
DATABASES['default']['ATOMIC_REQUESTS'] = True
|
||||
|
||||
# CACHING
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
6
{{cookiecutter.project_slug}}/locale/README.rst
Normal file
6
{{cookiecutter.project_slug}}/locale/README.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
Translations
|
||||
============
|
||||
|
||||
Translations will be placed in this folder when running::
|
||||
|
||||
python manage.py makemessages
|
|
@ -6,7 +6,7 @@ wheel==0.30.0
|
|||
|
||||
|
||||
# Conservative Django
|
||||
django==1.11.10 # pyup: <2.0
|
||||
django==2.0.2 # pyup: < 2.1
|
||||
|
||||
# Configuration
|
||||
django-environ==0.4.4
|
||||
|
@ -43,14 +43,14 @@ psycopg2==2.7.4 --no-binary psycopg2
|
|||
awesome-slugify==1.6.5
|
||||
|
||||
# Time zones support
|
||||
pytz==2017.3
|
||||
pytz==2018.3
|
||||
|
||||
# Redis support
|
||||
django-redis==4.8.0
|
||||
redis>=2.10.5
|
||||
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
celery==3.1.25
|
||||
celery==3.1.25 # pyup: <4.0
|
||||
{% endif %}
|
||||
|
||||
{% if cookiecutter.use_compressor == "y" %}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Local development dependencies go here
|
||||
-r base.txt
|
||||
|
||||
coverage==4.5
|
||||
coverage==4.5.1
|
||||
django-coverage-plugin==1.5.0
|
||||
|
||||
Sphinx==1.6.7
|
||||
django-extensions==1.9.9
|
||||
Sphinx==1.7.0
|
||||
django-extensions==2.0.0
|
||||
Werkzeug==0.14.1
|
||||
django-test-plus==1.0.22
|
||||
factory-boy==2.10.0
|
||||
|
@ -13,7 +13,7 @@ factory-boy==2.10.0
|
|||
django-debug-toolbar==1.9.1
|
||||
|
||||
# improved REPL
|
||||
ipdb==0.10.3
|
||||
ipdb==0.11
|
||||
|
||||
pytest-django==3.1.2
|
||||
pytest-sugar==0.9.1
|
||||
|
|
|
@ -16,7 +16,7 @@ gunicorn==19.7.1
|
|||
|
||||
# Static and Media Storage
|
||||
# ------------------------------------------------
|
||||
boto3==1.5.25
|
||||
boto3==1.5.33
|
||||
django-storages==1.6.5
|
||||
{% if cookiecutter.use_whitenoise != 'y' -%}
|
||||
Collectfast==0.6.0
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
psycopg2==2.7.4
|
||||
{%- endif %}
|
||||
|
||||
coverage==4.5
|
||||
coverage==4.5.1
|
||||
flake8==3.5.0 # pyup: != 2.6.0
|
||||
django-test-plus==1.0.22
|
||||
factory-boy==2.10.0
|
||||
|
|
|
@ -22,7 +22,7 @@ class Migration(migrations.Migration):
|
|||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
|
||||
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
|
||||
('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
|
||||
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
|
||||
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
|
||||
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
||||
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.conf.urls import url
|
|||
|
||||
from . import views
|
||||
|
||||
app_name = 'users'
|
||||
urlpatterns = [
|
||||
url(
|
||||
regex=r'^$',
|
||||
|
|
Loading…
Reference in New Issue
Block a user