Changeset - c929e2fddd46
[Not reviewed]
Merge
0 7 1
Joshua Simmons - 7 years ago 2017-08-16 05:16:16
i@joshuasimmons.name
Merge branch 'master' of github.com:northbaypython/website
5 files changed with 51 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pinaxcon/middleware.py
Show inline comments
 
new file 100644
 
import re
 
import warnings
 

	
 
from django import http
 
from django.conf import settings
 
from django.utils.deprecation import MiddlewareMixin
 

	
 
class UnprependWWWMiddleware(MiddlewareMixin):
 
    """ Unprepends www if necessary. """
 

	
 
    response_redirect_class = http.HttpResponsePermanentRedirect
 

	
 
    def process_request(self, request):
 
        """
 
        Rewrite the URL based on settings.UNPREPEND_WWW
 
        """
 

	
 
        unprepend_www = getattr(settings, "UNPREPEND_WWW", False)
 

	
 
        if not unprepend_www:
 
            return
 

	
 
        # Check for a redirect based on settings.UNPREPEND_WWW
 
        host = request.get_host()
 
        must_unprepend = unprepend_www and host and host.lower().startswith('www.')
 
        wwwless_host = host[4:]
 
        redirect_url = ('%s://%s' % (request.scheme, wwwless_host)) if must_unprepend else ''
 

	
 
        path = request.get_full_path()
 

	
 
        # Return a redirect if necessary
 
        if redirect_url or path != request.get_full_path():
 
            redirect_url += path
 
            return self.response_redirect_class(redirect_url)
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(os.environ.get("DJANGO_UNPREPEND_WWW", False))
 

	
 
# 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"]
 
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org"]
 

	
 
# 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")
 

	
 

	
 
# 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
...
 
@@ -111,48 +113,49 @@ TEMPLATES = [
 
                "django.template.context_processors.i18n",
 
                "django.template.context_processors.media",
 
                "django.template.context_processors.static",
 
                "django.template.context_processors.tz",
 
                "django.template.context_processors.request",
 
                "django.contrib.messages.context_processors.messages",
 
                "account.context_processors.account",
 
                "pinax_theme_bootstrap.context_processors.theme",
 
                "symposion.reviews.context_processors.reviews",
 
            ],
 
        },
 
    },
 
]
 

	
 
MIDDLEWARE_CLASSES = [
 
    "django.contrib.sessions.middleware.SessionMiddleware",
 
    "django.middleware.common.CommonMiddleware",
 
    "django.middleware.csrf.CsrfViewMiddleware",
 
    "django.contrib.auth.middleware.AuthenticationMiddleware",
 
    "django.contrib.auth.middleware.SessionAuthenticationMiddleware",
 
    "django.contrib.messages.middleware.MessageMiddleware",
 
    "reversion.middleware.RevisionMiddleware",
 
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
 
    "ssl_redirect.middleware.SSLRedirectMiddleware",
 
    "pinaxcon.middleware.UnprependWWWMiddleware",
 

	
 
]
 

	
 
ROOT_URLCONF = "pinaxcon.urls"
 

	
 
# Python dotted path to the WSGI application used by Django's runserver.
 
WSGI_APPLICATION = "pinaxcon.wsgi.application"
 

	
 
