mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-18 12:30:57 +03:00
Merge branch 'master' into docker-compose
This commit is contained in:
commit
bff7487121
33
CHANGELOG.md
Normal file
33
CHANGELOG.md
Normal 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)
|
|
@ -45,10 +45,12 @@ Adam Dobrawy / @ad-m
|
||||||
Daniele Tricoli / @eriol
|
Daniele Tricoli / @eriol
|
||||||
Harry Percival / @hjwp
|
Harry Percival / @hjwp
|
||||||
Cullen Rhodes / @c-rhodes
|
Cullen Rhodes / @c-rhodes
|
||||||
|
Burhan Khalid / @burhan
|
||||||
Audrey Roy Greenfeld / @audreyr (and creator/maintainer of cookiecutter) *
|
Audrey Roy Greenfeld / @audreyr (and creator/maintainer of cookiecutter) *
|
||||||
Burhan Khalid / @burhan
|
Burhan Khalid / @burhan
|
||||||
Jannis Gebauer / @got_nil
|
Jannis Gebauer / @got_nil
|
||||||
jayfk / @jayfk
|
jayfk / @jayfk
|
||||||
|
stepmr / @stepmr
|
||||||
|
|
||||||
* Possesses commit rights
|
* Possesses commit rights
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
|
@ -16,7 +16,7 @@ For configuration purposes, the following table maps the '{{cookiecutter.project
|
||||||
======================================= =========================== ============================================== ======================================================================
|
======================================= =========================== ============================================== ======================================================================
|
||||||
Environment Variable Django Setting Development Default Production Default
|
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_DATABASES DATABASES (default) See code See code
|
||||||
DJANGO_DEBUG DEBUG True False
|
DJANGO_DEBUG DEBUG True False
|
||||||
DJANGO_SECRET_KEY SECRET_KEY CHANGEME!!! raises error
|
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 create --buildpack https://github.com/heroku/heroku-buildpack-python
|
||||||
|
|
||||||
heroku addons:create heroku-postgresql:dev
|
heroku addons:create heroku-postgresql:hobby-dev
|
||||||
heroku pg:backups schedule DATABASE_URL
|
heroku pg:backups schedule --at '02:00 America/Los_Angeles' DATABASE_URL
|
||||||
heroku pg:promote DATABASE_URL
|
heroku pg:promote DATABASE_URL
|
||||||
|
|
||||||
|
heroku addons:create heroku-redis:hobby-dev
|
||||||
heroku addons:create mailgun
|
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_SETTINGS_MODULE='config.settings.production'
|
||||||
|
|
||||||
heroku config:set DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE
|
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_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_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
|
git push heroku master
|
||||||
heroku run python manage.py migrate
|
heroku run python manage.py migrate
|
||||||
heroku run python manage.py check --deploy
|
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
|
cd /var/lib/dokku/plugins
|
||||||
git clone https://github.com/rlaneve/dokku-link.git link
|
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
|
git clone https://github.com/jezdez/dokku-postgres-plugin postgres
|
||||||
dokku plugins-install
|
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 remote add dokku dokku@yourservername.com:{{cookiecutter.repo_name}}
|
||||||
git push dokku master
|
git push dokku master
|
||||||
ssh -t dokku@yourservername.com dokku memcached:create {{cookiecutter.repo_name}}-memcached
|
ssh -t dokku@yourservername.com dokku redis:create {{cookiecutter.repo_name}}-redis
|
||||||
ssh -t dokku@yourservername.com dokku memcached:link {{cookiecutter.repo_name}}-memcached {{cookiecutter.repo_name}}
|
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: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 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
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE
|
||||||
|
|
|
@ -125,15 +125,17 @@ DATABASES['default'] = env.db("DATABASE_URL")
|
||||||
|
|
||||||
# CACHING
|
# CACHING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
try:
|
# Heroku URL does not pass the DB number, so we parse it in
|
||||||
# Only do this here because thanks to django-pylibmc-sasl and pylibmc
|
CACHES = {
|
||||||
# memcacheify is painful to install on windows.
|
"default": {
|
||||||
# See: https://github.com/rdegges/django-heroku-memcacheify
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
from memcacheify import memcacheify
|
"LOCATION": "{0}/{1}".format(env.cache_url('REDIS_URL', default="redis://127.0.0.1:6379"), 0),
|
||||||
CACHES = memcacheify()
|
"OPTIONS": {
|
||||||
except ImportError:
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||||
CACHES = {
|
"IGNORE_EXCEPTIONS": True, # mimics memcache behavior.
|
||||||
'default': env.cache_url("DJANGO_CACHE_URL", default="memcache://127.0.0.1:11211"),
|
# http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Your production stuff: Below this line define 3rd party library settings
|
# Your production stuff: Below this line define 3rd party library settings
|
||||||
|
|
|
@ -19,9 +19,6 @@ libfreetype6-dev
|
||||||
liblcms1-dev
|
liblcms1-dev
|
||||||
libwebp-dev
|
libwebp-dev
|
||||||
|
|
||||||
##pylibmc
|
|
||||||
libmemcached-dev
|
|
||||||
libssl-dev
|
|
||||||
|
|
||||||
##django-extensions
|
##django-extensions
|
||||||
graphviz-dev
|
graphviz-dev
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is here because many Platforms as a Service look for
|
# This file is here because many Platforms as a Service look for
|
||||||
# requirements.txt in the root directory of a project.
|
# requirements.txt in the root directory of a project.
|
||||||
pylibmc==1.5.0
|
|
||||||
django-heroku-memcacheify==0.8
|
|
||||||
-r requirements/production.txt
|
-r requirements/production.txt
|
||||||
|
|
|
@ -34,6 +34,10 @@ django-autoslug==1.8.0
|
||||||
# Time zones support
|
# Time zones support
|
||||||
pytz==2015.4
|
pytz==2015.4
|
||||||
|
|
||||||
|
# Redis support
|
||||||
|
django-redis==4.2.0
|
||||||
|
redis>=2.10.0
|
||||||
|
|
||||||
{% if cookiecutter.use_celery == "y" %}
|
{% if cookiecutter.use_celery == "y" %}
|
||||||
celery==3.1.18
|
celery==3.1.18
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -4,6 +4,7 @@ coverage==3.7.1
|
||||||
Sphinx
|
Sphinx
|
||||||
django-extensions==1.5.5
|
django-extensions==1.5.5
|
||||||
Werkzeug==0.10.4
|
Werkzeug==0.10.4
|
||||||
|
django-test-plus==1.0.6
|
||||||
|
|
||||||
# django-debug-toolbar that works with Django 1.5+
|
# django-debug-toolbar that works with Django 1.5+
|
||||||
django-debug-toolbar==1.3.2
|
django-debug-toolbar==1.3.2
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
-r base.txt
|
-r base.txt
|
||||||
coverage==4.0a6
|
coverage==4.0a6
|
||||||
flake8==2.4.1
|
flake8==2.4.1
|
||||||
|
django-test-plus==1.0.6
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base.html" %}
|
{% raw %}{% extends "base.html" %}
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
{% block title %}{{ user.username }}{% endblock %}
|
{% block title %}{{ user.username }}{% endblock %}
|
||||||
|
@ -14,4 +14,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}{% endraw %}
|
||||||
|
|
|
@ -16,5 +16,6 @@ class User(AbstractUser):
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.username
|
return self.username
|
||||||
|
|
||||||
|
@models.permalink
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('users:detail', kwargs={'username': self.username})
|
return reverse('users:detail', kwargs={'username': self.username})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user