mkdir ajax_django_example
cd ajax_django_example/
virtualenv env
source env/bin/activate
python --version
pip install django
django-admin startproject example
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
''' | |
Proof of Concept: | |
Django devs built an ORM that seems way more straightforward than many existing tools. This class lets you leverage the django-orm without any project settings or other aspects of a django setup. | |
There are probably weak points and functionality missing, but it seems like a relatively intuitive proof of concept | |
''' | |
import os | |
import django | |
from django.conf import settings |
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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
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 * as bcrypt from "bcrypt"; | |
import { createCookieSessionStorage, redirect } from "remix"; | |
import { db } from "./db.server"; | |
export type LoginForm = { | |
username: string; | |
password: string; | |
}; |
2023-03-15: checked it for python == 3.11, django == 4.1.7, jupyterlab = 3.6.1, django-extensions == 3.2.1, jupyter-server <= 2.0.0
Using Django project in Jupyter or JupyterLab
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
/* Load Zepto as module */ | |
module.exports = { | |
entry: "./app.js", | |
output: { | |
path: __dirname, | |
filename: "bundle.js" | |
}, | |
module: { | |
loaders: [ | |
{ test: /zepto(\.min)?\.js$/, loader: "exports?Zepto; delete window.$; delete window.Zepto;" }, |
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
'use strict'; | |
define(['phaser'], function(Phaser) { | |
function Gesture(game) { | |
this.game = game; | |
this.swipeDispatched = false; | |
this.holdDispatched = false; | |
this.isTouching = false; |