Just some notes and references for myself.
- In bash, you can access your
C:\
drive via/mnt/c/
~
=C:\Users\MLM\AppData\Local\lxss\home\mlm
and is different from your Windows user directoryC:\Users\MLM
This is a rough guide to setting up browser testing through Selenium on Windows Subsystem for Linux (WSL), aka Bash on Ubuntu on Windows. It assumes the following environment:
The coding project folders are stored in the main Windows filing hierarchy and accessed via dev/mnt, but that makes no real difference to development and testing other than making it possible to edit the code using a GUI based editor within Windows.
The problem with browser testing in WSL is that it relies on opening and controlling a web browser, and browsers don’t work on WSL at present as it deliberately doesn’t include X Windows or some other GUI manager - it’s meant to be command line after all. So while you can apt-get firefox
, trying to actually run it isn’t going to work.
from graphene import relay, String, List | |
from graphene_django.filter import DjangoFilterConnectionField | |
from graphene_django.fields import DjangoConnectionField | |
from app.models import Model | |
class Object(DjangoObjectType): | |
class Meta: | |
model = Model |
# coding: utf-8 | |
"""Cause git to detect a merge conflict when two branches have migrations.""" | |
# myapp/management/commands/makemigrations.py | |
# you'll need myapp/management/commands/__init__.py and myapp/management/__init__.py in PY2, see Django docs | |
from __future__ import absolute_import, unicode_literals | |
import io | |
import os | |
import six |
import asyncio | |
import random | |
class Hub(): | |
def __init__(self): | |
self.subscriptions = set() | |
def publish(self, message): |
The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.
Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.
$ yarn start | |
yarn run v1.1.0 | |
$ nodemon | |
[nodemon] 1.12.1 | |
[nodemon] to restart at any time, enter `rs` | |
[nodemon] watching: webpack/webpack.config.js | |
[nodemon] starting `webpack-dev-server --config webpack/webpack.config.js` | |
Project is running at https://localhost:4201/ | |
webpack output is served from /assets/ | |
Content not from webpack is served from *** |
Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it.
All I need to do is npm i -D webpack@next
, right?
+ webpack@4.0.0-beta.2
from django.contrib.admin.options import BaseModelAdmin | |
from django.contrib.admin.views.autocomplete import AutocompleteJsonView | |
from django.contrib.admin.widgets import ( | |
AutocompleteSelect, AutocompleteSelectMultiple, | |
) | |
from django.utils.http import urlencode | |
from urllib.parse import unquote, quote_plus, parse_qsl | |
class AutocompleteUrl(object): |
# -*- coding: utf-8 -*- | |
import json | |
import toml | |
def read_pipenv_lock(): | |
with open('Pipfile.lock') as lock: | |
return json.loads(lock.read()) |