sudo apt-get install python3-pip
sudo pip3 install virtualenv
| import sys | |
| import traceback | |
| from django.utils import timezone | |
| from django.db import transaction | |
| from django.core.management.base import BaseCommand, CommandError | |
| # django will strip new lines split helptext in 80 char lines | |
| HELP_TEXT = """ |
| sudo apt-get update | |
| sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx | |
| sudo -u postgres psql | |
| - paste this code in postgres console: | |
| CREATE DATABASE django_project; | |
| CREATE USER username WITH PASSWORD 'pass1234'; | |
| ALTER ROLE username SET client_encoding TO 'utf8'; | |
| ALTER ROLE username SET default_transaction_isolation TO 'read committed'; |
| #!/bin/sh | |
| #http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/ | |
| # GENERAL | |
| # print lines begining with range of letters | |
| grep ^[A-D] table.txt | |
| # REGEX |
When using vagrant, vscode won't be able to map to the vm, well not yet anyway. A way around this is to checkout a branch called pipenv, run pipenv --python 3 to create a virtual environment. Then run pipenv install -r requirements.txt to install everything in the project.
After doing this, in vscode ctrl+p then search for >python: select interpreter. Select the virtual env python, it will look something like this: /home/yourname/.local/share/virtualenvs/project-foo-JbRjzqlX/bin/python.
Just don't commit the pipenv stuff.
Place the following in .git/hooks/pre-commit