https://github.com/marcelomdevasconcellos/emensageria
$ docker network create -d bridge postgres-network
$ docker network ls
$ docker volume create --name=postgres-data
# Com esse aqui a senha do admin do DB não altera.
$ docker run --name postgres --network=postgres-network -e "POSTGRES_PASSWORD=postgres" -v postgres-data:/var/lib/postgresql/data -p 5440:5432 -d postgres:12.4-alpine
# Para alterar fazer isso
$ docker exec -it postgres
$ psql -U postgres "ALTER USER postgres WITH PASSWORD 'postgres'";
$ exit
$ docker run --name pgadmin --network=postgres-network -p 15432:80 -e "[email protected]" -e "PGADMIN_DEFAULT_PASSWORD=postgres" -d dpage/pgadmin4
# pgAdmin
# Autenticar
# host: postgres
# user: postgres
# password: postgres
# port: 5432
# maintenance database: postgres
# Criar Server Group: dev
# Criar um Database: emensageria
# Clonar o projeto
$ mkdir -p /home/thiago/Projects/workspaces/gedit-workspace
$ cd /home/thiago/Projects/workspaces/gedit-workspace
$ git clone https://github.com/marcelomdevasconcellos/emensageria.git
# Instalar PyENV
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev git
$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
# Acrescentar ao final do ~/.bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# Executar
$ source .bashrc
# Instalar Python 3.8.5
$ pyenv install 3.8.5
# Verificar a instalação
$ pyenv versions
# Definir o Python 3.8.5 como a versão a ser usada no projeto emensageria
$ cd emensageria
$ pyenv local 3.8.5
# Verificar a versão do Python usada no projeto
$ pyenv versions
# Criar um VirtualENV para o projeto
$ python -m venv .emensageria
# Ativar o VirtualENV criado
$ source .emensageria/bin/activate
# Instalar dependências do projeto
$ pip install -r requirements.txt(.emensageria) thiago@inspiron:~/Projects/workspaces/gedit-workspace/emensageria$ pip install -r requirements.txt
Collecting wheel==0.36.2
Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting Django==3.2.4
Downloading Django-3.2.4-py3-none-any.whl (7.9 MB)
|████████████████████████████████| 7.9 MB 864 kB/s
Collecting django-celery-beat==1.5.0
Downloading django_celery_beat-1.5.0-py2.py3-none-any.whl (36 kB)
Collecting django-constance==2.8.0
Downloading django_constance-2.8.0-py3-none-any.whl (57 kB)
|████████████████████████████████| 57 kB 1.4 MB/s
Collecting django-cron==0.5.1
Downloading django-cron-0.5.1.tar.gz (12 kB)
Collecting django-currentuser==0.5.3
Downloading django_currentuser-0.5.3-py2.py3-none-any.whl (6.8 kB)
Collecting django-environ==0.4.5
Downloading django_environ-0.4.5-py2.py3-none-any.whl (21 kB)
Collecting django-localflavor==2.2
Downloading django_localflavor-2.2-py2.py3-none-any.whl (2.5 MB)
|████████████████████████████████| 2.5 MB 6.2 MB/s
Collecting django-picklefield==2.0
Downloading django_picklefield-2.0-py2.py3-none-any.whl (9.3 kB)
Collecting django-reversion==3.0.4
Downloading django_reversion-3.0.4-py2.py3-none-any.whl (81 kB)
|████████████████████████████████| 81 kB 2.3 MB/s
Collecting django-timezone-field==3.0
Downloading django_timezone_field-3.0-py2.py3-none-any.whl (8.7 kB)
Collecting django-wkhtmltopdf==3.3.0
Downloading django_wkhtmltopdf-3.3.0-py2.py3-none-any.whl (16 kB)
Collecting djangorestframework==3.12.4
Downloading djangorestframework-3.12.4-py3-none-any.whl (957 kB)
|████████████████████████████████| 957 kB 3.2 MB/s
Collecting googletrans==2.4.0
Downloading googletrans-2.4.0.tar.gz (17 kB)
Collecting goslate==1.5.1
Downloading goslate-1.5.1.tar.gz (17 kB)
Collecting jsonfield==3.1.0
Downloading jsonfield-3.1.0-py3-none-any.whl (8.0 kB)
Collecting markdown==2.6
Downloading Markdown-2.6.tar.gz (298 kB)
|████████████████████████████████| 298 kB 11.4 MB/s
Collecting psycopg2-binary==2.9.1
Downloading psycopg2_binary-2.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB)
|████████████████████████████████| 3.4 MB 6.4 MB/s
Collecting pyOpenSSL==17.5.0
Downloading pyOpenSSL-17.5.0-py2.py3-none-any.whl (53 kB)
|████████████████████████████████| 53 kB 871 kB/s
Collecting python-slugify==4.0.1
Downloading python-slugify-4.0.1.tar.gz (11 kB)
Collecting signxml==2.5.2
Downloading signxml-2.5.2-py2.py3-none-any.whl (27 kB)
Collecting Unidecode==1.1.1
Downloading Unidecode-1.1.1-py2.py3-none-any.whl (238 kB)
|████████████████████████████████| 238 kB 6.1 MB/s
Collecting untangle==1.1.1
Downloading untangle-1.1.1.tar.gz (3.1 kB)
Collecting xhtml2pdf==0.2.2
Downloading xhtml2pdf-0.2.2.tar.gz (97 kB)
|████████████████████████████████| 97 kB 2.2 MB/s
Collecting xmlschema==1.0.13
Downloading xmlschema-1.0.13-py2.py3-none-any.whl (307 kB)
|████████████████████████████████| 307 kB 2.4 MB/s
Collecting xmltodict==0.11.0
Downloading xmltodict-0.11.0-py2.py3-none-any.whl (7.2 kB)
Collecting json2xml==3.5.0
Downloading json2xml-3.5.0-py2.py3-none-any.whl (4.6 kB)
Collecting django-adminlte-ui
Cloning https://github.com/marcelomdevasconcellos/django-adminlte-ui.git to /tmp/pip-install-rgyu28g9/django-adminlte-ui
Running command git clone -q https://github.com/marcelomdevasconcellos/django-adminlte-ui.git /tmp/pip-install-rgyu28g9/django-adminlte-ui
Collecting libesocial
Cloning https://github.com/marcelomdevasconcellos/libesocial.git to /tmp/pip-install-rgyu28g9/libesocial
Running command git clone -q https://github.com/marcelomdevasconcellos/libesocial.git /tmp/pip-install-rgyu28g9/libesocial
Collecting beautifulsoup4==4.9.3
Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
|████████████████████████████████| 115 kB 10.4 MB/s
Collecting pandas==1.2.4
Downloading pandas-1.2.4-cp38-cp38-manylinux1_x86_64.whl (9.7 MB)
|████████████████████████████████| 9.7 MB 7.7 MB/s
Collecting lxml~=4.6.1
Downloading lxml-4.6.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9 MB)
|████████████████████████████████| 6.9 MB 4.5 MB/s
Collecting coreapi
Downloading coreapi-2.3.3-py2.py3-none-any.whl (25 kB)
Collecting django-filter
Downloading django_filter-21.1-py3-none-any.whl (81 kB)
|████████████████████████████████| 81 kB 1.4 MB/s
Collecting djangorestframework-simplejwt==4.7.1
Downloading djangorestframework_simplejwt-4.7.1-py3-none-any.whl (60 kB)
|████████████████████████████████| 60 kB 2.3 MB/s
Collecting django-rest-passwordreset==1.1.0
Downloading django_rest_passwordreset-1.1.0-py2.py3-none-any.whl (24 kB)
Collecting django-cors-headers==3.7.0
Downloading django_cors_headers-3.7.0-py3-none-any.whl (12 kB)
Collecting reportlab
Downloading reportlab-3.6.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB)
|████████████████████████████████| 2.8 MB 8.7 MB/s
Collecting django-allauth==0.41.0
Downloading django-allauth-0.41.0.tar.gz (545 kB)
|████████████████████████████████| 545 kB 11.2 MB/s
Collecting whitenoise==5.2.0
Downloading whitenoise-5.2.0-py2.py3-none-any.whl (19 kB)
Collecting requests~=2.24.0
Downloading requests-2.24.0-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 150 kB/s
Collecting django-treebeard~=4.3
Downloading django_treebeard-4.5.1-py3-none-any.whl (103 kB)
|████████████████████████████████| 103 kB 7.2 MB/s
Collecting python-dateutil==2.8.1
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
|████████████████████████████████| 227 kB 6.7 MB/s
Collecting dicttoxml==1.7.4
Downloading dicttoxml-1.7.4.tar.gz (18 kB)
Collecting asgiref<4,>=3.3.2
Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
Collecting pytz
Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
|████████████████████████████████| 503 kB 3.9 MB/s
Collecting sqlparse>=0.2.2
Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)
|████████████████████████████████| 42 kB 539 kB/s
Collecting python-crontab>=2.3.4
Downloading python-crontab-2.6.0.tar.gz (55 kB)
|████████████████████████████████| 55 kB 2.2 MB/s
Collecting django-common-helpers>=0.6.4
Downloading django-common-helpers-0.9.2.tar.gz (37 kB)
Collecting python-stdnum>=1.0
Downloading python_stdnum-1.17-py2.py3-none-any.whl (943 kB)
|████████████████████████████████| 943 kB 10.0 MB/s
Collecting six
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting futures
Downloading futures-3.0.5.tar.gz (25 kB)
Collecting cryptography>=2.1.4
Downloading cryptography-37.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB)
|████████████████████████████████| 4.1 MB 3.5 MB/s
Collecting text-unidecode>=1.3
Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
|████████████████████████████████| 78 kB 3.6 MB/s
Collecting certifi>=2015.11.20.1
Downloading certifi-2022.5.18.1-py3-none-any.whl (155 kB)
|████████████████████████████████| 155 kB 10.4 MB/s
Collecting eight<1,>=0.3.0
Downloading eight-0.4.2-py2.py3-none-any.whl (9.9 kB)
Collecting defusedxml<1,>=0.4.1
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting asn1crypto>=0.21.0
Downloading asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
|████████████████████████████████| 105 kB 8.9 MB/s
Collecting html5lib>=1.0
Downloading html5lib-1.1-py2.py3-none-any.whl (112 kB)
|████████████████████████████████| 112 kB 5.4 MB/s
Collecting httplib2
Downloading httplib2-0.20.4-py3-none-any.whl (96 kB)
|████████████████████████████████| 96 kB 3.2 MB/s
Collecting pyPdf2
Downloading PyPDF2-2.1.0-py3-none-any.whl (184 kB)
|████████████████████████████████| 184 kB 3.0 MB/s
Collecting Pillow
Downloading Pillow-9.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
|████████████████████████████████| 3.1 MB 5.1 MB/s
Collecting elementpath~=1.1.7
Downloading elementpath-1.1.8-py2.py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 1.3 MB/s
Collecting zeep>=2.5.0
Downloading zeep-4.1.0-py2.py3-none-any.whl (100 kB)
|████████████████████████████████| 100 kB 4.4 MB/s
Collecting soupsieve>1.2; python_version >= "3.0"
Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)
Collecting numpy>=1.16.5
Downloading numpy-1.22.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.9 MB)
|████████████████████████████████| 16.9 MB 6.8 MB/s
Collecting itypes
Downloading itypes-1.2.0-py2.py3-none-any.whl (4.8 kB)
Collecting uritemplate
Downloading uritemplate-4.1.1-py2.py3-none-any.whl (10 kB)
Collecting coreschema
Downloading coreschema-0.0.4.tar.gz (10 kB)
Collecting pyjwt<3,>=2
Downloading PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting python3-openid>=3.0.8
Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 8.3 MB/s
Collecting requests-oauthlib>=0.3.0
Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 1.5 MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
Downloading urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
|████████████████████████████████| 127 kB 12.1 MB/s
Collecting chardet<4,>=3.0.2
Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 9.6 MB/s
Collecting cffi>=1.12
Downloading cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
|████████████████████████████████| 446 kB 5.4 MB/s
Collecting future<0.17,>=0.16
Downloading future-0.16.0.tar.gz (824 kB)
|████████████████████████████████| 824 kB 3.4 MB/s
Collecting webencodings
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2; python_version > "3.0"
Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
|████████████████████████████████| 98 kB 1.9 MB/s
Collecting typing-extensions; python_version < "3.10"
Downloading typing_extensions-4.2.0-py3-none-any.whl (24 kB)
Collecting cached-property>=1.3.0
Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting requests-toolbelt>=0.7.1
Downloading requests_toolbelt-0.9.1-py2.py3-none-any.whl (54 kB)
|████████████████████████████████| 54 kB 545 kB/s
Collecting platformdirs>=1.4.0
Downloading platformdirs-2.5.2-py3-none-any.whl (14 kB)
Collecting attrs>=17.2.0
Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
|████████████████████████████████| 60 kB 2.6 MB/s
Collecting requests-file>=1.5.1
Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
Collecting isodate>=0.5.4
Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
|████████████████████████████████| 41 kB 184 kB/s
Collecting jinja2
Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 10.4 MB/s
Collecting oauthlib>=3.0.0
Downloading oauthlib-3.2.0-py3-none-any.whl (151 kB)
|████████████████████████████████| 151 kB 7.8 MB/s
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
|████████████████████████████████| 118 kB 11.7 MB/s
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Using legacy setup.py install for django-cron, since package 'wheel' is not installed.
Using legacy setup.py install for googletrans, since package 'wheel' is not installed.
Using legacy setup.py install for goslate, since package 'wheel' is not installed.
Using legacy setup.py install for markdown, since package 'wheel' is not installed.
Using legacy setup.py install for python-slugify, since package 'wheel' is not installed.
Using legacy setup.py install for untangle, since package 'wheel' is not installed.
Using legacy setup.py install for xhtml2pdf, since package 'wheel' is not installed.
Using legacy setup.py install for django-adminlte-ui, since package 'wheel' is not installed.
Using legacy setup.py install for libesocial, since package 'wheel' is not installed.
Using legacy setup.py install for django-allauth, since package 'wheel' is not installed.
Using legacy setup.py install for dicttoxml, since package 'wheel' is not installed.
Using legacy setup.py install for python-crontab, since package 'wheel' is not installed.
Using legacy setup.py install for django-common-helpers, since package 'wheel' is not installed.
Using legacy setup.py install for futures, since package 'wheel' is not installed.
Using legacy setup.py install for coreschema, since package 'wheel' is not installed.
Using legacy setup.py install for future, since package 'wheel' is not installed.
ERROR: signxml 2.5.2 has requirement cryptography<3,>=1.8, but you'll have cryptography 37.0.2 which is incompatible.
ERROR: django-adminlte-ui 1.5.1 has requirement django-treebeard==4.3, but you'll have django-treebeard 4.5.1 which is incompatible.
Installing collected packages: wheel, asgiref, pytz, sqlparse, Django, django-timezone-field, six, python-dateutil, python-crontab, django-celery-beat, django-constance, django-common-helpers, django-cron, django-currentuser, django-environ, python-stdnum, django-localflavor, django-picklefield, django-reversion, django-wkhtmltopdf, djangorestframework, idna, urllib3, chardet, certifi, requests, googletrans, futures, goslate, jsonfield, markdown, psycopg2-binary, pycparser, cffi, cryptography, pyOpenSSL, text-unidecode, python-slugify, future, eight, defusedxml, asn1crypto, lxml, signxml, Unidecode, untangle, webencodings, html5lib, pyparsing, httplib2, typing-extensions, pyPdf2, Pillow, reportlab, xhtml2pdf, elementpath, xmlschema, xmltodict, dicttoxml, json2xml, django-treebeard, django-adminlte-ui, cached-property, requests-toolbelt, platformdirs, attrs, requests-file, isodate, zeep, libesocial, soupsieve, beautifulsoup4, numpy, pandas, itypes, uritemplate, MarkupSafe, jinja2, coreschema, coreapi, django-filter, pyjwt, djangorestframework-simplejwt, django-rest-passwordreset, django-cors-headers, python3-openid, oauthlib, requests-oauthlib, django-allauth, whitenoise
Running setup.py install for python-crontab ... done
Running setup.py install for django-common-helpers ... done
Running setup.py install for django-cron ... done
Running setup.py install for googletrans ... done
Running setup.py install for futures ... done
Running setup.py install for goslate ... done
Running setup.py install for markdown ... done
Running setup.py install for python-slugify ... done
Running setup.py install for future ... done
Running setup.py install for untangle ... done
Running setup.py install for xhtml2pdf ... done
Running setup.py install for dicttoxml ... done
Running setup.py install for django-adminlte-ui ... done
Running setup.py install for libesocial ... done
Running setup.py install for coreschema ... done
Running setup.py install for django-allauth ... done
Successfully installed Django-3.2.4 MarkupSafe-2.1.1 Pillow-9.1.1 Unidecode-1.1.1 asgiref-3.5.2 asn1crypto-1.5.1 attrs-21.4.0 beautifulsoup4-4.9.3 cached-property-1.5.2 certifi-2022.5.18.1 cffi-1.15.0 chardet-3.0.4 coreapi-2.3.3 coreschema-0.0.4 cryptography-37.0.2 defusedxml-0.7.1 dicttoxml-1.7.4 django-adminlte-ui-1.5.1 django-allauth-0.41.0 django-celery-beat-1.5.0 django-common-helpers-0.9.2 django-constance-2.8.0 django-cors-headers-3.7.0 django-cron-0.5.1 django-currentuser-0.5.3 django-environ-0.4.5 django-filter-21.1 django-localflavor-2.2 django-picklefield-2.0 django-rest-passwordreset-1.1.0 django-reversion-3.0.4 django-timezone-field-3.0 django-treebeard-4.5.1 django-wkhtmltopdf-3.3.0 djangorestframework-3.12.4 djangorestframework-simplejwt-4.7.1 eight-0.4.2 elementpath-1.1.8 future-0.16.0 futures-3.0.5 googletrans-2.4.0 goslate-1.5.1 html5lib-1.1 httplib2-0.20.4 idna-2.10 isodate-0.6.1 itypes-1.2.0 jinja2-3.1.2 json2xml-3.5.0 jsonfield-3.1.0 libesocial-0.0.1rc1 lxml-4.6.5 markdown-2.6 numpy-1.22.4 oauthlib-3.2.0 pandas-1.2.4 platformdirs-2.5.2 psycopg2-binary-2.9.1 pyOpenSSL-17.5.0 pyPdf2-2.1.0 pycparser-2.21 pyjwt-2.4.0 pyparsing-3.0.9 python-crontab-2.6.0 python-dateutil-2.8.1 python-slugify-4.0.1 python-stdnum-1.17 python3-openid-3.2.0 pytz-2022.1 reportlab-3.6.10 requests-2.24.0 requests-file-1.5.1 requests-oauthlib-1.3.1 requests-toolbelt-0.9.1 signxml-2.5.2 six-1.16.0 soupsieve-2.3.2.post1 sqlparse-0.4.2 text-unidecode-1.3 typing-extensions-4.2.0 untangle-1.1.1 uritemplate-4.1.1 urllib3-1.25.11 webencodings-0.5.1 wheel-0.36.2 whitenoise-5.2.0 xhtml2pdf-0.2.2 xmlschema-1.0.13 xmltodict-0.11.0 zeep-4.1.0
WARNING: You are using pip version 20.1.1; however, version 22.1.2 is available.
You should consider upgrading via the '/home/thiago/Projects/workspaces/gedit-workspace/emensageria/.emensageria/bin/python -m pip install --upgrade pip' command.
(.emensageria) thiago@inspiron:~/Projects/workspaces/gedit-workspace/emensageria$ python -m pip install --upgrade pip
/home/thiago/Projects/workspaces/gedit-workspace/emensageria/.emensageria/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/x509.py:14: CryptographyDeprecationWarning: This version of cryptography contains a temporary pyOpenSSL fallback path. Upgrade pyOpenSSL now.
warnings.warn(
Collecting pip
Downloading pip-22.1.2-py3-none-any.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 922 kB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.1.1
Uninstalling pip-20.1.1:
Successfully uninstalled pip-20.1.1
Successfully installed pip-22.1.2# continuação da instalação
$ pip install cryptography==2.9.2
$ pip install django-treebeard==4.3
# Após corrigir o problema com as duas dependências, tentar reinstalar a aplicação.
$ pip install -r requirements.txt
# Editar variáveis de ambiente da aplicação
$ cp config/.env_example config/.env
$ vim config/.env
# Criar tabelas no banco de dados.
$ python manage.py migrate
# Criar super usuário
## user: admin
## password: admin
## email: [email protected]
$ python manage.py createsuperuser
# Executar a aplicação
$ python manage.py runserver
# Acesse a aplicação
http://localhost:8000/
# Acessar pgAdmin
http://localhost:15432/login?next=%2F