INSTALLED_APPS = [
 
    "django.contrib.admin",
 
    "django.contrib.auth",
 
    "django.contrib.contenttypes",
 
    "django.contrib.messages",
 
    "django.contrib.sessions",
 
    "django.contrib.sites",
 
    "django.contrib.staticfiles",
 

	
 
    # theme
 
    "bootstrapform",
 
    "pinax_theme_bootstrap",
 

	
 
    # external
 
    "account",
 
    "easy_thumbnails",
pinaxcon/templates/static_pages/homepage.html
Show inline comments
...
 
@@ -93,49 +93,49 @@
 
            <a class="btn btn-lg btn-primary btn-shadow" href="/about/north-bay-python" title="About North Bay Python">Learn More</a>
 
          </div>
 

	
 
          <div class="col-md-8 text-right photo-attribution">
 
            Image credit: <a href="https://www.instagram.com/p/BU-G5dGAkHt" title="Photo of the Mystic Theatre">Mystic Theatre</a>, &copy; 2017 Christopher Neugebauer (<a href="https://creativecommons.org/licenses/by-sa/2.0/" title="Creative Commons Attribute Share Alike 2.0 Generic License">CC BY-SA 2.0</a>)
 
          </div>
 
        </div>
 
      </div>
 
    </div>
 
  </div>
 

	
 
  <div class="jumbotron homepage-block white">
 
    <div class="container homepage-block-content">
 
      <h1>Sponsors</h1>
 

	
 
      {% load sponsorship_tags %}
 
      {% load thumbnail %}
 

	
 
      {% sponsor_levels as levels %}
 

	
 
      <div class="row sponsor-list">
 
      {% for level in levels %}
 
          {% if level.sponsors %}
 
              {% for sponsor in level.sponsors %}
 
                  <div class="col-md-3">
 
                  <div class="sponsor">
 
                      {% if sponsor.website_logo %}
 
                          <a href="{{ sponsor.external_url }}" title="{{ sponsor.name }}">
 
                              <img src="{% thumbnail sponsor.website_logo '600x360' %}" alt="{{ sponsor.name }}">
 
                          </a>
 
                      {% else %}
 
                          <a href="{{ sponsor.external_url }}" title="{{ sponsor.name }}">{{ sponsor.name }}</a>
 
                      {% endif %}
 
                  </div>
 
              {% endfor %}
 
          {% endif %}
 
      {% endfor %}
 
      </div>
 
    </div>
 

	
 
    <div class="container homepage-block-footer">
 
      <div class="btn-group">
 
        <a class="btn btn-lg btn-primary btn-shadow" href="/sponsors/become-a-sponsor" title="Become a Sponsor">Become a Sponsor</a>
 
      </div>
 
    </div>
 
  </div>
 

	
 
  <div class="jumbotron homepage-block dark">
 
    <div class="homepage-block-bg djangogirls-background"></div>
 
    <div class="container homepage-block-content">
pinaxcon/urls.py
Show inline comments
 
from django.conf import settings
 
from django.conf.urls import include, url
 
from django.conf.urls.static import static
 
from django.contrib.staticfiles.templatetags.staticfiles import static as _static
 
from django.views.generic import TemplateView
 
from django.views.generic import RedirectView
 

	
 

	
 
from django.contrib import admin
 

	
 
import symposion.views
 

	
 

	
 
urlpatterns = [
 
    url(r"^$", TemplateView.as_view(template_name="static_pages/homepage.html"), name="home"),
 

	
 
    # about
 
    url(r"^about/north-bay-python$", TemplateView.as_view(template_name="static_pages/about/north_bay_python.html"), name="about/north-bay-python"),
 
    # TODO add /about/the-mystic
 
    # TODO add /about/petaluma
 
    url(r"^about/team$", TemplateView.as_view(template_name="static_pages/about/team.html"), name="about/team"),
 
    url(r"^about/colophon$", TemplateView.as_view(template_name="static_pages/about/colophon.html"), name="about/colophon"),
 

	
 
    # program
 
    # TODO add /program/sessions
 
    # TODO add /program/events
 
    url(r"^program/call-for-proposals$", TemplateView.as_view(template_name="static_pages/program/call_for_proposals.html"), name="program/call-for-proposals"),
 
    url(r"^program/selection-process$", TemplateView.as_view(template_name="static_pages/program/selection_process.html"), name="program/selection-process"),
 

	
 
    # attend
 
    # TODO add /attend/buy-a-ticket
 
    # TODO add /attend/volunteer
 
    # TODO add /attend/financial-assistance
 
    # TODO add /attend/how-to-pitch-your-manager
 
    # TODO add /attend/how-to-get-here
 
    # TODO add /attend/where-to-stay
 
    url(r"^code-of-conduct$", TemplateView.as_view(template_name="static_pages/code_of_conduct/code_of_conduct.html"), name="code-of-conduct"),
 
    url(r"^code-of-conduct/harassment-incidents$", TemplateView.as_view(template_name="static_pages/code_of_conduct/harassment_procedure_attendee.html"), name="code-of-conduct/harassment-incidents"),
 
    url(r"^code-of-conduct/harassment-staff-procedures$", TemplateView.as_view(template_name="static_pages/code_of_conduct/harassment_procedure_staff.html"), name="code-of-conduct/harassment-staff-procedures"),
 
    url(r"^terms-and-conditions$", TemplateView.as_view(template_name="static_pages/terms_and_conditions.html"), name="terms-and-conditions"),
 

	
 
    # sponsor
 
    url(r"^sponsors/prospectus$", RedirectView.as_view(url="/static/assets/northbaypython_prospectus.pdf"), name="sponsors/prospectus"),
 
    url(r"^northbaypython_prospectus.pdf$", RedirectView.as_view(url="/static/assets/northbaypython_prospectus.pdf"), name="northbaypython_prospectus.pdf"),
 
    url(r"^sponsors/prospectus$", RedirectView.as_view(url=_static("assets/northbaypython_prospectus.pdf")), name="sponsors/prospectus"),
 
    url(r"^northbaypython_prospectus.pdf$", RedirectView.as_view(url=_static("assets/northbaypython_prospectus.pdf")), name="northbaypython_prospectus.pdf"),
 
    url(r"^sponsors/become-a-sponsor$", TemplateView.as_view(template_name="static_pages/sponsors/become_a_sponsor.html"), name="sponsors/become-a-sponsor"),
 

	
 
    # news
 
    url(r"^news$", TemplateView.as_view(template_name="static_pages/news.html"), name="news"),
 

	
 
    # Django, Symposion, and Registrasion URLs
 

	
 
    url(r"^admin/", include(admin.site.urls)),
 

	
 
    url(r"^account/", include("account.urls")),
 

	
 
    url(r"^dashboard/", symposion.views.dashboard, name="dashboard"),
 

	
 
    url(r"^speaker/", include("symposion.speakers.urls")),
 
    url(r"^proposals/", include("symposion.proposals.urls")),
 
    url(r"^sponsors/", include("symposion.sponsorship.urls")),
 
    url(r"^reviews/", include("symposion.reviews.urls")),
 
    url(r"^schedule/", include("symposion.schedule.urls")),
 

	
 
    url(r"^teams/", include("symposion.teams.urls")),
 

	
 
    # Demo payment gateway and related features
 
    url(r"^register/pinaxcon/", include("pinaxcon.registrasion.urls")),
 

	
static/scss/custom.scss
Show inline comments
...
 
@@ -91,50 +91,58 @@ body.auth .panel-heading .panel-title span.pull-right {
 
.home {
 
  margin: 0;
 
  padding-top: $navbar-height - $navbar-padding-vertical - 8;
 
}
 

	
 
.home#content_body {
 
  margin: 0;
 
  padding: 0;
 
}
 

	
 
#content_body {
 
  background-color: $background-filter-transparent;
 
  box-shadow: 0px 0px 2em $background-filter; //, inset 0px -5px 1em rgba(0, 0, 0, 0.8);
 
}
 

	
 
$homepage-block-min-height: 480px;
 

	
 
.homepage-block {
 
  margin-top: 0;
 
  margin-bottom: 0;
 
  min-height: $homepage-block-min-height;
 
  position: relative;
 
  box-shadow: $box-shadow;
 
  z-index: 3;
 

	
 
  .sponsor {
 
    @include make-xs-column(6);
 
    @include make-sm-column(4);
 
    @include make-md-column(3);
 
    max-width: 600px;
 
  }
 
}
 

	
 

	
 
.homepage-block-content {
 
  min-height: ($homepage-block-min-height - 80px);
 
}
 

	
 
/* ??? */
 
.homepage-block-footer {
 

	
 
}
 

	
 
.homepage-block.light {
 
  background-color: $background-filter;
 
  z-index: 2;
 
}
 

	
 
.homepage-block.white {
 
  background-color: white;
 
  z-index: 1;
 
}
 

	
 
.homepage-block-bg {
 
  top: 0;
 
  bottom: 0;
 
  width: 100%;
 
  height: 100%;
0 comments (0 inline, 0 general)