diff --git a/pinaxcon/middleware.py b/pinaxcon/middleware.py index f0a60b0..b70e96a 100644 --- a/pinaxcon/middleware.py +++ b/pinaxcon/middleware.py @@ -5,6 +5,29 @@ from django import http from django.conf import settings from django.utils.deprecation import MiddlewareMixin +class CanonicalHostMiddleware(MiddlewareMixin): + """ Redirects to a canonical host if the current host is not the canonical + host. """ + + response_redirect_class = http.HttpResponsePermanentRedirect + + def process_request(self, request): + + canonical_host = getattr(settings, "CANONICAL_HOST", None) + + if not canonical_host: + return + + host = request.get_host() + + if host == canonical_host: + return + + path = request.get_full_path() + redirect_url = ('%s://%s%s' % (request.scheme, canonical_host, path)) + return self.response_redirect_class(redirect_url) + + class UnprependWWWMiddleware(MiddlewareMixin): """ Unprepends www if necessary. """ diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index d568f71..2d744d5 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -23,6 +23,12 @@ 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 # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -34,6 +40,12 @@ ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org"] 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) @@ -134,8 +146,8 @@ MIDDLEWARE_CLASSES = [ "reversion.middleware.RevisionMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "ssl_redirect.middleware.SSLRedirectMiddleware", + "pinaxcon.middleware.CanonicalHostMiddleware", "pinaxcon.middleware.UnprependWWWMiddleware", - ] ROOT_URLCONF = "pinaxcon.urls" diff --git a/pinaxcon/templates/_default_sidebar.html b/pinaxcon/templates/_default_sidebar.html index d1d0897..f83429a 100644 --- a/pinaxcon/templates/_default_sidebar.html +++ b/pinaxcon/templates/_default_sidebar.html @@ -15,11 +15,11 @@ {% for sponsor in level.sponsors %}
diff --git a/pinaxcon/templates/_footer.html b/pinaxcon/templates/_footer.html index a05b171..093cfdf 100644 --- a/pinaxcon/templates/_footer.html +++ b/pinaxcon/templates/_footer.html @@ -8,14 +8,14 @@ diff --git a/pinaxcon/templates/override_bootstrap_theme_base.html b/pinaxcon/templates/override_bootstrap_theme_base.html new file mode 100644 index 0000000..0a4f597 --- /dev/null +++ b/pinaxcon/templates/override_bootstrap_theme_base.html @@ -0,0 +1,60 @@ +{% extends "theme_bootstrap/base.html" %} +{% comment %} + Derived from pinax_theme_bootstrap's "theme_bootstrap/base.html". + + Pinax Bootstrap Theme + Copyright (c) 2015 James Tauber and contributors. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +{% endcomment %} + + +{% block topbar_base %} +Portions of our Call for Proposals page were drawn from ideas seen on DjangoCon EU, SeaGL, Fog City Ruby, and others. Thanks to all for their inspiration and permission to borrow!
+Portions of our Call for Proposals page were drawn from ideas seen on DjangoCon EU, SeaGL, Fog City Ruby, and others. Thanks to all for their inspiration and permission to borrow!
Our Code of Conduct was forked from the PyCon US Code of Conduct, including the staff and attendee guides, under a Creative Commons Attribution 3.0 Unported license, itself originally forked from the example policy from the Geek Feminism wiki, created by the Ada Initiative and other volunteers, which is under a Creative Commons Zero license.
+Our Code of Conduct was forked from the PyCon US Code of Conduct, including the staff and attendee guides, under a Creative Commons Attribution 3.0 Unported license, itself originally forked from the example policy from the Geek Feminism wiki, created by the Ada Initiative and other volunteers, which is under a Creative Commons Zero license.
Our fiscal sponsor is Software Freedom Conservancy, a 501(c)(3) charity dedicated to the promotion and development of free and open source software. Conservancy allows us to work without managing our own corporate structure and administrative services. Our relationship with Conservancy goes beyond logistics, though, as we are also philosophically aligned as we work to advance software freedom and expand the Python developer community.
+Our fiscal sponsor is Software Freedom Conservancy, a 501(c)(3) charity dedicated to the promotion and development of free and open source software. Conservancy allows us to work without managing our own corporate structure and administrative services. Our relationship with Conservancy goes beyond logistics, though, as we are also philosophically aligned as we work to advance software freedom and expand the Python developer community.
"Python" and the Python logos are trademarks or registered trademarks of the Python Software Foundation, used by North Bay Python with permission from the Foundation.
+"Python" and the Python logos are trademarks or registered trademarks of the Python Software Foundation, used by North Bay Python with permission from the Foundation.
- Our Photography and Audio Video Recording policy is adapted from the Evergreen policy, itself adapted from the AdaCamp policy under a Creative Commons Attribution Share Alike 4.0 International license.
+ Our Photography and Audio Video Recording policy is adapted from the Evergreen policy, itself adapted from the AdaCamp policy under a Creative Commons Attribution Share Alike 4.0 International license.Our website is powered by a heap of free and open source software, most notably:
Need to contact someone in a hurry? You can reach us all at spam@northbaypython.org. Read on to learn about the organizing team.
+Need to contact someone in a hurry? You can reach us all at spam@northbaypython.org. Read on to learn about the organizing team.
You can also find us all over the internet, including:
Christopher is a Python developer who lives in glorious Petaluma, California, though he's originally from the the city of Hobart in Tasmania, Australia. A serial conference organizer, he has been a core organiser of PyCon Australia for a number of years, was director of linux.conf.au 2017, and a good number of his open source contributions help power the website this conference runs on. He was made a fellow of the Python Software Foundation in 2013 in recognition for his contributions to building the Australian Python community. (@chrisjrn on Twitter)
+Christopher is a Python developer who lives in glorious Petaluma, California, though he's originally from the the city of Hobart in Tasmania, Australia. A serial conference organizer, he has been a core organiser of PyCon Australia for a number of years, was director of linux.conf.au 2017, and a good number of his open source contributions help power the website this conference runs on. He was made a fellow of the Python Software Foundation in 2013 in recognition for his contributions to building the Australian Python community. (@chrisjrn on Twitter)
-Sam is a Python developer and distributed-systems "enthusiast" hailing from Seattle by birth, New York by nurture, and the Bay Area by choice. Five years ago he attended his first PyCon US and hasn't been able to break the habit; after making the jump from audience to stage in 2014 and speaking regularly at events around the world, he was thrilled to join team when invited by Chris and Josh. Sam currently works at Nuna building healthcare data infrastructure for the U.S. Medicaid and Medicare programs and resides in Oakland with his husband Kameron. (@skimbrel on Twitter)
+Sam is a Python developer and distributed-systems "enthusiast" hailing from Seattle by birth, New York by nurture, and the Bay Area by choice. Five years ago he attended his first PyCon US and hasn't been able to break the habit; after making the jump from audience to stage in 2014 and speaking regularly at events around the world, he was thrilled to join team when invited by Chris and Josh. Sam currently works at Nuna building healthcare data infrastructure for the U.S. Medicaid and Medicare programs and resides in Oakland with his husband Kameron. (@skimbrel on Twitter)
-Andrew is a Django and Python developer who originally hails from London but moved to the Bay Area four years ago. He's been writing open source software for over a decade as well as working in various different parts of the technology industry, and currently works at Eventbrite. He regularly speaks at Python (and other) events around the world, and has a keen interest in building communities and inclusivity. (@andrewgodwin on Twitter)
+Andrew is a Django and Python developer who originally hails from London but moved to the Bay Area four years ago. He's been writing open source software for over a decade as well as working in various different parts of the technology industry, and currently works at Eventbrite. He regularly speaks at Python (and other) events around the world, and has a keen interest in building communities and inclusivity. (@andrewgodwin on Twitter)
-Josh is a community organizer and web developer with a penchant for armchair philosophy who was born and raised in the North Bay. He spent 4.5 years building Web & Interactive Media Professionals (WIMP), a local community with over 600 members, before moving on to do community management for O'Reilly Media. These days Josh works on the Google Open Source outreach team and serves as a board member and volunteer CFO for Open Source Initiative. (@joshsimmons on Twitter)
+Josh is a community organizer and web developer with a penchant for armchair philosophy who was born and raised in the North Bay. He spent 4.5 years building Web & Interactive Media Professionals (WIMP), a local community with over 600 members, before moving on to do community management for O'Reilly Media. These days Josh works on the Google Open Source outreach team and serves as a board member and volunteer CFO for Open Source Initiative. (@joshsimmons on Twitter)
We acknowledge that our small team has limited perspective, and that to build a truly inclusive event, we need to seek the perspectives of a diverse range of people. We thank the following people and organizations for providing us with advice along the way.
Conservancy is a public charity dedicated to the promotion and development of free and open source software, and is the fiscal sponsor of North Bay Python. Without Conservancy and the people behind it—namely Karen Sandler, Bradley Kuhn, Tony Sebro, and Brett Smith—none of this would be possible!
+Conservancy is a public charity dedicated to the promotion and development of free and open source software, and is the fiscal sponsor of North Bay Python. Without Conservancy and the people behind it—namely Karen Sandler, Bradley Kuhn, Tony Sebro, and Brett Smith—none of this would be possible!
{% endblock %} diff --git a/pinaxcon/templates/static_pages/code_of_conduct/code_of_conduct.md b/pinaxcon/templates/static_pages/code_of_conduct/code_of_conduct.md index e9c3368..eef8854 100644 --- a/pinaxcon/templates/static_pages/code_of_conduct/code_of_conduct.md +++ b/pinaxcon/templates/static_pages/code_of_conduct/code_of_conduct.md @@ -33,7 +33,7 @@ If a participant engages in behavior that violates this code of conduct, the con Contact Information ------------------- -If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of conference staff. Conference staff will be wearing t-shirts and/or badges that clearly identify them as staff. You may also contact venue staff and ask to be put in touch with conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org "chrisjrn@northbaypython.org"). +If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of conference staff. Conference staff will be wearing t-shirts and/or badges that clearly identify them as staff. You may also contact venue staff and ask to be put in touch with conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org). If the matter is especially urgent, please call our Code of Conduct and safety incident hotline. **The phone number for this hotline will be released shortly before the conference begins.** This number will automatically route to a member of the conference staff who can render assistance. @@ -41,10 +41,10 @@ Conference staff will be happy to help participants contact hotel/venue security Procedure for Handling Harassment ------------------------------------------ -- [Attendee procedure for incident handling](/code-of-conduct/harassment-incidents "North Bay Python attendee procedure for incident handling") -- [Staff procedure for incident handling](/code-of-conduct/harassment-staff-procedures "North Bay Python staff procedure for incident handling") +- [Attendee procedure for incident handling](/code-of-conduct/harassment-incidents) +- [Staff procedure for incident handling](/code-of-conduct/harassment-staff-procedures) License ------- -This Code of Conduct was forked from the [PyCon US Code of Conduct](https://github.com/python/pycon-code-of-conduct "PyCon United States Code of Conduct") under a [Creative Commons Attribution 3.0 Unported](http://creativecommons.org/licenses/by/3.0/ "Creative Commons Attribution 3.0 Unported License") license, itself originally forked from the example policy in [Geek Feminism wiki](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy "Geek Feminism Wiki Example Anti-harassment Policy"), created by the Ada Initiative and other volunteers. which is under a [Creative Commons Zero](https://creativecommons.org/publicdomain/zero/1.0/ "Creative Commons Zero License") license. \ No newline at end of file +This Code of Conduct was forked from the [PyCon US Code of Conduct](https://github.com/python/pycon-code-of-conduct) under a [Creative Commons Attribution 3.0 Unported](http://creativecommons.org/licenses/by/3.0/) license, itself originally forked from the example policy in [Geek Feminism wiki](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy), created by the Ada Initiative and other volunteers. which is under a [Creative Commons Zero](https://creativecommons.org/publicdomain/zero/1.0/) license. diff --git a/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_attendee.md b/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_attendee.md index e6066e1..bfaea0d 100644 --- a/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_attendee.md +++ b/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_attendee.md @@ -1,6 +1,6 @@ -*This procedure has been adopted from the Ada Initiative's guide titled "[Conference anti-harassment/Responding to Reports](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Responding_to_reports "Ada Initive Anti-harassment Guide on Responding to Reports")".* +*This procedure has been adopted from the Ada Initiative's guide titled "[Conference anti-harassment/Responding to Reports](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Responding_to_reports)".* -1\. Keep in mind that all conference staff will be wearing a conference t-shirt/button with the word "STAFF" on it (or otherwise clearly marked as staff). The staff will also be prepared to handle the incident. All of our staff are informed of the [code of conduct policy](/code-of-conduct "North Bay Python Code of Conduct") and guide for handling harassment at the conference. *There will be a mandatory staff meeting onsite at the conference when this will be reiterated.* +1\. Keep in mind that all conference staff will be wearing a conference t-shirt/button with the word "STAFF" on it (or otherwise clearly marked as staff). The staff will also be prepared to handle the incident. All of our staff are informed of the [code of conduct policy](/code-of-conduct) and guide for handling harassment at the conference. *There will be a mandatory staff meeting onsite at the conference when this will be reiterated.* 2\. Report the harassment incident (preferably in writing) to a conference staff member. All reports are confidential. Please do not disclose public information about the incident until the staff have had sufficient time in which to address the situation. This is as much for your safety and protection as it is the other attendees. @@ -20,4 +20,4 @@ The staff is well informed on how to deal with the incident and how to further p **Note**: Incidents that violate the Code of Conduct are extremely damaging to the community, and they will not be tolerated. The silver lining is that, in many cases, these incidents present a chance for the offenders, and the community at large, to grow, learn, and become better. North Bay Python staff requests that they be your first resource when reporting a North Bay Python-related incident, so that they may enforce the Code of Conduct and take quick action toward a resolution. -A listing of [North Bay Python staff is located here](/about/team "About the North Bay Python team"), including contact phone numbers. If at all possible, all reports should be made directly to conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org "chrisjrn@northbaypython.org"). \ No newline at end of file +A listing of [North Bay Python staff is located here](/about/team), including contact phone numbers. If at all possible, all reports should be made directly to conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org). \ No newline at end of file diff --git a/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_staff.md b/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_staff.md index 355caf9..f979dc2 100644 --- a/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_staff.md +++ b/pinaxcon/templates/static_pages/code_of_conduct/harassment_procedure_staff.md @@ -1,8 +1,8 @@ -*This procedure has been adopted from the Ada Initiative's guide titled "[Conference anti-harassment/Responding to Reports](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Responding_to_reports "Ada Initive Anti-harassment Guide on Responding to Reports")".* +*This procedure has been adopted from the Ada Initiative's guide titled "[Conference anti-harassment/Responding to Reports](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Responding_to_reports)".* -Be sure to have a good understanding of our Code of Conduct policy, which can be found here: [https://northbaypython.org/code-of-conduct](/code-of-conduct "North Bay Python Code of Conduct") +Be sure to have a good understanding of our Code of Conduct policy, which can be found here: [https://northbaypython.org/code-of-conduct](/code-of-conduct) -Also have a good understanding of what is expected from an attendee that wants to report a harassment incident. These guidelines can be found here: [https://northbaypython.org/code-of-conduct/harassment-incidents](/code-of-conduct/harassment-incidents "North Bay Python attendee procedure for incident handling") +Also have a good understanding of what is expected from an attendee that wants to report a harassment incident. These guidelines can be found here: [https://northbaypython.org/code-of-conduct/harassment-incidents](/code-of-conduct/harassment-incidents) Try to get as much of the incident in written form by the reporter. If you cannot, transcribe it yourself as it was told to you. The important information to gather include the following: @@ -61,4 +61,4 @@ Depending on the incident, the conference chair, or designate, may decide to mak If some attendees were angered by the incident, it is best to apologize to them that the incident occurred to begin with. If there are residual hard feelings, suggest to them to write an email to the conference chair or to the event coordinator. It will be dealt with accordingly. -A listing of [North Bay Python staff is located here](/about/team "About the North Bay Python team"), including contact phone numbers. If at all possible, all reports should be made directly to conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org "chrisjrn@northbaypython.org"). \ No newline at end of file +A listing of [North Bay Python staff is located here](/about/team), including contact phone numbers. If at all possible, all reports should be made directly to conference chair [Christopher Neugebauer](mailto:chrisjrn@northbaypython.org). \ No newline at end of file diff --git a/pinaxcon/templates/static_pages/homepage.html b/pinaxcon/templates/static_pages/homepage.html index 9ce70b8..6fee136 100644 --- a/pinaxcon/templates/static_pages/homepage.html +++ b/pinaxcon/templates/static_pages/homepage.html @@ -16,7 +16,7 @@