Skip to content

Instantly share code, notes, and snippets.

@sdiepend
Created May 3, 2015 15:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdiepend/0c76bb4e66b7ab0732d1 to your computer and use it in GitHub Desktop.
Save sdiepend/0c76bb4e66b7ab0732d1 to your computer and use it in GitHub Desktop.
# LECTURE 19 - 1.8 UPDATED
# Django 1.6 & 1.7
# https://docs.djangoproject.com/en/1.6/ref/templates/api/#the-template-dirs-setting
# https://docs.djangoproject.com/en/1.7/ref/templates/api/#the-template-dirs-setting
#
# TEMPLATE_DIRS = (
# os.path.join(BASE_DIR, 'templates'),
# )
#
# Django 1.8 has a different way of defining template locations.
# Differences: https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/
# https://docs.djangoproject.com/en/1.8/topics/templates/
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ os.path.join(BASE_DIR, 'templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
# LECTURE 22 - 1.8 UPDATED
# fields needs to be included because of security reasons:
# https://docs.djangoproject.com/en/dev/releases/1.6/#modelform-without-fields-or-exclude
# https://docs.djangoproject.com/en/1.8/topics/forms/modelforms/#modelform
class JoinForm(forms.ModelForm):
class Meta:
model = Join
fields = ['email', ]
# LECTURE 23 - 1.8 UPDATED
# https://github.com/codingforentrepreneurs/Guides/blob/master/using_south_in_django.md
# Since Django 1.7 migrations is part of the django core.
# https://docs.djangoproject.com/en/1.8/topics/migrations/
python manage.py makemigrations joins
python manage.py migrate
@arsenico13
Copy link

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment