Обсуждение: pgAdmin 4 as Web application

Поиск
Список
Период
Сортировка

pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
I'm trying to follow
https://www.pgadmin.org/docs4/dev/server_deployment.html
to install pgAdmin 4 as web application on RHEL 6, but I didn't get very far:

There is no file "pgAdmin4.wsgi" available for download.
Did I miss something obvious?


So I tried to build from source, and failed immediately with

laurenz:~/rpmbuild/pgadmin4-1.0-beta3/runtime> qmake-qt4
Project MESSAGE: Building for QT4...
Project MESSAGE: Building for Linux/Mac...
Project MESSAGE: Using /usr/bin/python-config
Project MESSAGE: Python2 detected.

laurenz:~/rpmbuild/pgadmin4-1.0-beta3/runtime> make
g++ -c -m64 -pipe -I/usr/include/python2.6 -I/usr/include/python2.6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector--param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DPYTHON2 -DQT_NO_DEBUG
-DQT_WEBKIT_LIB-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I.
-I/usr/include/QtCore-I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -I. -o
pgAdmin4.opgAdmin4.cpp
 
In file included from TabWindow.h:16,
                 from BrowserWindow.h:16,
                 from pgAdmin4.cpp:28:
WebViewWindow.h:20:20: error: QWebView: No such file or directory
In file included from TabWindow.h:16,
                 from BrowserWindow.h:16,
                 from pgAdmin4.cpp:28:
WebViewWindow.h:24: error: expected class-name before ‘{’ token
make: *** [pgAdmin4.o] Error 1

I searched the web, but could not find any answers how to install
Qt Webkit on RHEL 6.

Can you help?

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Neel Patel
Дата:
Hi,

From the logs, it looks like - Qt webkit component is missing in Qt4 installation.
Are you building Qt from source, If yes then there will be option in configure script to build Qt4 with webkit.
If you are not using source code, try installing webkit with yum (e.g. yum install libqt4-webkit).

Thanks,
Neel Patel


On Mon, Aug 8, 2016 at 8:37 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
I'm trying to follow
https://www.pgadmin.org/docs4/dev/server_deployment.html
to install pgAdmin 4 as web application on RHEL 6, but I didn't get very far:

There is no file "pgAdmin4.wsgi" available for download.
Did I miss something obvious?


So I tried to build from source, and failed immediately with

laurenz:~/rpmbuild/pgadmin4-1.0-beta3/runtime> qmake-qt4
Project MESSAGE: Building for QT4...
Project MESSAGE: Building for Linux/Mac...
Project MESSAGE: Using /usr/bin/python-config
Project MESSAGE: Python2 detected.

laurenz:~/rpmbuild/pgadmin4-1.0-beta3/runtime> make
g++ -c -m64 -pipe -I/usr/include/python2.6 -I/usr/include/python2.6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DPYTHON2 -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -I. -o pgAdmin4.o pgAdmin4.cpp
In file included from TabWindow.h:16,
                 from BrowserWindow.h:16,
                 from pgAdmin4.cpp:28:
WebViewWindow.h:20:20: error: QWebView: No such file or directory
In file included from TabWindow.h:16,
                 from BrowserWindow.h:16,
                 from pgAdmin4.cpp:28:
WebViewWindow.h:24: error: expected class-name before ‘{’ token
make: *** [pgAdmin4.o] Error 1

I searched the web, but could not find any answers how to install
Qt Webkit on RHEL 6.

Can you help?

Yours,
Laurenz Albe

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: pgAdmin 4 as Web application

От
Dave Page
Дата:
On Mon, Aug 8, 2016 at 4:07 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> I'm trying to follow
> https://www.pgadmin.org/docs4/dev/server_deployment.html
> to install pgAdmin 4 as web application on RHEL 6, but I didn't get very far:
>
> There is no file "pgAdmin4.wsgi" available for download.
> Did I miss something obvious?

Hmm, no - looks like we did. I know people have been testing in web
mode, so I wonder how this got missed!

I don't have time to test right now, but I believe something like the
following one liner should suffice as your wsgi file:

from pgAdmin4 import app as application

Make sure that's in the same directory as pgAdmin4.py (the web/
directory in the source tree), then point your Apache config to it.

If you need any further quick hints (I'm going offline for the rest of
the day in a minute), this may help:
http://flask.pocoo.org/docs/0.11/deploying/mod_wsgi/ - but do pay
close attention to the comments on threads/prcesses in the pgAdmin
docs.

Please let me know if it works.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Neel Patel wrote:
>>     WebViewWindow.h:20:20: error: QWebView: No such file or directory

> From the logs, it looks like - Qt webkit component is missing in Qt4 installation.
> Are you building Qt from source, If yes then there will be option in configure script to build Qt4
> with webkit.
> If you are not using source code, try installing webkit with yum (e.g. yum install libqt4-webkit).

I found an appropriate RPM somewhere, now I have a different problem.

I am building with Qt 4.6.2 from RHEL 6, which should be OK according to the README,
but I am failing with

g++ -c -m64 -pipe -I/usr/include/python2.6 -I/usr/include/python2.6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector--param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DPYTHON2 -DQT_NO_DEBUG
-DQT_WEBKIT_LIB-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I.
-I/usr/include/QtCore-I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -I. -o
BrowserWindow.oBrowserWindow.cpp
 
BrowserWindow.cpp: In member function ‘void BrowserWindow::unsupportedContent(QNetworkReply*)’:
BrowserWindow.cpp:446: error: ‘QUrlQuery’ was not declared in this scope
BrowserWindow.cpp:446: error: expected ‘;’ before ‘query_data’
BrowserWindow.cpp:447: error: ‘query_data’ was not declared in this scope
BrowserWindow.cpp: In member function ‘bool BrowserWindow::checkClientDownload(const QUrl&, const QNetworkRequest&)’:
BrowserWindow.cpp:681: error: ‘QUrlQuery’ was not declared in this scope
BrowserWindow.cpp:681: error: expected ‘;’ before ‘downloadData’
BrowserWindow.cpp:683: error: ‘downloadData’ was not declared in this scope
make: *** [BrowserWindow.o] Error 1

The code uses QUrlQuery, but according to http://doc.qt.io/qt-5/qurlquery.html
this class has existed only since 5.0.

Seems to be either a documentation bug (Qt 5 required) or a code bug.
Can you help?

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Neel Patel
Дата:
Hi,

We already have condition for QUrlQuery class as below. It will be used only if Qt version is >= 5.0.

#if QT_VERSION >= 0x050000
    // Extract filename and query from encoded URL
    QUrlQuery query_data(reply->url());
    QString file_name = query_data.queryItemValue("filename");
    QString query = query_data.queryItemValue("query");
#else
    QUrl url(reply->url());
    QString file_name = url.queryItemValue("filename");
    QString query = url.queryItemValue("query");
#endif


In your case, it may possible that during qmake - Qt version is detected as 5 but you are compiling against Qt 4 so application is not able to find the QUrlQuery class.

Can you please share console log and Makefile when you run the qmake command with project file ?

Thanks,
Neel Patel

On Tue, Aug 9, 2016 at 6:09 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Neel Patel wrote:
>>      WebViewWindow.h:20:20: error: QWebView: No such file or directory

> From the logs, it looks like - Qt webkit component is missing in Qt4 installation.
> Are you building Qt from source, If yes then there will be option in configure script to build Qt4
> with webkit.
> If you are not using source code, try installing webkit with yum (e.g. yum install libqt4-webkit).

I found an appropriate RPM somewhere, now I have a different problem.

I am building with Qt 4.6.2 from RHEL 6, which should be OK according to the README,
but I am failing with

g++ -c -m64 -pipe -I/usr/include/python2.6 -I/usr/include/python2.6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DPYTHON2 -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -I. -o BrowserWindow.o BrowserWindow.cpp
BrowserWindow.cpp: In member function ‘void BrowserWindow::unsupportedContent(QNetworkReply*)’:
BrowserWindow.cpp:446: error: ‘QUrlQuery’ was not declared in this scope
BrowserWindow.cpp:446: error: expected ‘;’ before ‘query_data’
BrowserWindow.cpp:447: error: ‘query_data’ was not declared in this scope
BrowserWindow.cpp: In member function ‘bool BrowserWindow::checkClientDownload(const QUrl&, const QNetworkRequest&)’:
BrowserWindow.cpp:681: error: ‘QUrlQuery’ was not declared in this scope
BrowserWindow.cpp:681: error: expected ‘;’ before ‘downloadData’
BrowserWindow.cpp:683: error: ‘downloadData’ was not declared in this scope
make: *** [BrowserWindow.o] Error 1

The code uses QUrlQuery, but according to http://doc.qt.io/qt-5/qurlquery.html
this class has existed only since 5.0.

Seems to be either a documentation bug (Qt 5 required) or a code bug.
Can you help?

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Neel Patel wrote:
> We already have condition for QUrlQuery class as below. It will be used only if Qt version is >= 5.0.
> 
> #if QT_VERSION >= 0x050000
>     // Extract filename and query from encoded URL
>     QUrlQuery query_data(reply->url());
>     QString file_name = query_data.queryItemValue("filename");
>     QString query = query_data.queryItemValue("query");
> #else
>     QUrl url(reply->url());
>     QString file_name = url.queryItemValue("filename");
>     QString query = url.queryItemValue("query");
> #endif

Oh, I see now, thank you for the help.
I was missing commit dcf5bfc495bea1d5b28c389335cbd89e73468aaa (I downloaded
the pgadmin4-1.0-beta3 source).

After editing the file, I can build it, but when starting "pgadmin4" I get

Full Python path:  ""
User Python path:  ""
Webapp path:  "/MYSQL/mysqldata/fs1/rpmbuild/pgadmin4-1.0-beta3/web/pgAdmin4.py"
Traceback (most recent call last):
  File "/MYSQL/mysqldata/fs1/rpmbuild/pgadmin4-1.0-beta3/web/pgAdmin4.py", line 24, in <module>
    from pgadmin import create_app
  File "/MYSQL/mysqldata/fs1/rpmbuild/pgadmin4-1.0-beta3/web/pgadmin/__init__.py", line 281
    arch_keys = {0}
                  ^
SyntaxError: invalid syntax

The same happens when I try to start it as web application.

My system has
Python 2.6.6
Qt 4.6.2
Apache httpd 2.2.15

What could be the problem?

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Dave Page wrote:
>> There is no file "pgAdmin4.wsgi" available for download.
>> Did I miss something obvious?
> 
> Hmm, no - looks like we did. I know people have been testing in web
> mode, so I wonder how this got missed!
> 
> I don't have time to test right now, but I believe something like the
> following one liner should suffice as your wsgi file:
> 
> from pgAdmin4 import app as application
> 
> Make sure that's in the same directory as pgAdmin4.py (the web/
> directory in the source tree), then point your Apache config to it.
> 
> If you need any further quick hints (I'm going offline for the rest of
> the day in a minute), this may help:
> http://flask.pocoo.org/docs/0.11/deploying/mod_wsgi/ - but do pay
> close attention to the comments on threads/prcesses in the pgAdmin
> docs.
> 
> Please let me know if it works.

