This file contains 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
version: "3.9" | |
services: | |
api: | |
build: . | |
restart: always | |
container_name: api | |
ports: | |
- "3456:3456" | |
volumes: |
This file contains 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
import os | |
from pathlib import Path | |
# Build paths inside the project like this: BASE_DIR / 'subdir'. | |
BASE_DIR = Path(__file__).resolve().parent.parent | |
# Logging configuration | |
LOGGING = { | |
"version": 1, |
This file contains 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
name: Build & Deploy | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
This file contains 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
# Third-party Imports | |
import pymongo | |
import motor | |
class MongoDB(object): | |
"""Base wrapper to connect to MongoDB""" | |
def __init__(self): | |
"""Initialize the MongoDB connection""" |
This file contains 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 ArrayChallenge(arr): | |
# N -> first number in array | |
N = arr[0] | |
# empty list of numbers | |
res = [] | |
# loop through the length of arrays, | |
# starting from one |
This file contains 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
import uuid | |
from django.db import models | |
# Use the import below instead, if using GeoDjango fields | |
# from django.contrib.gis.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
from django.contrib.postgres.fields import ( | |
ArrayField, | |
CICharField, | |
CIEmailField, |