virtualenvwrapper
https://virtualenvwrapper.readthedocs.io/en/latest/
- pip3 install --user wheel
- pip3 install --user virtualenv
- pip3 install --user virtualenvwrapper
- When installing as user, pip may put virtualenv at
~/.local/bin/virtualenv
In this case, you need to copy the binary to /usr/bin because
the wrapper is looking for it there. Adding the path to PATH does not
work, because wrapper looks for virtualenv in /usr/bin.
e.g.
cp -r ~/.local/bin/virtualenv /usr/bin/virtualenv
- mkvirtualenv potify
- When returning to the directory to work, run:
workon potify
pip
- First time installation of packages:
pip install -r requirements.txt
(note) pip will likely throw you an error about "pkg-resources=0.0.0".
This is apparently caused by Ubuntu providing some bad metadata to pip
when you are in a virtualenv.
https://github.com/pypa/pip/issues/4022
At the above issue, looks to be solved in some version of pip.
It may break the virtualenv if removed.
I moved it to the last line of the requirements.txt so everything else
continues to be installed. This will likely be overwritten if reqs
are frozen again.
We can simply ignore the error from the pip install then?
- pip install -r requirements.txt does not work when it reaches this error.
- Remove the pkg-resources=0.0.0 line from requirements.txt so that pip
can proceed to actually install everything.
- At this point you should be able to run:
./manage.py runserver
yarn
https://yarnpkg.com/lang/en/docs/install/#debian-stable
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt update && sudo apt install yarn
yarn install
- Before running yarn install, you may need a later version of nodejs.
- For Debian systems, see:
https://github.com/nodesource/distributions/blob/master/README.md#deb
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
- sudo apt-get install -y nodejs
- Now, you can run:
yarn install
Vue Install:
- cp -r ~/pub/blog-examples/integrate-django-vue/frontend/ ~/pub/potify/potify/frontend/
- Update settings.py according to tutorial
- cp ~/pub/blog-examples/integrate-django-vue/django_vue/views.py ~/pub/potify/potify/potify/views.py
- Add the view we just copied to urls.py
- Run 'yarn install' in frontend dir
- Run 'yarn run serve' in frontend dir
Vue Router Install:
npm install --save vue-router
Command to run the postgres server (Linux):
/usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l start logfile