Skip to content

Instantly share code, notes, and snippets.

View evildmp's full-sized avatar

Daniele Procida evildmp

  • Canonical
  • Cardiff, Wales
View GitHub Profile
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 26 12:42:00 2022
@author: tommasoprocida
"""
import math
@evildmp
evildmp / House with a hundred rooms
Last active November 24, 2022 06:40
The CHills, House with a hundred rooms
The Chills, House with a hundred rooms
Thunderwarm autumn winds blow,
Their inevitable decay to trees that know
In fresh summer shade where the leaf let go
But just standing still in twilight gloom,
By my house with a hundred rooms,
The lights are for the likes of you.
@evildmp
evildmp / dockerise-for-divio.txt
Last active June 29, 2021 13:47
Files to be changed in order to Dockerise a Django application for deployment on Divio
git@github.com:divio/demosite.git
Dockerfile
===========
FROM python:3.8
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
RUN python manage.py collectstatic --noinput
.. meta::
:description:
This guide explains step-by-step how to deploy a WordPress project with Docker, in accordance with
Twelve-factor principles.
:keywords: Docker, PHP, WordPress, MySQL, S3
.. _php-wordpress-create-deploy:
How to migrate (or create) and deploy a WordPress project
# <WARNING>
# Everything within sections like <TAG> is generated and can
# be automatically replaced on deployment. You can disable
# this functionality by simply removing the wrapping tags.
# </WARNING>
# <DOCKER_FROM>
# FROM aldryn/base-project:3.25.1
FROM divio/base:4.15-py3.6-slim-stretch
# </DOCKER_FROM>
Looking in indexes: https://wheels.aldryn.net/v1/aldryn-extras+pypi/aldryn-baseproject-v4-py36/+simple/
Collecting django-spurl==0.6.6
Downloading https://wheels.aldryn.net/v1/pypi/aldryn-baseproject-v4-py36/+simple/django-spurl/0.6.6/download/178954/django-spurl-0.6.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-yjmem2ec/django-spurl/setup.py", line 39, in <module>
long_description=read('README.rst') + '\n\n' + read('CHANGES.rst'),
File "/tmp/pip-install-yjmem2ec/django-spurl/setup.py", line 12, in read
return codecs.open(file_path, encoding='utf-8').read()
*LTS* in the table indicates a combination of Django and django CMS both covered
by a long-term support policy.
=========== === === === === === === === = === === === ==== ==== === === ======= =======
django CMS Python Django
----------- --------------------------- - ---------------------------------------------
\ 3.7 3.6 3.5 3.4 3.3 2.7 2.6 2.2 2.1 2.0 1.11 1.10 1.9 1.8 1.6/1.7 1.4/1.5
=========== === === === === === === === = === === === ==== ==== === === ======= =======
3.7.x ✓ ✓ ✓ ✓ ✓ ✓ ⨯ LTS ✓ ✓ LTS ⨯ ⨯ ⨯ ⨯ ⨯
3.6.x ✓ ✓ ✓ ✓ ✓ ✓ ⨯ ✓ ✓ ✓ ✓ ⨯ ⨯ ⨯ ⨯ ⨯
Mar 20 19:53:27 pantograph kernel: [ 1069.235835] dwc2 20980000.usb: new device is high-speed
Mar 20 19:53:27 pantograph kernel: [ 1069.247865] dwc2 20980000.usb: new address 21
Mar 20 19:53:28 pantograph kernel: [ 1070.117445] dwc2 20980000.usb: new device is high-speed
Mar 20 19:53:28 pantograph kernel: [ 1070.129871] dwc2 20980000.usb: new address 23
Mar 20 19:53:39 pantograph kernel: [ 1080.995492] dwc2 20980000.usb: new device is high-speed
Mar 20 19:53:39 pantograph kernel: [ 1081.007820] dwc2 20980000.usb: new address 26
Mar 20 19:53:40 pantograph kernel: [ 1082.431982] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
Mar 20 19:53:41 pantograph kernel: [ 1083.030661] dwc2 20980000.usb: new device is high-speed
Mar 20 19:53:41 pantograph kernel: [ 1083.042322] dwc2 20980000.usb: new address 24
Mar 20 19:53:42 pantograph kernel: [ 1084.621110] dwc2 20980000.usb: new device is high-speed
.. raw:: html
<style>
.row {clear: both}
@media only screen and (min-width: 1000px),
only screen and (min-width: 500px) and (max-width: 768px){
.column {
padding-left: 5px;