Thanks, that was very helpful indeed.

I had to put more stuff into the wsgi file, probably because my installation
is in some nonstandard location:

   import sys
   sys.path.insert(0, '/home/laurenz/rpmbuild/pgadmin4-1.0-beta3/web')
   from pgAdmin4 import app as application

Now I'm getting to the same error as with the standalone version, see
https://www.postgresql.org/message-id/A737B7A37273E048B164557ADEF4A58B5388C035%40ntex2010i.host.magwien.gv.at

It would be good to improve the documentation for "Server deployment".
It should be mentioned that you don't need the binaries for that, and that
the "web" subdirectory contains all you need.


Re: pgAdmin 4 as Web application

От
Ashesh Vashi
Дата:

On Wed, Aug 10, 2016 at 12:58 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:

Dave Page wrote:
>> There is no file "pgAdmin4.wsgi" available for download.
>> Did I miss something obvious?
>
> Hmm, no - looks like we did. I know people have been testing in web
> mode, so I wonder how this got missed!
>
> I don't have time to test right now, but I believe something like the
> following one liner should suffice as your wsgi file:
>
> from pgAdmin4 import app as application
>
> Make sure that's in the same directory as pgAdmin4.py (the web/
> directory in the source tree), then point your Apache config to it.
>
> If you need any further quick hints (I'm going offline for the rest of
> the day in a minute), this may help:
> http://flask.pocoo.org/docs/0.11/deploying/mod_wsgi/ - but do pay
> close attention to the comments on threads/prcesses in the pgAdmin
> docs.
>
> Please let me know if it works.

Thanks, that was very helpful indeed.

I had to put more stuff into the wsgi file, probably because my installation
is in some nonstandard location:

   import sys
   sys.path.insert(0, '/home/laurenz/rpmbuild/pgadmin4-1.0-beta3/web')
   from pgAdmin4 import app as application

