Skip to content

Instantly share code, notes, and snippets.

View samwelkanda's full-sized avatar
💭
</>

Samwel K. samwelkanda

💭
</>
View GitHub Profile
# Find meeting times
from datetime import timedelta
from msgraph.generated.models.activity_domain import ActivityDomain
from msgraph.generated.models.attendee_base import AttendeeBase
from msgraph.generated.models.attendee_type import AttendeeType
from msgraph.generated.models.date_time_time_zone import DateTimeTimeZone
from msgraph.generated.models.email_address import EmailAddress
from msgraph.generated.models.location_constraint import LocationConstraint
from msgraph.generated.models.location_constraint_item import LocationConstraintItem
from msgraph.generated.models.time_constraint import TimeConstraint

Authentication in Django

Django's authentication only works with the traditional HTML request-response cycle. Historically, when a user wanted to perform some action (such as creating a new account), the user would fill out a form in their web browser. When they clicked the "Submit" button, the browser would make a request — which included the data the user had typed into the registration form — to the server, the server would process that request, and it would respond with HTML or redirect the browser to a new page.

Today, frontend clients expect the server to return JSON instead of HTML. By returning JSON, we can let the client decide what it should do next instead of letting the server decide. With a JSON request-response cycle, the server receives data, processes it, and returns a response (just like in the HTML request-response cycle), but the response does not control the browser's behavior. It just tells us the result of the request.

Session-Based Authentication

By default, Django uses session

Project Based Learning

A list of programming tutorials in which learners build an application from scratch. These tutorials are divided into different primary programming languages. Some have intermixed technologies and languages.

To get started, simply fork this repo. Please refer to CONTRIBUTING.md for contribution guidelines.

Table of Contents:

Django, Docker, uWSGI, Celery, Redis

Django

python manage.py makemigrations --dry-run --verbosity 3 let's you look at what the migration will actually look like without creating the migration file

Docker

uWSGI

GRAPHQL

GraphQL is a specification (spec) for client-server communication. A spec describes the capabilities and characteristics of a language.

GraphQL is a query language for your APIs. A GraphQL query asks only for the data that it needs.

It was developed by Lee Byron, Nick Schrock, and Dan Schafer to solve problems with Facebooks mobile apps.

History of Data Transport

DOCKER CHEATSHEET

The use of Linux containers to deploy applications is called containerization. Docker is a containerization tool used for spinning up isolated, reproducible application environments. Containerization is increasingly popular because containers are:

Flexible: Even the most complex applications can be containerized. Lightweight: Containers leverage and share the host kernel. Interchangeable: You can deploy updates and upgrades on-the-fly. Portable: You can build locally, deploy to the cloud, and run anywhere.

A GUIDE TO USING PIPENV FOR PYTHON PROJECTS

Spawn a shell in a virtual environment to isolate the development of an app:

$ pipenv shell

Force the creation of a Python 2 or 3 environment with the arguments --two and --three respectively.

Install the 3rd party package you need e.g

@samwelkanda
samwelkanda / django_digitalocean.md
Created May 2, 2019 13:17
A step by step process of deploying a django project to digital ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.