Re: [pgadmin-hackers][pgaweb][patch] Website patch to add SCSS
От | Dave Page |
---|---|
Тема | Re: [pgadmin-hackers][pgaweb][patch] Website patch to add SCSS |
Дата | |
Msg-id | CA+OCxozL5=s67C8vw8ftN0wNWJ0b30k-gr6RL1JOD=9cHen9WQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [pgadmin-hackers][pgaweb][patch] Website patch to add SCSS (George Gelashvili <ggelashvili@pivotal.io>) |
Ответы |
Re: [pgadmin-hackers][pgaweb][patch] Website patch to add SCSS
|
Список | pgadmin-hackers |
On Wed, Jul 12, 2017 at 9:27 PM, George Gelashvili <ggelashvili@pivotal.io> wrote:
Hi Dave,Hmm, seems like the dependencies are broken. Adding them throws me down what seems like a rabbit hole of manual installation, starting with:(pgaweb) piranha:pgaweb dpage$ pip install -r requirements.txtRequirement already satisfied: Django==1.8.18 in /Users/dpage/.virtualenvs/pgaweb/lib/python2.7/site-packages (from -r requirements.txt (line 1)) Requirement already satisfied: psycopg2==2.7.1 in /Users/dpage/.virtualenvs/pgaweb/lib/python2.7/site-packages (from -r requirements.txt (line 2)) Collecting libsass==0.13.2 (from -r requirements.txt (line 3))Using cached libsass-0.13.2.tar.gzCould not import setuptools which is required to install from a source distribution.Traceback (most recent call last):File "/Users/dpage/.virtualenvs/pgaweb/lib/python2.7/site-package s/pip/req/req_install.py", line 387, in setup_py import setuptools # noqaFile "/Users/dpage/.virtualenvs/pgaweb/lib/python2.7/site-package s/setuptools/__init__.py", line 10, in <module> from six.moves import filter, mapImportError: No module named six.movesPerhaps the entire dependency tree should be added to requirements.txt?What version of pip runs in your pyenv? We're able to pip install requirements inside a new 2.7.10 virtualenv, that gets created with pip 9.0.1 by default.
Apologies - my virtual env was messed up.
- Scripts to yarn to compile the SCSS and run the application- Add startapp.sh script to start the applicationThe application runs under uWSGI - it's not going to be started via a script. It's auto-updated periodically from git, and uWSGI will restart when necessary so if any pre-processing of files is required, that needs to be done at startup automatically.Okay, so it sounds like shelling out to yarn in wsgi would resolve this.
I think your suggestion below would be cleaner.
Otherwise, what does the auto-update process look like? perhaps compilation steps belong there rather than in app startup.
It's really just a GIT pull. uWSGI then detects the change and restarts that app. We could certainly have it do "git pull && yarn install && yarn run scss" or similar.
Now that said, the scss doesn't actually seem to build for me. I had to make 2 changes to get anywhere:
1) Change the tag in base.html to:
<link href="{% sass_src 'css/pgaweb.scss' %}" rel="stylesheet" type="text/css" />
2) Remove the STATIC_ROOT directive from settings.py (so it didn't try to compile to /static) and replace with COMPRESS_ROOT='static/' and SASS_PROCESSOR_ROOT='static/'.
That left me with a running site, that seems to behave as expected, at least when run standalone.
Patch attached - comments?
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
В списке pgadmin-hackers по дате отправления: