This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "Database name argument is required" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: python manage.py collectstatic --noinput && bin/start-pgbouncer bin/start-nginx gunicorn -c gunicorn.conf.py project.wsgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "" | |
version = "0.1.0" | |
description = "" | |
authors = [""] | |
[tool.poetry.dependencies] | |
python = "^3.9" | |
Django = ">3" | |
django-fbv = "<1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.minimap.enabled": false, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[html]": { | |
"editor.insertSpaces": true, | |
"editor.tabSize": 2, | |
"editor.defaultFormatter": "HookyQR.beautify" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
From https://ackee.electerious.com/ | |
--> | |
<style> | |
.heart { | |
width: 16px; | |
height: 16px; | |
fill: #73fac8; | |
margin: 0 4px -1px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document domain("goatcounter.com"), domain("stats.arp242.net") { | |
html, body { | |
background-color: white; | |
} | |
.page { | |
padding-top: 4em; | |
box-shadow: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# @Author: José Sánchez-Gallego ([email protected]) | |
# @Date: 2019-12-18 | |
# @Filename: create_setup.py | |
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) | |
# https://github.com/sdss/flicamera/blob/master/create_setup.py | |
# This is a temporary solution for the fact that pip install . fails with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.apps import AppConfig | |
from django.conf import settings | |
from django.utils.autoreload import autoreload_started | |
class Config(AppConfig): | |
name = "random_app_name" | |
def ready(self): | |
autoreload_started.connect(watch_env) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RequestMethodMiddleware: | |
""" | |
Add request method as properties to the request object. | |
Example: `request.is_post` instead of `request.method == "POST"` | |
""" | |
def __init__(self, get_response): | |
self.get_response = get_response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
`furl` is really nice, but if it's only used for easily grabbing querstrings, you can use the `urlib.parse` module instead. | |
""" | |
url = "http://www.test.com?some_qs_here=asdf" | |
# Instead of this... | |
from furl import furl | |
parsed_url = furl(url) |