Changeset - abbe05ee0e6a
[Not reviewed]
0 2 1
Christopher Neugebauer - 7 years ago 2017-09-18 03:28:41
chrisjrn@gmail.com
Fixes a thing or two
3 files changed with 34 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pinaxcon/proposals/migrations/0004_auto_20170917_2028.py
Show inline comments
 
new file 100644
 
# -*- coding: utf-8 -*-
 
# Generated by Django 1.11.4 on 2017-09-18 03:28
 
from __future__ import unicode_literals
 

	
 
from django.db import migrations, models
 

	
 

	
 
class Migration(migrations.Migration):
 

	
 
    dependencies = [
 
        ('proposals', '0003_auto_20170813_1945'),
 
    ]
 

	
 
    operations = [
 
        migrations.AlterField(
 
            model_name='conferencespeaker',
 
            name='first_time',
 
            field=models.BooleanField(default=False, help_text='Check this field if this is your first time speaking at a technical conference.', verbose_name='First-time speaker?'),
 
        ),
 
        migrations.AlterField(
 
            model_name='conferencespeaker',
 
            name='lodging_assistance',
 
            field=models.BooleanField(default=False, help_text='Check this field if you require lodging assistance in Petaluma, California during North Bay Python.', verbose_name='Lodging assistance required?'),
 
        ),
 
        migrations.AlterField(
 
            model_name='conferencespeaker',
 
            name='travel_assistance',
 
            field=models.BooleanField(default=False, help_text='Check this field if you require travel assistance to get to North Bay Python in Petaluma, California.', verbose_name='Travel assistance required?'),
 
        ),
 
    ]
pinaxcon/proposals/models.py
Show inline comments
 
from django.db import models
 
from django.utils.translation import ugettext_lazy as _
 

	
 
from symposion.markdown_parser import parse
 
from symposion.proposals.models import ProposalBase
 
from symposion.speakers.models import SpeakerBase
 

	
 

	
 

	
 
class ConferenceSpeaker(SpeakerBase):
 

	
 
    def clean_twitter_username(self):
 
        value = self.twitter_username
 
        if value.startswith("@"):
 
            value = value[1:]
 
        return value
 

	
 
    def save(self, *args, **kwargs):
 
        self.experience_html = parse(self.experience)
 
        self.twitter_username = self.clean_twitter_username()
 
        return super(ConferenceSpeaker, self).save(*args, **kwargs)
 

	
 
    twitter_username = models.CharField(
 
        max_length=15,
 
        blank=True,
 
        help_text=_(u"Your Twitter account")
 
    )
 

	
 
    first_time = models.BooleanField(
 
        blank=True,
 
        default=False,
 
        verbose_name=_("First-time speaker?"),
 
        help_text=_("Check this field if this is your first time speaking "
 
                    "at a technical conference."),
 
        )
 

	
 
    experience = models.TextField(blank=True, help_text=_
 
        ("List any past speaking experience you have. This can include "
 
         "user groups, meetups, or presentations at work or school.  Edit "
 
         "using <a href='http://warpedvisions.org/projects/"
 
         "markdown-cheat-sheet/target='_blank'>"
 
         "Markdown</a>."),
 
         verbose_name=_("Past speaking experience"),
 
    )
 
    experience_html = models.TextField(blank=True)
 

	
 
    travel_assistance = models.BooleanField(
 
        blank=True,
 
        default=False,
 
        verbose_name=_("Travel assistance required?"),
 
        help_text=_("Check this field if you require travel assistance to get "
 
                    "to North Bay Python in Petaluma, California."),
 
    )
 

	
 
    lodging_assistance = models.BooleanField(
 
        blank=True,
 
        default=False,
 
        verbose_name=_("Lodging assistance required?"),
 
        help_text=_("Check this field if you require lodging assistance in "
 
                    "Petaluma, California during North Bay Python."),
 
    )
 

	
 
    home_city = models.CharField(
 
        blank=True,
 
        max_length=127,
 
        help_text=_("Which city (and state, and country) will you be "
 
                    "traveling from to get to North Bay Python?"),
 
    )
 

	
 
    minority_group = models.CharField(blank=True, max_length=256,
 
        verbose_name=_("Diversity statement"),
 
        help_text=_("If you are a member of one or more groups that are "
 
                    "under-represented in the tech industry, you may list "
 
                    "these here. Your response is optional."),
 
    )
 

	
 
    code_of_conduct = models.BooleanField(
 
        help_text=_("I have read and, in the event that my proposal is "
 
                    "accepted, agree that I will comply with the "
 
                    "<a href='/code-of-conduct'>Code of Conduct</a>."),
 
    )
 

	
 

	
 