Now I'm getting to the same error as with the standalone version, see
https://www.postgresql.org/message-id/A737B7A37273E048B164557ADEF4A58B5388C035%40ntex2010i.host.magwien.gv.at
Looks like the Python 2.6 compatibility has been broken.

For now - can you use Python 2.7/3?

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi



It would be good to improve the documentation for "Server deployment".
It should be mentioned that you don't need the binaries for that, and that
the "web" subdirectory contains all you need.


--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Ashesh Vashi wrote:
>> Now I'm getting to the same error as with the standalone version, see
>> https://www.postgresql.org/message-

> Looks like the Python 2.6 compatibility has been broken.
> 
> For now - can you use Python 2.7/3?

I tried again on a RHEL 7 machine with Python 2.7.5 and the
latest development version of pgAdmin4.

Now I get the following error:

mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
Traceback (most recent call last):
  File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
    from pgAdmin4 import app as application
  File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
    app = create_app()
  File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
    import pgadmin.utils.paths as paths
AttributeError: 'module' object has no attribute 'paths'

Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.

What could be the problem?

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Dave Page
Дата:
On Fri, Sep 2, 2016 at 1:45 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Ashesh Vashi wrote:
>>> Now I'm getting to the same error as with the standalone version, see
>>> https://www.postgresql.org/message-
>
>> Looks like the Python 2.6 compatibility has been broken.
>>
>> For now - can you use Python 2.7/3?
>
> I tried again on a RHEL 7 machine with Python 2.7.5 and the
> latest development version of pgAdmin4.
>
> Now I get the following error:
>
> mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
> mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
> Traceback (most recent call last):
>   File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
>     from pgAdmin4 import app as application
>   File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
>     app = create_app()
>   File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
>     import pgadmin.utils.paths as paths
> AttributeError: 'module' object has no attribute 'paths'
>
> Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.

No, but there should be a pgadmin/utils/paths.py file. Is that there?

FYI, I'm running a test server on CentOS 7 - my Apache config looks like this:

    WSGIDaemonProcess pgadmin processes=1 threads=25
    WSGIScriptAlias /pgadmin4 /opt/pgAdmin4/web/pgAdmin4.wsgi

    <Directory /opt/pgAdmin4/web>
        WSGIProcessGroup pgadmin
        WSGIApplicationGroup %{GLOBAL}
        Require all granted
    </Directory>

That's working with the pgAdmin4.wsgi file unmodified from git.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Dave Page wrote:
> On Fri, Sep 2, 2016 at 1:45 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
>> Now I get the following error:
>>
>> mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
>> mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
>> Traceback (most recent call last):
>>   File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
>>     from pgAdmin4 import app as application
>>   File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
>>     app = create_app()
>>   File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
>>     import pgadmin.utils.paths as paths
>> AttributeError: 'module' object has no attribute 'paths'
>>
>> Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.
> 
> No, but there should be a pgadmin/utils/paths.py file. Is that there?

Yes, there is, and it is readable to everyone.

I don't know much about Python - could it be that version 2.7 handles this
line differently from 3?

I'll see what I can find out with strace.

> FYI, I'm running a test server on CentOS 7 - my Apache config looks like this:
> 
>     WSGIDaemonProcess pgadmin processes=1 threads=25
>     WSGIScriptAlias /pgadmin4 /opt/pgAdmin4/web/pgAdmin4.wsgi
> 
>     <Directory /opt/pgAdmin4/web>
>         WSGIProcessGroup pgadmin
>         WSGIApplicationGroup %{GLOBAL}
>         Require all granted
>     </Directory>
> 
> That's working with the pgAdmin4.wsgi file unmodified from git.

Mine looks the same (except for the paths and a ServerName directive).

I think it's a Python problem rather than a web server problem.

Thanks for your help!
I really want to get it running so I and my co-workers can test.

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Dave Page
Дата:
On Mon, Sep 5, 2016 at 8:08 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Dave Page wrote:
>> On Fri, Sep 2, 2016 at 1:45 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
>>> Now I get the following error:
>>>
>>> mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
>>> mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
>>> Traceback (most recent call last):
>>>   File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
>>>     from pgAdmin4 import app as application
>>>   File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
>>>     app = create_app()
>>>   File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
>>>     import pgadmin.utils.paths as paths
>>> AttributeError: 'module' object has no attribute 'paths'
>>>
>>> Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.
>>
>> No, but there should be a pgadmin/utils/paths.py file. Is that there?
>
> Yes, there is, and it is readable to everyone.
>
> I don't know much about Python - could it be that version 2.7 handles this
> line differently from 3?

