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
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
Привет, дорогой друг!
Если ты здесь, то видимо ты обучаешься на курсе Data Mining in Action. Должно быть ты уже заметили, что материалы курса выкладываются в этом репозитории. Сейчас я расскажу тебе один из способов, как всегда иметь под рукой его свежую версию.
Если какие-то шаги уже выполнены, просто пропусти их.
Чтобы получить себе копию репозитория курса, нужно сделать fork исходного репозитория
Теперь клонируем репозиторий к себе на компьютер, выполнив в консоли команду:
import argparse | |
import logging | |
import os | |
import time | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor | |
from datetime import timedelta | |
from functools import partial | |
from pathlib import Path | |
import pydicom |
import argparse | |
import logging | |
import os | |
import time | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor | |
from datetime import timedelta | |
from functools import partial | |
from pathlib import Path | |
import pydicom |
# Based on https://gist.github.com/spicycode/1229612 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
Руководство по интеграции Django и Jupyter
Считаем, что django и jupyter уже установлены
Установить django-extensions
pip install django-extensions
""" | |
Небольшая шпаргалка по библиотечке respx. Все это есть в документации https://lundberg.github.io/respx/guide/, | |
но местами написано очень коротко и не очевидно. | |
Зависимости: python > 3.10, httpx, respx, pytest-asyncio | |
""" | |
from typing import Any | |
import httpx | |
import pytest |
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold cyan)<%an>%Creset' --abbrev-commit | |
ss = status -s | |
b = branch | |
ca = commit -a -m | |
last = log -1 HEAD | |
co = checkout | |
# fuzzy checkout by ticket number for branches like feature/cool-stuff-abc1234 | |
fco = "!f() { git branch -a | egrep -m1 \"(feature|hotfix)/.*${1}\" | sed \"s/remotes\\/origin\\///\" | xargs git checkout; }; f" | |
amend = commit --amend --no-edit |
# https://janakiev.com/blog/jupyter-virtual-envs/ | |
# https://ipython.readthedocs.io/en/stable/install/kernel_install.html | |
1. Activate your venv | |
2. pip install --user ipykernel | |
3. python -m ipykernel install --user --name=myenv --display-name "Python (myenv)" |
conda install -y nodejs | |
pip install ipympl | |
pip install --upgrade jupyterlab | |
jupyter labextension install @jupyter-widgets/jupyterlab-manager | |
jupyter labextension install jupyter-matplotlib | |
jupyter nbextension enable --py widgetsnbextension | |
# then use magic %matplotlib widget |