class Proposal(ProposalBase):
 

	
 
    extended_presentation = models.BooleanField(
 
        default=False,
 
        verbose_name=_("Optionally consider this proposal for a 45-minute "
 
                       "slot"),
 
        help_text=_("Most talks at North Bay Python go for 30 minutes. We "
 
                    "have some openings for 45-minute talks. If you check this "
 
                    "field, please explain in your additional notes how you "
 
                    "would use the extra 15 minutes."),
 
    )
 
    extra_av = models.TextField(
 
        blank=True,
 
        verbose_name=_("Extra tech and A/V requirements"),
 
        help_text=_("We will provide you with a projector with HDMI "
 
                    "connection, an audio connection, and one microphone per "
 
                    "speaker. If you need anything more than this to present "
 
                    "this talk, please list them here."),
 
    )
 
    new_presentation = models.BooleanField(
 
        default=False,
 
        verbose_name=_("This is a new presentation"),
 
        help_text=_("Check this box if North Bay Python will be the first "
 
                    "time this talk is presented at a technical conference."),
 
    )
 
    slides_release = models.BooleanField(
 
        default=True,
 
        help_text=_("I authorize North Bay Python to release a copy of my "
 
                    "slides and related materials under the Creative Commons "
 
                    "Attribution-ShareAlike 3.0 United States licence, and "
 
                    "certify that I have the authority to do so."),
 
    )
 
    recording_release = models.BooleanField(
 
        default=True,
 
        help_text=_("I authorize North Bay Python to release a recording of "
 
                    "my talk under the Creative Commons "
 
                    "Attribution-ShareAlike 3.0 United States licence."),
 

	
 
    )
 

	
 
    class Meta:
 
        abstract = True
 

	
 

	
 
class TalkProposal(Proposal):
 

	
 
    class Meta:
 
        verbose_name = "talk proposal"
pinaxcon/settings.py
Show inline comments
 
import os
 
import dj_database_url
 

	
 

	
 
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
 
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
 
BASE_DIR = PACKAGE_ROOT
 

	
 
DEBUG = bool(int(os.environ.get("DEBUG", "1")))
 

	
 
DATABASES = {
 
    "default": {
 
        "ENGINE": "django.db.backends.sqlite3",
 
        "NAME": os.path.join(PROJECT_ROOT, "dev.db"),
 
    }
 
}
 

	
 
UNPREPEND_WWW = bool(int(os.environ.get("DJANGO_UNPREPEND_WWW", "0")))
 

	
 
# HEROKU: Update database configuration with $DATABASE_URL.
 
import dj_database_url
 
db_from_env = dj_database_url.config()
 
DATABASES['default'].update(db_from_env)
 

	
 
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org"]
 
CANONICAL_HOST = os.environ.get("DJANGO_CANONICAL_HOST", None)
 

	
 
# If DEFAULT_FROM_EMAIL is not set, email will most likely break in prod.
 
from_email = os.environ.get("DJANGO_DEFAULT_FROM_EMAIL", None)
 
if from_email is not None:
 
    DEFAULT_FROM_EMAIL = from_email
 

	
 
SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
    SERVER_EMAIL = DEFAULT_FROM_EMAIL
 

	
 