No - I do all my development on 2.7 and it works fine (as do most of
the other devs I believe). 3.x is definitely less well tested, and 2.6
is behind that.

Ashesh, any ideas what could be causing this?

> I'll see what I can find out with strace.

Thanks.

>> FYI, I'm running a test server on CentOS 7 - my Apache config looks like this:
>>
>>     WSGIDaemonProcess pgadmin processes=1 threads=25
>>     WSGIScriptAlias /pgadmin4 /opt/pgAdmin4/web/pgAdmin4.wsgi
>>
>>     <Directory /opt/pgAdmin4/web>
>>         WSGIProcessGroup pgadmin
>>         WSGIApplicationGroup %{GLOBAL}
>>         Require all granted
>>     </Directory>
>>
>> That's working with the pgAdmin4.wsgi file unmodified from git.
>
> Mine looks the same (except for the paths and a ServerName directive).
>
> I think it's a Python problem rather than a web server problem.
>
> Thanks for your help!
> I really want to get it running so I and my co-workers can test.
>
> Yours,
> Laurenz Albe



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgAdmin 4 as Web application

От
Albe Laurenz
Дата:
Dave Page wrote:
>>>> mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
>>>> mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
>>>> Traceback (most recent call last):
>>>>   File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
>>>>     from pgAdmin4 import app as application
>>>>   File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
>>>>     app = create_app()
>>>>   File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
>>>>     import pgadmin.utils.paths as paths
>>>> AttributeError: 'module' object has no attribute 'paths'
>>>>
>>>> Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.
>>>
>>> No, but there should be a pgadmin/utils/paths.py file. Is that there?
>>
>> Yes, there is, and it is readable to everyone.
>>
>> I don't know much about Python - could it be that version 2.7 handles this
>> line differently from 3?
> 
> No - I do all my development on 2.7 and it works fine (as do most of
> the other devs I believe). 3.x is definitely less well tested, and 2.6
> is behind that.
> 
> Ashesh, any ideas what could be causing this?

Must have been something weird; a web server restart fixed the problem.

Thanks for the help; it is working now.

I'm kind of surprised that pgAdmin4 is already a release candidate, I still
find lots of bugs just randomly clicking around.
I'll report them of course.

Yours,
Laurenz Albe

Re: pgAdmin 4 as Web application

От
Ashesh Vashi
Дата:

On Mon, Sep 5, 2016 at 8:15 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:

Dave Page wrote:
>>>> mod_wsgi (pid=20880): Target WSGI script '/opt/pgadmin4/pgAdmin4.wsgi' cannot be loaded as Python module.
>>>> mod_wsgi (pid=20880): Exception occurred processing WSGI script '/opt/pgadmin4/pgAdmin4.wsgi'.
>>>> Traceback (most recent call last):
>>>>   File "/opt/pgadmin4/pgAdmin4.wsgi", line 8, in <module>
>>>>     from pgAdmin4 import app as application
>>>>   File "/opt/pgadmin4/pgAdmin4.py", line 58, in <module>
>>>>     app = create_app()
>>>>   File "/opt/pgadmin4/pgadmin/__init__.py", line 204, in create_app
>>>>     import pgadmin.utils.paths as paths
>>>> AttributeError: 'module' object has no attribute 'paths'
>>>>
>>>> Indeed there is no pgadmin/utils/paths directory with a __init__.py in it.
>>>
>>> No, but there should be a pgadmin/utils/paths.py file. Is that there?
>>
>> Yes, there is, and it is readable to everyone.
>>
>> I don't know much about Python - could it be that version 2.7 handles this
>> line differently from 3?
>
> No - I do all my development on 2.7 and it works fine (as do most of
> the other devs I believe). 3.x is definitely less well tested, and 2.6
> is behind that.
>
> Ashesh, any ideas what could be causing this?
I can think of existing .pyc files, which can cause this kind of problems.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi


Must have been something weird; a web server restart fixed the problem.

Thanks for the help; it is working now.

I'm kind of surprised that pgAdmin4 is already a release candidate, I still
find lots of bugs just randomly clicking around.
I'll report them of course.

Yours,
Laurenz Albe