Skip to content

Commit

Permalink
Update to Django 1.9.
Browse files Browse the repository at this point in the history
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 RacingTadpole/django-private-media#9)

ALSO, django-private-media is now causing Django 1.10 deprecation
warnings.
  • Loading branch information
katur committed Jan 21, 2016
1 parent f519e96 commit 18c5339
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 31 deletions.
86 changes: 57 additions & 29 deletions forthebirds/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,49 @@
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,
# it is does not add this prefix to the enclosure mp3 url. Since
# 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', '[email protected]'),]


# Application definition
INSTALLED_APPS = (

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand All @@ -54,7 +62,7 @@
'birds',
'creations',
'waystohelp',
)
]

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
Expand All @@ -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 '
'<a href="http://www.darkcoding.net/software/markdown-quick-reference">'
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 18c5339

Please sign in to comment.