From 18c5339910096726ebac0845bee5de995ab28c36 Mon Sep 17 00:00:00 2001 From: Katherine Erickson Date: Thu, 21 Jan 2016 18:27:45 -0500 Subject: [PATCH] Update to Django 1.9. Note that django-private-media==0.1.3 available on PyPi is not compatible with Django 1.9. However, the same-version-numbered master on github IS Django 1.9 compatible. The workaround: pip uninstall django-private-media pip install git+https://github.com/RacingTadpole/django-private-media.git (see https://github.com/RacingTadpole/django-private-media/issues/9) ALSO, django-private-media is now causing Django 1.10 deprecation warnings. --- forthebirds/settings.py | 86 +++++++++++++++++++++++++++-------------- requirements.txt | 4 +- 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/forthebirds/settings.py b/forthebirds/settings.py index c76856b..7845c0f 100644 --- a/forthebirds/settings.py +++ b/forthebirds/settings.py @@ -2,17 +2,20 @@ Django settings for forthebirds project. For more information on this file, see -https://docs.djangoproject.com/en/1.6/topics/settings/ +https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.6/ref/settings/ +https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) + import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +# Local configuration + # Note: I hard-coded the site domain in local_settings in order to # use it in the podcast feed. For some reason, while Django does prefix # the feed-wide url and feed item page urls with the domain name, @@ -20,23 +23,28 @@ # iTunes requires the domain name in the enclosure url, I need to add # it myself. And since the request object is not accessible when # extending a Feed object, I have it in this settings file. -# # I opted not to use the Sites framework for this since it does not # seem to be the intention of the Sites framework. -# -from local_settings import (DEBUG, SECRET_KEY, DATABASES, - SITE_DOMAIN, OLD_SITE_DOMAIN, - ITUNES_SUBSCRIBE_LINK, PERMANENT_REDIRECTS, - STATIC_ROOT, MEDIA_ROOT, - PRIVATE_MEDIA_ROOT, PRIVATE_MEDIA_SERVER) -TEMPLATE_DEBUG = DEBUG +from local_settings import ( + DEBUG, SECRET_KEY, DATABASES, SITE_DOMAIN, OLD_SITE_DOMAIN, + ITUNES_SUBSCRIBE_LINK, PERMANENT_REDIRECTS, + STATIC_ROOT, MEDIA_ROOT, PRIVATE_MEDIA_ROOT, PRIVATE_MEDIA_SERVER) + + +# Security ALLOWED_HOSTS = ['*'] +# Administration + +ADMINS = [('Katherine Erickson', 'katherine.erickson@gmail.com'),] + + # Application definition -INSTALLED_APPS = ( + +INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -54,7 +62,7 @@ 'birds', 'creations', 'waystohelp', -) +] MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', @@ -71,43 +79,63 @@ # Internationalization +# https://docs.djangoproject.com/en/dev/topics/i18n/ + LANGUAGE_CODE = 'en-us' TIME_ZONE = 'America/New_York' USE_I18N = True -USE_L10N = True +USE_L10N = False USE_TZ = True -# Static files (CSS, JavaScript, Images) +# Static and Media files +# https://docs.djangoproject.com/en/dev/howto/static-files/ + STATIC_URL = '/static/' -# Media files (User-uploaded files) MEDIA_URL = '/media/' -# Private media files PRIVATE_MEDIA_URL = '/private-media/' -# For request object in templates -from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP -TEMPLATE_CONTEXT_PROCESSORS = TCP + ( - 'django.core.context_processors.request', - 'django.contrib.messages.context_processors.messages', -) -# Needed so overridden admin templates take precedence -TEMPLATE_DIRS = ( - BASE_DIR + '/website/templates/', -) +# Templates + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + + # Needed so overrideen admin templates take precedence + 'DIRS': [BASE_DIR + '/website/templates/'], + + 'OPTIONS': { + # Needed to provide request object in templates + 'context_processors': [ + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.request', + ], + }, + }, +] + + +# Login -# Authentication LOGIN_URL = 'login_url' -LOGIN_REDIRECT_URL = 'home_url' -# Constants + +# Miscellany + MARKDOWN_PROMPT = ( 'Use Markdown syntax for italics, bullets, etc. See ' '' diff --git a/requirements.txt b/requirements.txt index a02330e..caa1174 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ dj-database-url==0.3.0 dj-static==0.0.6 -Django==1.8.4 +Django==1.9.1 django-jquery==1.9.1 django-markdown-deux==1.0.4 django-private-media==0.1.3 -django-taggit==0.16.4 +django-taggit==0.18.0 markdown2==2.2.2 mutagen==1.31 MySQL-python==1.2.5