#author("2021-09-18T13:22:38+09:00","default:jomura","jomura")
* WSL2でDjango [#r9ffe944]
wsl -l -v
wsl --install -d Ubuntu
wsl --set-version Ubuntu 2
wsl --export Ubuntu Ubuntu_python.tar
wsl --import Ubuntu_python %USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState_python\ Ubuntu_python.tar --version 2
wsl --unregister Ubuntu
del Ubuntu_python.tar
wsl -l -v
wsl -d Ubuntu_python -u user
- 以下wsl内で実行
# Jaistに変更
sudo sed -i'~' -E "s@http://(..\.)?(archive|security)\.ubuntu\.com/ubuntu@http://ftp.jaist.ac.jp/pub/Linux/ubuntu@g" /etc/apt/sources.list
sudo apt -y update && sudo apt -y full-upgrade
sudo apt -y install python3-pip
#sudo ln -s /usr/bin/python3.8 /usr/bin/python
sudo pip3 install virtualenv
mkdir dev
cd dev/
virtualenv dev-env
. dev-env/bin/activate
pip3 install django
django-admin startproject example
cd example
python manage.py migrate
python manage.py runserver