# Local time zone for this installation. Choices can be found here:
 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 
# although not all choices may be available on all operating systems.
 
# On Unix systems, a value of None will cause Django to use the same
 
# timezone as the operating system.
 
# If running in a Windows environment this must be set to the same as your
 
# system time zone.
 
TIME_ZONE = os.environ.get("TZ", "America/Los_Angeles")
 

	
 

	
 
# Set the email address that will receive errors.
 
admin_email = os.environ.get("DJANGO_ADMIN_EMAIL", None)
 
if admin_email is not None:
 
    ADMINS = [("Webmaster", admin_email)]
 

	
 

	
 
# Use SSLRedirectMiddleware
 
SSL_ON = os.environ.get("DJANGO_SSL_ON", True)
 
SSL_ALWAYS = os.environ.get("DJANGO_SSL_ALWAYS", False)
 

	
 
# Language code for this installation. All choices can be found here:
 
# http://www.i18nguy.com/unicode/language-identifiers.html
 
LANGUAGE_CODE = "en-us"
 

	
 
SITE_ID = int(os.environ.get("SITE_ID", 1))
 

	
 
# If you set this to False, Django will make some optimizations so as not
 
# to load the internationalization machinery.
 
USE_I18N = True
 

	
 
# If you set this to False, Django will not format dates, numbers and
 
# calendars according to the current locale.
 
USE_L10N = True
 

	
 
# If you set this to False, Django will not use timezone-aware datetimes.
 
USE_TZ = True
 

	
 
# Absolute filesystem path to the directory that will hold user-uploaded files.
 
# Example: "/home/media/media.lawrence.com/media/"
 
MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media")
 

	
 
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
 
# trailing slash.
 
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
 
MEDIA_URL = "/site_media/media/"
 

	
 
# Absolute path to the directory static files should be collected to.
 
# Don"t put anything in this directory yourself; store your static files
 
# in apps" "static/" subdirectories and in STATICFILES_DIRS.
 
# Example: "/home/media/media.lawrence.com/static/"
 
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
 

	
 
# URL prefix for static files.
 
# Example: "http://media.lawrence.com/static/"
 
STATIC_URL = '/static/'
 

	
 
# Additional locations of static files
 
STATICFILES_DIRS = (
 
    os.path.join(PROJECT_ROOT, 'static'),
 
)
 

	
 
# List of finder classes that know how to find static files in
 
# various locations.
 
STATICFILES_FINDERS = [
 
    "django.contrib.staticfiles.finders.FileSystemFinder",
 
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
 
    "compressor.finders.CompressorFinder",
 
]
 

	
 

	
 
# Amazon S3 setup
 
DEFAULT_FILE_STORAGE = os.environ.get("DJANGO_DEFAULT_FILE_STORAGE", 'django.core.files.storage.FileSystemStorage') # noqa
 
AWS_ACCESS_KEY_ID = os.environ.get("DJANGO_AWS_ACCESS_KEY_ID", None)
 
AWS_SECRET_ACCESS_KEY = os.environ.get("DJANGO_AWS_SECRET_ACCESS_KEY", None)
 
AWS_STORAGE_BUCKET_NAME = os.environ.get("DJANGO_AWS_STORAGE_BUCKET_NAME", None)
 

	
 

	
 
# Make this unique, and don't share it with anybody.
 
SECRET_KEY = "6r&z0i#!k-thu4nv^zzx!f$fbp(&#2i5mq_^%%@ihu_qxxotl_"
 

	
 
TEMPLATES = [
 
    {
 
        "BACKEND": "django.template.backends.django.DjangoTemplates",
 
        "DIRS": [
 
            os.path.join(PACKAGE_ROOT, "templates"),
 
        ],
 
        "APP_DIRS": True,
 
        "OPTIONS": {
 
            "debug": DEBUG,
 
            "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",
0 comments (0 inline, 0 general)