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
def check_password(): | |
"""Returns `True` if the user had a correct password.""" | |
def password_entered(): | |
"""Checks whether a password entered by the user is correct.""" | |
user = authenticate( | |
username=st.session_state['username'], | |
password=st.session_state['password'] | |
) | |
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
Deploying Django on Apache server with mod_wsgi | |
Per https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/ | |
https://modwsgi.readthedocs.io/en/develop/installation.html | |
Some things are not immediately obvious, so I'm writing down the detailed list of steps that worked for me. | |
I started with bare VPS, using Ubuntu 18.04.4. Python 3 (3.6.9) was available out of the box, but not Python 2. | |
Used the latest mod_wsgi version available (mod_wsgi-4.7.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
#!/usr/bin/python3 | |
import argparse | |
import logging | |
import subprocess | |
import os | |
import tempfile | |
from tempfile import mkstemp | |
import configparser | |
import gzip |
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/bash | |
# | |
# You can use `git branch --edit-description` to write a description | |
# for a branch, but Git provides no simple command to display that | |
# description. The "easiest" way to see it is via `git config --get | |
# branch.BRANCH_NAME.description`. | |
# | |
# This script automates that process and is meant to be used as | |
# a Git alias to provide a shorter command for showing the | |
# description of the current branch. |
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 | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, [email protected] / [email protected] |