Assumptions:
- You use Django with [Django-Storages][storages] for saving your STATIC and MEDIA files to S3
- You use Nginx to reverse proxy to Django
- You want to protect any URLs that start with /admin or /subscribe
import inspect | |
import logging | |
import shutil | |
import sys | |
from time import time | |
from types import MethodType | |
from typing import Optional | |
from django.conf import settings | |
from django.db import DEFAULT_DB_ALIAS, connections |
name: CI | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: |
.* | |
!.coveragerc | |
!.env | |
!.pylintrc |
""" | |
License: MIT - https://opensource.org/licenses/MIT | |
ChromeLogger is a protocol which allows sending logging messages to the Browser. | |
This module implements simple support for Django. It consists of two components: | |
* `LoggingMiddleware` which is responsible for sending all log messages | |
associated with the request to the browser. | |
* `ChromeLoggerHandler` a python logging handler which collects all messages. |
## | |
# Global SSL settings - nginx.conf in http section | |
## | |
## | |
# For additional performance, enable SPDY support for each site by changing the: | |
# | |
# listen 443 ssl; | |
# | |
# line to: |
{% if is_paginated %} | |
{% load i18n %} | |
<ul class="pagination"> | |
<li{% if not page_obj.has_previous %} class="disabled"{% endif %}><a href="{% if not page_obj.has_previous %}#{% else %}?page={{ page_obj.previous_page_number }}{{ getvars }}{% endif %}">«</a></li> | |
{% if show_first %} | |
<li><a href="?page=1{{ getvars }}">1</a></li> | |
<li><span>...</span></li> | |
{% endif %} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DB Stacktrace</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap --> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet" media="screen"> | |
<link href="http://getbootstrap.com/docs-assets/css/pygments-manni.css" rel="stylesheet" media="screen"> | |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
The code will get better. Linus' Law: "given enough eyeballs, all bugs are shallow": we'll be able to get community contributions and bug reports, and thus the code will grow better faster than we can grow it ourselves. Also, Joy's Law - "No matter who you are, most of the smartest people work for someone else": we'll get better code from people who don't work for us than from people who do.
We'll write better code. Wall's 3rd great virtual of a programmer, Hubris: we'll write better code people we don't want other people to say bad things about us. We'll do better with the world watching than with just us.
Increased ability to hire. We're a 19k circ newspaper in a town most people have never heard of. Open source will help put us on the map, make us a place people actually might be interested in working.
When we do hire, we'll be able to hire pe