Heroku updates to python

If you see a message like this during one of your heroku builds/pushes, here’s what you should do:

remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.7

Take a look at what your runtime.txt file looks like. Mine looks like:

$ more runtime.txt

So, fire up your favorite editor and make it match.

Then commit that file, and push it back up to your repo and heroku.

$ git push heroku master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 300 bytes | 12.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: -----> Python app detected
remote: -----> Found python-3.7.6, removing
remote: -----> No change in requirements detected, installing from cache
remote: -----> Installing python-3.7.7
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Installing dependencies from Pipfile.lock (a33c91)…

apache redirects to https

With no cost SSL certificates easily available, there’s no reason not to have your websites running on https. Here’s what you need to setup inside your apache conf files. (I’ll use this server as an example)

<VirtualHost *:80>
    ServerName markcerv.com
    ServerAlias www.markcerv.com
    DocumentRoot /srv/www/markcerv/htdocs/
    <Directory /srv/www/markcerv/htdocs>
        Require all granted
        Allowoverride ALL

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]


The keywords that need to be added are:

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]

That’s it. That should force everything over to the https version of your site. With this method, if your ServerName contains www.example.com, then you’ll get redirected to the www version of the site.