Skip to content

Instantly share code, notes, and snippets.

@pyjavo
pyjavo / Dockerfile
Created January 27, 2020 22:27
GeoDjango Docker Container Alpine
FROM python:3.7-alpine
ENV PYTHONUNBUFFERED 1
RUN apk update \
# psycopg2 dependencies
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
# Pillow dependencies
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
@pyjavo
pyjavo / csv_to_django.py
Created August 26, 2020 18:24
Snippet de Dario
# Full path and name to your csv file
csv_filepathname=""
# Full path to your django project directory
home=""
import sys,os
sys.path.append(home)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
@pyjavo
pyjavo / wget.sh
Created December 3, 2020 17:13 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.