Merge branch 'master' into docker-compose

This commit is contained in:
Jay 2015-07-21 10:02:52 +02:00
commit bff7487121
12 changed files with 67 additions and 34 deletions

33
CHANGELOG.md Normal file
View File

@ -0,0 +1,33 @@
# Change Log
All enhancements and patches to cookiecutter-django will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [2015-07-21]
## Changed
- memcached is as a cache is replace with redis (#258)(@burhan)
## [2015-07-18]
### Changed
- Heroku deployment docs (@stepmr)
- Heroku's free postgres tier is now "hobby-dev"
- pg:backups require a scheduled time
- add missing Mailgun API key
- Django recommends setting the PYTHONHASHSEED environment variable to random. See: https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/#python-options
- Use openssl to generate a secure, random secret_key
## [2015-07-17]
### Added
- @models.permalink decorator to User.get_absolute_url() method
### Fixed
- Broken user_form.html (@pydanny)
## [2015-07-16]
### Added
- django-test-plus (@pydanny)
- option use maildump instead of ConsoleEmailHandler (@burhan)
- Changelog.md (@pydanny)
### Fixed
- where 'DEFAULT_FROM_EMAIL' was used to cast the value (@jayfk)
### Removed
- unnecessary header block tag and 'user:' prefix. (@pydanny)

View File

@ -45,10 +45,12 @@ Adam Dobrawy / @ad-m
Daniele Tricoli / @eriol
Harry Percival / @hjwp
Cullen Rhodes / @c-rhodes
Burhan Khalid / @burhan
Audrey Roy Greenfeld / @audreyr (and creator/maintainer of cookiecutter) *
Burhan Khalid / @burhan
Jannis Gebauer / @got_nil
jayfk / @jayfk
stepmr / @stepmr
* Possesses commit rights

View File

@ -1,9 +0,0 @@
# Change Log
All enhancements and patches to cookiecutter-django will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [2015-07-16]
### Changed
- Removed unnecessary header block tag and 'user:' prefix. (@pydanny)
- Added option use maildump instead of ConsoleEmailHandler (@burhan)
- Fixed a bug where 'DEFAULT_FROM_EMAIL' was used to cast the value (@jayfk)

View File

@ -16,7 +16,7 @@ For configuration purposes, the following table maps the '{{cookiecutter.project
======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ======================================================================
DJANGO_CACHES CACHES (default) locmem memcached
DJANGO_CACHES CACHES (default) locmem redis
DJANGO_DATABASES DATABASES (default) See code See code
DJANGO_DEBUG DEBUG True False
DJANGO_SECRET_KEY SECRET_KEY CHANGEME!!! raises error
@ -166,14 +166,14 @@ Run these commands to deploy the project to Heroku:
heroku create --buildpack https://github.com/heroku/heroku-buildpack-python
heroku addons:create heroku-postgresql:dev
heroku pg:backups schedule DATABASE_URL
heroku addons:create heroku-postgresql:hobby-dev
heroku pg:backups schedule --at '02:00 America/Los_Angeles' DATABASE_URL
heroku pg:promote DATABASE_URL
heroku addons:create heroku-redis:hobby-dev
heroku addons:create mailgun
heroku addons:create memcachier:dev
heroku config:set DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE
heroku config:set DJANGO_SECRET_KEY=`openssl rand -base64 32`
heroku config:set DJANGO_SETTINGS_MODULE='config.settings.production'
heroku config:set DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE
@ -181,7 +181,10 @@ Run these commands to deploy the project to Heroku:
heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE
heroku config:set DJANGO_MAILGUN_SERVER_NAME=YOUR_MALGUN_SERVER
heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
heroku config:set PYTHONHASHSEED=random
git push heroku master
heroku run python manage.py migrate
heroku run python manage.py check --deploy
@ -198,7 +201,7 @@ added just like in Heroku however you must ensure you have the relevant Dokku pl
cd /var/lib/dokku/plugins
git clone https://github.com/rlaneve/dokku-link.git link
git clone https://github.com/jezdez/dokku-memcached-plugin memcached
git clone https://github.com/luxifer/dokku-redis-plugin redis
git clone https://github.com/jezdez/dokku-postgres-plugin postgres
dokku plugins-install
@ -214,8 +217,8 @@ You can then deploy by running the following commands.
git remote add dokku dokku@yourservername.com:{{cookiecutter.repo_name}}
git push dokku master
ssh -t dokku@yourservername.com dokku memcached:create {{cookiecutter.repo_name}}-memcached
ssh -t dokku@yourservername.com dokku memcached:link {{cookiecutter.repo_name}}-memcached {{cookiecutter.repo_name}}
ssh -t dokku@yourservername.com dokku redis:create {{cookiecutter.repo_name}}-redis
ssh -t dokku@yourservername.com dokku redis:link {{cookiecutter.repo_name}}-redis {{cookiecutter.repo_name}}
ssh -t dokku@yourservername.com dokku postgres:create {{cookiecutter.repo_name}}-postgres
ssh -t dokku@yourservername.com dokku postgres:link {{cookiecutter.repo_name}}-postgres {{cookiecutter.repo_name}}
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE

View File

@ -125,15 +125,17 @@ DATABASES['default'] = env.db("DATABASE_URL")
# CACHING
# ------------------------------------------------------------------------------
try:
# Only do this here because thanks to django-pylibmc-sasl and pylibmc
# memcacheify is painful to install on windows.
# See: https://github.com/rdegges/django-heroku-memcacheify
from memcacheify import memcacheify
CACHES = memcacheify()
except ImportError:
CACHES = {
'default': env.cache_url("DJANGO_CACHE_URL", default="memcache://127.0.0.1:11211"),
# Heroku URL does not pass the DB number, so we parse it in
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "{0}/{1}".format(env.cache_url('REDIS_URL', default="redis://127.0.0.1:6379"), 0),
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"IGNORE_EXCEPTIONS": True, # mimics memcache behavior.
# http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior
}
}
}
# Your production stuff: Below this line define 3rd party library settings

View File

@ -19,9 +19,6 @@ libfreetype6-dev
liblcms1-dev
libwebp-dev
##pylibmc
libmemcached-dev
libssl-dev
##django-extensions
graphviz-dev

View File

@ -1,5 +1,3 @@
# This file is here because many Platforms as a Service look for
# requirements.txt in the root directory of a project.
pylibmc==1.5.0
django-heroku-memcacheify==0.8
-r requirements/production.txt

View File

@ -34,6 +34,10 @@ django-autoslug==1.8.0
# Time zones support
pytz==2015.4
# Redis support
django-redis==4.2.0
redis>=2.10.0
{% if cookiecutter.use_celery == "y" %}
celery==3.1.18
{% endif %}

View File

@ -4,6 +4,7 @@ coverage==3.7.1
Sphinx
django-extensions==1.5.5
Werkzeug==0.10.4
django-test-plus==1.0.6
# django-debug-toolbar that works with Django 1.5+
django-debug-toolbar==1.3.2

View File

@ -2,3 +2,4 @@
-r base.txt
coverage==4.0a6
flake8==2.4.1
django-test-plus==1.0.6

View File

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% raw %}{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block title %}{{ user.username }}{% endblock %}
@ -14,4 +14,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}{% endraw %}

View File

@ -16,5 +16,6 @@ class User(AbstractUser):
def __unicode__(self):
return self.username
@models.permalink
def get_absolute_url(self):
return reverse('users:detail', kwargs={'username': self.username})