Create a role and a database for Django:
create role user with superuser login with password '***';
create database gn_24 with owner user;
\c gn_24
FROM python:2.7.17-stretch AS base | |
MAINTAINER GeoNode development team | |
# This section is borrowed from the official Django image but adds GDAL and others | |
RUN apt-get update && apt-get install -y \ | |
gcc \ | |
zip \ | |
gettext \ | |
postgresql-client libpq-dev \ | |
sqlite3 \ |
FROM python:3.7 as build | |
# The python:3.7 image is HUGE but already comes with all the essentials | |
# for compiling (most) python modules with native dependencies | |
ENV LC_ALL C.UTF-8 | |
ENV LANG C.UTF-8 | |
RUN pip install pipenv | |
WORKDIR /build | |
COPY Pipfile Pipfile.lock /build/ |
import logging | |
from django.contrib.gis.db.backends.postgis.base import \ | |
DatabaseWrapper as PostgisDBWrapper | |
from django.db import ProgrammingError | |
from .schema import TimescaleSchemaEditor | |
logger = logging.getLogger(__name__) |
import difflib | |
import wasabi | |
def diff_strings(a, b): | |
output = [] | |
matcher = difflib.SequenceMatcher(None, a, b) | |
for opcode, a0, a1, b0, b1 in matcher.get_opcodes(): | |
if opcode == "equal": | |
output.append(a[a0:a1]) | |
elif opcode == "insert": |
I hereby claim:
To claim this, I am signing this object:
from typing import Optional | |
import base64 | |
from passlib.context import CryptContext | |
from datetime import datetime, timedelta | |
import jwt | |
from jwt import PyJWTError | |
from pydantic import BaseModel |
from fastapi import Security, Depends, FastAPI, HTTPException | |
from fastapi.security.api_key import APIKeyQuery, APIKeyCookie, APIKeyHeader, APIKey | |
from fastapi.openapi.docs import get_swagger_ui_html | |
from fastapi.openapi.utils import get_openapi | |
from starlette.status import HTTP_403_FORBIDDEN | |
from starlette.responses import RedirectResponse, JSONResponse | |
API_KEY = "1234567asdfgh" | |
API_KEY_NAME = "access_token" |
from typing import Optional | |
from datetime import datetime, timedelta | |
import jwt | |
from jwt import PyJWTError | |
from fastapi import Depends, FastAPI, HTTPException | |
from fastapi.encoders import jsonable_encoder | |
from fastapi.security.oauth2 import ( | |
OAuth2, |
from typing import Optional | |
import base64 | |
from passlib.context import CryptContext | |
from datetime import datetime, timedelta | |
import jwt | |
from jwt import PyJWTError | |
from pydantic import BaseModel |