>
> {% if prev_url %}
>
>
Previous Records
>
> {% endif %}
>
> {% if next_url %}
>
>
Next Records
>
> {% endif %}
>
>
>
> Records
>
>
>
> {% for row in records %}
>
>
>
> Any ideas? If I could use links than buttons, this would e okay.
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
From linux4ms at gmail.com Thu Aug 8 07:07:44 2019
From: linux4ms at gmail.com (Ben Duncan)
Date: Thu, 8 Aug 2019 06:07:44 -0500
Subject: [Flask] PyDal Connector
Message-ID:
Has anyone adapted PyDal from web2py group as the database connector
for Flask?
It has been spun off to a separate library ...
I really prefer it to SQLalchemy ORM (OR any ORM for that matter)
See:
https://pypi.org/project/pydal/
http://zetcode.com/python/pydal/
...etc..
Again, thanks ...
*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From larry.martell at gmail.com Fri Aug 9 15:09:48 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Fri, 9 Aug 2019 15:09:48 -0400
Subject: [Flask] Connecting to 2 servers
Message-ID:
I have a flask app I inherited. It connects to a MySQL server and I
need to add a second connection to a MS SQL server.
The connection to the MySQL server was done like this:
engine = create_engine_from_str(connect_string)
factory = scoped_session(sessionmaker(bind=engine))
factory.configure(bind=engine)
I added a second connection:
m_engine = create_engine_from_str(m_connect_string)
m_factory = scoped_session(sessionmaker(bind=m_engine))
m_factory.configure(bind=m_engine)
But when I try any use the second connection it fails:
sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('IM002',
'[IM002] [unixODBC][Driver Manager]Data source name not found, and no
default driver specified (0) (SQLDriverConnect)')
What am I doing wrong?
From coreybrett at gmail.com Sun Aug 11 12:19:51 2019
From: coreybrett at gmail.com (Corey Boyle)
Date: Sun, 11 Aug 2019 12:19:51 -0400
Subject: [Flask] Extensions directory
Message-ID:
What happened to the Flask Extensions directory?
From mhysnm1964 at gmail.com Mon Aug 12 08:45:32 2019
From: mhysnm1964 at gmail.com (mhysnm1964 at gmail.com)
Date: Mon, 12 Aug 2019 22:45:32 +1000
Subject: [Flask] flask tables with relationship tables.
Message-ID: <009b01d5510b$d5c49ce0$814dd6a0$@gmail.com>
All,
I am using flask_tables and flask_sqlalchemy to generate the database. I
want to know how I can populate the class you have to create for
flask_tables with an relational database. The model I am using is:
class Categories(db.Model):
id = db.Column(db.Integer, primary_key=True)
category = db.Column(db.String(64), index=True, unique=True)
subcategories = db.relationship('SubCategories', backref='categories',
lazy='dynamic')
def __repr__(self):
return ''.format(self.category)
class SubCategories(db.Model):
id = db.Column(db.Integer, primary_key=True)
subcategory = db.Column(db.String(80), index=True, unique=True)
category_id = db.Column(db.Integer, db.ForeignKey('categories.id'))
transactions = db.relationship('Transactions',
backref='sub_categories', lazy='dynamic')
def __repr__(self):
return ''.format(self.subcategory)
class Transactions (db.Model):
id = db.Column(db.Integer, primary_key=True)
transactiondate = db.Column(db.Date, index=True, nullable=False)
description = db.Column(db.String(80), nullable=False)
amount = db.Column(db.Float, nullable=False)
subcategory_id = db.Column(db.Integer,
db.ForeignKey('sub_categories.id'))
account_no = db.Column(db.Integer,
db.ForeignKey('accounts.account_number'))
The queries I have used are:
Records = Transactions.query.all()
Records = Transactions.query.join(SubCategories).join(Categories).all()
If I use records[0].SubCategories.Categories.category in the flask shell. I
get the category value. But I get nothing when I use the flask_table.
Col(SubCategories.Categories.category) in the table class. Not sure what I
am doing wrong. As I cannot find any examples for this module with
relational databases. I am assuming everything between the Col(.) is the
field of the database.
Does anyone have examples that I can have a look at using this module? AS it
appears it has a built in sort method for the table. The other question
flask_sqlalchemy has the ability of pagination. How can I get this to work
with Flask_table? Do I just feed it a sqlalchemy object that is generated
from the pagination process.
Any help or tips would be welcomed. New at all this and still trying to get
my head around everything. I do have many more questions. But they can wait
for now.
Note, Either method of query I have shown generates the same result when I
use it in the flask shell. def __repr__(self):
return ''.format(self.description)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From larry.martell at gmail.com Mon Aug 12 10:27:48 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Mon, 12 Aug 2019 10:27:48 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To:
References:
Message-ID:
On Fri, Aug 9, 2019 at 5:30 PM Dennis Lee Bieber wrote:
>
> On Fri, 9 Aug 2019 15:09:48 -0400, Larry Martell
> declaimed the
> following:
>
> >
> >What am I doing wrong?
>
> Well... Among other things, withholding information...
>
> What is the connection string? And have you TESTED the connection
> string without the overhead of SQLAlchemy?
Yes, I can connect to the DB outside of the flask app. Here is the
connection string:
mssql+pyodbc://user:password at host/DSE_Rep.rep?driver=SQL+Server+Native+Client+10.0
I have never used flask/SQLAlchemy with MS SQL before - could the
DSE_Rep.rep be the issue? How can I specify that hierarchy?
From larry.martell at gmail.com Mon Aug 12 13:18:24 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Mon, 12 Aug 2019 13:18:24 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To: <0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
Message-ID:
On Mon, Aug 12, 2019 at 11:41 AM Dennis Lee Bieber
wrote:
>
> On Mon, 12 Aug 2019 10:27:48 -0400, Larry Martell
> declaimed the
> following:
>
> >Yes, I can connect to the DB outside of the flask app. Here is the
> >connection string:
> >
> >mssql+pyodbc://user:password at host/DSE_Rep.rep?driver=SQL+Server+Native+Client+10.0
> >
>
> That looks nothing like a common connection string. Not even one using
> a DSN (thereby putting the actual connection specification external to the
> string). It looks more like a URL that might be used in a web browser.
>
> I've always seen them as semi-colon separated arguments... cf:
> https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Windows
> https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/step-3-proof-of-concept-connecting-to-sql-using-pyodbc?view=sql-server-2017
> https://www.connectionstrings.com/sql-server/
>
>
> >I have never used flask/SQLAlchemy with MS SQL before - could the
> >DSE_Rep.rep be the issue? How can I specify that hierarchy?
>
> HOWEVER, looking at
> https://docs.sqlalchemy.org/en/13/dialects/mssql.html#module-sqlalchemy.dialects.mssql.pyodbc
> does display something of the nature you show. I'd probably prefer using
> either
> https://docs.sqlalchemy.org/en/13/dialects/mssql.html#pass-through-exact-pyodbc-string
> (though there is a problem in that urllib has changed... one has to import
> urllib.parse explicitly in Python 3.x)
>
> or
> https://docs.sqlalchemy.org/en/13/dialects/mssql.html#dsn-connections
> format
>
> If I interpret it, you are using the form
> https://docs.sqlalchemy.org/en/13/dialects/mssql.html#hostname-connections
> where
> DSE_rep.rep
> is the DATABASE NAME. As I interpret
> https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers?view=sql-server-2017
> embedded periods are not allowed in a bare database name. You would have to
> use a delimited name, which means putting " or [ ] around the name. Don't
> know how SQLAlchemy would handle these variations:
>
> mssql+pyodbc://user:password at host/"DSE_Rep.rep"?driver=SQL+Server+Native+Client+10.0
>
> mssql+pyodbc://user:password at host/[DSE_Rep.rep]?driver=SQL+Server+Native+Client+10.0
>
> (Obviously, if using ", you'll have to use ' for the full string -- I'd
> find that a pain as I instinctively use " for string literals )
>
>
> The reason I'd favor what SQLAlchemy calls "pass through exact..." is
> that this is the exact string you'd use if coding a direct pyodbc
> connection -- or would be the contents defined in a DSN set-up externally.
> And that is what I meant by "can you connect" -- using the exact connection
> string but bypassing SQLAlchemy. The string you are using requires
> SQLAlchemy to parse and format into the end-use connection string --
> meaning two points of potential failure: SQLAlchemy parsing to pyodbc, and
> pyodbc to SQL Server.
I changed it to use the 'pass-through-exact-pyodbc-string' but got the
same error. Then I thought maybe the driver is not installed. So I
followed the instructions here:
https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
and installed it and changed my driver string to ODBC Driver 17 for
SQL Server and now I get:
Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
but it is there:
# ls -l /usr/local/lib/libmsodbcsql.17.dylib
-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
From paradox2005 at gmail.com Mon Aug 12 14:59:24 2019
From: paradox2005 at gmail.com (Adil Hasan)
Date: Mon, 12 Aug 2019 19:59:24 +0100
Subject: [Flask] Connecting to 2 servers
In-Reply-To:
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
Message-ID: <20190812185923.GS21042@parsnip>
Hello,
Perhaps you could try to set the LD_LIBRARY_FLAG environmental variable.
You may already have it set, so you just need to append the path at the
end. If you're using bash:
export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
That I think should allow the application to find the library path.
hth
adil
On Mon, Aug 12, 2019 at 02:13:36PM -0400, Dennis Lee Bieber wrote:
> On Mon, 12 Aug 2019 13:18:24 -0400, Larry Martell
> declaimed the
> following:
>
> >
> >I changed it to use the 'pass-through-exact-pyodbc-string' but got the
> >same error. Then I thought maybe the driver is not installed. So I
> >followed the instructions here:
> >
> >https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
> >
> >and installed it and changed my driver string to ODBC Driver 17 for
> >SQL Server and now I get:
> >
> >Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
> >
> >but it is there:
> >
> ># ls -l /usr/local/lib/libmsodbcsql.17.dylib
> >-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
>
> We're past my level of expertise (in truth, Google was the source for
> everything in my previous post). Best I can come up with might be related
> to
>
> https://linux.die.net/man/8/ldconfig
>
> Does
> ldconfig -p
> list the file? If not... is /usr/local/lib somewhere in /etc/ld.so.conf (or
> any subfiles referenced)? The Debian on Windows seems to have it
> included...
>
> wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf
> include /etc/ld.so.conf.d/*.conf
>
> wulfraed at ElusiveUnicorn:~$ ls /etc/ld.so.conf.d/
> libc.conf x86_64-linux-gnu.conf
> wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf.d/*.conf
> # libc default configuration
> /usr/local/lib
> # Multiarch support
> /lib/x86_64-linux-gnu
> /usr/lib/x86_64-linux-gnu
> wulfraed at ElusiveUnicorn:~$
>
> Even with it (the directory) there, you may need to rebuild cache by
> running ldconfig
>
>
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
From larry.martell at gmail.com Mon Aug 12 15:13:15 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Mon, 12 Aug 2019 15:13:15 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To:
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
Message-ID:
On Mon, Aug 12, 2019 at 2:14 PM Dennis Lee Bieber wrote:
>
> On Mon, 12 Aug 2019 13:18:24 -0400, Larry Martell
> declaimed the
> following:
>
> >
> >I changed it to use the 'pass-through-exact-pyodbc-string' but got the
> >same error. Then I thought maybe the driver is not installed. So I
> >followed the instructions here:
> >
> >https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
> >
> >and installed it and changed my driver string to ODBC Driver 17 for
> >SQL Server and now I get:
> >
> >Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
> >
> >but it is there:
> >
> ># ls -l /usr/local/lib/libmsodbcsql.17.dylib
> >-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
>
> We're past my level of expertise (in truth, Google was the source for
> everything in my previous post). Best I can come up with might be related
> to
>
> https://linux.die.net/man/8/ldconfig
>
> Does
> ldconfig -p
> list the file?
No.
> If not... is /usr/local/lib somewhere in /etc/ld.so.conf (or
> any subfiles referenced)? The Debian on Windows seems to have it
> included...
>
> wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf
> include /etc/ld.so.conf.d/*.conf
>
> wulfraed at ElusiveUnicorn:~$ ls /etc/ld.so.conf.d/
> libc.conf x86_64-linux-gnu.conf
> wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf.d/*.conf
> # libc default configuration
> /usr/local/lib
> # Multiarch support
> /lib/x86_64-linux-gnu
> /usr/lib/x86_64-linux-gnu
> wulfraed at ElusiveUnicorn:~$
>
> Even with it (the directory) there, you may need to rebuild cache by
> running ldconfig
This is Amazon Linux
# ls /etc/ld.so.conf.d/
kernel-4.14.123-86.109.amzn1.x86_64.conf
kernel-4.14.133-88.105.amzn1.x86_64.conf
kernel-4.14.133-88.112.amzn1.x86_64.conf
# cat /etc/ld.so.conf.d/*
# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 0 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg
# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 0 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg
# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 0 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg
If I run ldconfig -v I can see it search in
/lib:
/lib64:
/usr/lib:
/usr/lib64:
I tried symlinking /usr/local/lib/libmsodbcsql.17.dylib to /usr/lib
but it still did not pick it up.
From larry.martell at gmail.com Mon Aug 12 15:53:28 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Mon, 12 Aug 2019 15:53:28 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To: <20190812185923.GS21042@parsnip>
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
<20190812185923.GS21042@parsnip>
Message-ID:
On Mon, Aug 12, 2019 at 3:00 PM Adil Hasan wrote:
>
> Hello,
> Perhaps you could try to set the LD_LIBRARY_FLAG environmental variable.
> You may already have it set, so you just need to append the path at the
> end. If you're using bash:
>
> export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
>
> That I think should allow the application to find the library path.
That also did not work.
> On Mon, Aug 12, 2019 at 02:13:36PM -0400, Dennis Lee Bieber wrote:
> > On Mon, 12 Aug 2019 13:18:24 -0400, Larry Martell
> > declaimed the
> > following:
> >
> > >
> > >I changed it to use the 'pass-through-exact-pyodbc-string' but got the
> > >same error. Then I thought maybe the driver is not installed. So I
> > >followed the instructions here:
> > >
> > >https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
> > >
> > >and installed it and changed my driver string to ODBC Driver 17 for
> > >SQL Server and now I get:
> > >
> > >Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
> > >
> > >but it is there:
> > >
> > ># ls -l /usr/local/lib/libmsodbcsql.17.dylib
> > >-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
> >
> > We're past my level of expertise (in truth, Google was the source for
> > everything in my previous post). Best I can come up with might be related
> > to
> >
> > https://linux.die.net/man/8/ldconfig
> >
> > Does
> > ldconfig -p
> > list the file? If not... is /usr/local/lib somewhere in /etc/ld.so.conf (or
> > any subfiles referenced)? The Debian on Windows seems to have it
> > included...
> >
> > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf
> > include /etc/ld.so.conf.d/*.conf
> >
> > wulfraed at ElusiveUnicorn:~$ ls /etc/ld.so.conf.d/
> > libc.conf x86_64-linux-gnu.conf
> > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf.d/*.conf
> > # libc default configuration
> > /usr/local/lib
> > # Multiarch support
> > /lib/x86_64-linux-gnu
> > /usr/lib/x86_64-linux-gnu
> > wulfraed at ElusiveUnicorn:~$
> >
> > Even with it (the directory) there, you may need to rebuild cache by
> > running ldconfig
> >
> >
> > --
> > Wulfraed Dennis Lee Bieber AF6VN
> > wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
> >
> > _______________________________________________
> > Flask mailing list
> > Flask at python.org
> > https://mail.python.org/mailman/listinfo/flask
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
From paradox2005 at gmail.com Mon Aug 12 16:32:59 2019
From: paradox2005 at gmail.com (Adil Hasan)
Date: Mon, 12 Aug 2019 21:32:59 +0100
Subject: [Flask] Connecting to 2 servers
In-Reply-To:
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
<20190812185923.GS21042@parsnip>
Message-ID: <20190812203258.GT21042@parsnip>
Hello,
oh.
Perhaps this may help:
https://stackoverflow.com/questions/34785653/pyodbc-cant-open-the-driver-even-if-it-exists
Perhaps there are some other libraries missing. If you try to run ldd
against the library it will indicate what is missing?
hth
adil
On Mon, Aug 12, 2019 at 03:53:28PM -0400, Larry Martell wrote:
> On Mon, Aug 12, 2019 at 3:00 PM Adil Hasan wrote:
> >
> > Hello,
> > Perhaps you could try to set the LD_LIBRARY_FLAG environmental variable.
> > You may already have it set, so you just need to append the path at the
> > end. If you're using bash:
> >
> > export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
> >
> > That I think should allow the application to find the library path.
>
> That also did not work.
>
>
> > On Mon, Aug 12, 2019 at 02:13:36PM -0400, Dennis Lee Bieber wrote:
> > > On Mon, 12 Aug 2019 13:18:24 -0400, Larry Martell
> > > declaimed the
> > > following:
> > >
> > > >
> > > >I changed it to use the 'pass-through-exact-pyodbc-string' but got the
> > > >same error. Then I thought maybe the driver is not installed. So I
> > > >followed the instructions here:
> > > >
> > > >https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
> > > >
> > > >and installed it and changed my driver string to ODBC Driver 17 for
> > > >SQL Server and now I get:
> > > >
> > > >Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
> > > >
> > > >but it is there:
> > > >
> > > ># ls -l /usr/local/lib/libmsodbcsql.17.dylib
> > > >-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
> > >
> > > We're past my level of expertise (in truth, Google was the source for
> > > everything in my previous post). Best I can come up with might be related
> > > to
> > >
> > > https://linux.die.net/man/8/ldconfig
> > >
> > > Does
> > > ldconfig -p
> > > list the file? If not... is /usr/local/lib somewhere in /etc/ld.so.conf (or
> > > any subfiles referenced)? The Debian on Windows seems to have it
> > > included...
> > >
> > > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf
> > > include /etc/ld.so.conf.d/*.conf
> > >
> > > wulfraed at ElusiveUnicorn:~$ ls /etc/ld.so.conf.d/
> > > libc.conf x86_64-linux-gnu.conf
> > > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf.d/*.conf
> > > # libc default configuration
> > > /usr/local/lib
> > > # Multiarch support
> > > /lib/x86_64-linux-gnu
> > > /usr/lib/x86_64-linux-gnu
> > > wulfraed at ElusiveUnicorn:~$
> > >
> > > Even with it (the directory) there, you may need to rebuild cache by
> > > running ldconfig
> > >
> > >
> > > --
> > > Wulfraed Dennis Lee Bieber AF6VN
> > > wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
> > >
> > > _______________________________________________
> > > Flask mailing list
> > > Flask at python.org
> > > https://mail.python.org/mailman/listinfo/flask
> > _______________________________________________
> > Flask mailing list
> > Flask at python.org
> > https://mail.python.org/mailman/listinfo/flask
From larry.martell at gmail.com Mon Aug 12 16:53:53 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Mon, 12 Aug 2019 16:53:53 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To: <20190812203258.GT21042@parsnip>
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
<20190812185923.GS21042@parsnip>
<20190812203258.GT21042@parsnip>
Message-ID:
On Mon, Aug 12, 2019 at 4:33 PM Adil Hasan wrote:
>
> Hello,
>
> oh.
>
> Perhaps this may help:
> https://stackoverflow.com/questions/34785653/pyodbc-cant-open-the-driver-even-if-it-exists
Tried solutions mentioned in that post, no joy.
> Perhaps there are some other libraries missing. If you try to run ldd
> against the library it will indicate what is missing?
# ldd /usr/local/lib/libmsodbcsql.17.dylib
not a dynamic executable
>
> hth
> adil
>
> On Mon, Aug 12, 2019 at 03:53:28PM -0400, Larry Martell wrote:
> > On Mon, Aug 12, 2019 at 3:00 PM Adil Hasan wrote:
> > >
> > > Hello,
> > > Perhaps you could try to set the LD_LIBRARY_FLAG environmental variable.
> > > You may already have it set, so you just need to append the path at the
> > > end. If you're using bash:
> > >
> > > export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
> > >
> > > That I think should allow the application to find the library path.
> >
> > That also did not work.
> >
> >
> > > On Mon, Aug 12, 2019 at 02:13:36PM -0400, Dennis Lee Bieber wrote:
> > > > On Mon, 12 Aug 2019 13:18:24 -0400, Larry Martell
> > > > declaimed the
> > > > following:
> > > >
> > > > >
> > > > >I changed it to use the 'pass-through-exact-pyodbc-string' but got the
> > > > >same error. Then I thought maybe the driver is not installed. So I
> > > > >followed the instructions here:
> > > > >
> > > > >https://medium.com/@liamfirth/installing-mssql-odbc-driver-17-1-0-1-on-amazon-web-services-linux-9a8febccfe94
> > > > >
> > > > >and installed it and changed my driver string to ODBC Driver 17 for
> > > > >SQL Server and now I get:
> > > > >
> > > > >Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found
> > > > >
> > > > >but it is there:
> > > > >
> > > > ># ls -l /usr/local/lib/libmsodbcsql.17.dylib
> > > > >-r--r--r-- 1 root root 2539360 Aug 12 17:06 /usr/local/lib/libmsodbcsql.17.dylib
> > > >
> > > > We're past my level of expertise (in truth, Google was the source for
> > > > everything in my previous post). Best I can come up with might be related
> > > > to
> > > >
> > > > https://linux.die.net/man/8/ldconfig
> > > >
> > > > Does
> > > > ldconfig -p
> > > > list the file? If not... is /usr/local/lib somewhere in /etc/ld.so.conf (or
> > > > any subfiles referenced)? The Debian on Windows seems to have it
> > > > included...
> > > >
> > > > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf
> > > > include /etc/ld.so.conf.d/*.conf
> > > >
> > > > wulfraed at ElusiveUnicorn:~$ ls /etc/ld.so.conf.d/
> > > > libc.conf x86_64-linux-gnu.conf
> > > > wulfraed at ElusiveUnicorn:~$ cat /etc/ld.so.conf.d/*.conf
> > > > # libc default configuration
> > > > /usr/local/lib
> > > > # Multiarch support
> > > > /lib/x86_64-linux-gnu
> > > > /usr/lib/x86_64-linux-gnu
> > > > wulfraed at ElusiveUnicorn:~$
> > > >
> > > > Even with it (the directory) there, you may need to rebuild cache by
> > > > running ldconfig
> > > >
> > > >
> > > > --
> > > > Wulfraed Dennis Lee Bieber AF6VN
> > > > wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
> > > >
> > > > _______________________________________________
> > > > Flask mailing list
> > > > Flask at python.org
> > > > https://mail.python.org/mailman/listinfo/flask
> > > _______________________________________________
> > > Flask mailing list
> > > Flask at python.org
> > > https://mail.python.org/mailman/listinfo/flask
From larry.martell at gmail.com Tue Aug 13 07:36:08 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Tue, 13 Aug 2019 07:36:08 -0400
Subject: [Flask] Connecting to 2 servers
In-Reply-To:
References:
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1@4ax.com>
<0ov2letm9b99fdauvhgl3f4q5cduddh2k1-e09XROE/p8c@public.gmane.org>
Message-ID:
On Mon, Aug 12, 2019 at 11:28 PM Dennis Lee Bieber
wrote:
>
> On Mon, 12 Aug 2019 15:13:15 -0400, Larry Martell
> declaimed the
> following:
>
> >If I run ldconfig -v I can see it search in
> >
> >/lib:
> >/lib64:
> >/usr/lib:
> >/usr/lib64:
> >
> >I tried symlinking /usr/local/lib/libmsodbcsql.17.dylib to /usr/lib
> >but it still did not pick it up.
>
> What if you provide /usr/local/lib as an argument to ldconfig
> ?
>
I was finally able to get past this issue by doing this:
sudo yum remove unixODBC
curl http://mirror.centos.org/centos/7/os/x86_64/Packages/unixODBC-2.3.1-11.el7.x86_64.rpm
>/tmp/unixODBC231.rpm
sudo rpm -i /tmp/unixODBC231.rpm
sudo ACCEPT_EULA=Y yum install msodbcsql17
However now my login to the DB is timing out.
From linux4ms at gmail.com Wed Aug 14 08:51:55 2019
From: linux4ms at gmail.com (Ben Duncan)
Date: Wed, 14 Aug 2019 07:51:55 -0500
Subject: [Flask] Explanation, Please ...
Message-ID:
From:
https://jinja.palletsprojects.com/en/master/templates/#whitespace-control
Comes the words of wisdom:
The following example implements a sitemap with recursive loops:
{%- for *item* in *sitemap* recursive %}
- {{ item.title }}
{%- if item.children -%}
{%- endif %}
{%- endfor %}
What data type is sitemap in the for loop?
and what is the 'item' data type and what does it contain ?
(Possible sample ?)
Thanks ...
*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From linux4ms at gmail.com Wed Aug 14 13:41:35 2019
From: linux4ms at gmail.com (Ben Duncan)
Date: Wed, 14 Aug 2019 12:41:35 -0500
Subject: [Flask] Which to use for DB ?
Message-ID:
Ok from:
https://flask.palletsprojects.com/en/1.1.x/patterns/sqlalchemy/
I understand the SQLAlchemy part, unsure of the flask_sqlalchemy
Which should I use?
Standard SQLAlchemy or the Flask_Sqlaclchemy ?
I'm having trouble with predefined and in-use database , why I'm asking ...
Thanks ....
*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From yuxuan.dong at outlook.com Wed Aug 14 14:30:10 2019
From: yuxuan.dong at outlook.com (Yuxuan Dong)
Date: Wed, 14 Aug 2019 18:30:10 +0000
Subject: [Flask] Which to use for DB ?
In-Reply-To:
References:
Message-ID:
I think there is not a standard answer for all projects. Flask-SQLAlchemy is using scoped_seasion, which is very convient but not very flexible. You can also use context manager to build your own session manager. I took a note about these two usage, may be helpful: http://yxdong.me/posts/sqlalchemy-session-usage-patterns-in-web-applications.html
?? Outlook for iOS
________________________________
???: Flask ?? Ben Duncan
????: Thursday, August 15, 2019 1:41:35 AM
???: Flask User Groups
??: [Flask] Which to use for DB ?
Ok from:
https://flask.palletsprojects.com/en/1.1.x/patterns/sqlalchemy/
I understand the SQLAlchemy part, unsure of the flask_sqlalchemy
Which should I use?
Standard SQLAlchemy or the Flask_Sqlaclchemy ?
I'm having trouble with predefined and in-use database , why I'm asking ...
Thanks ....
Ben Duncan
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From linux4ms at gmail.com Mon Aug 19 09:25:29 2019
From: linux4ms at gmail.com (Ben Duncan)
Date: Mon, 19 Aug 2019 08:25:29 -0500
Subject: [Flask] flask-SqlAlchemy question
Message-ID:
Ok, i'm trying to use the flask-sqlalchmey
I am trying to load a single table without having to do a reflect:
Code:
pgdb = SQLAlchemy(app)
# Get our Company Stuff
pgdb.Model.metadata.reflect(pgdb.engine)
class comp_table(pgdb.Model):
__table__ = pgdb.Model.metadata.tables['company']
#
I'd rather do something like:
comp_table = pgdb.Model.metadata.tables['company']
rather the load everything thru reflect
Is there a way to do this ?
Thanks
*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From larry.martell at gmail.com Wed Aug 21 13:49:34 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Wed, 21 Aug 2019 13:49:34 -0400
Subject: [Flask] Getting 404 on one endpoint on one system
Message-ID:
I have a flask app deployed on 2 systems. On one system all endpoints
work. On the other 1 endpoint gives a 404 (all the others work). I
have verified that the code is identical on both systems. Anyone have
any thoughts on what could be going on or how I can debug this?
From yuxuan.dong at outlook.com Wed Aug 21 13:58:53 2019
From: yuxuan.dong at outlook.com (Yu-Xuan Dong)
Date: Wed, 21 Aug 2019 17:58:53 +0000
Subject: [Flask] Getting 404 on one endpoint on one system
In-Reply-To:
References:
Message-ID:
It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
YX. D.
________________________________
???: Flask ?? Larry Martell
????: Thursday, August 22, 2019 1:49:34 AM
???: flask at python.org
??: [Flask] Getting 404 on one endpoint on one system
I have a flask app deployed on 2 systems. On one system all endpoints
work. On the other 1 endpoint gives a 404 (all the others work). I
have verified that the code is identical on both systems. Anyone have
any thoughts on what could be going on or how I can debug this?
_______________________________________________
Flask mailing list
Flask at python.org
https://mail.python.org/mailman/listinfo/flask
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From larry.martell at gmail.com Wed Aug 21 14:03:11 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Wed, 21 Aug 2019 14:03:11 -0400
Subject: [Flask] Getting 404 on one endpoint on one system
In-Reply-To:
References:
Message-ID:
On Wed, Aug 21, 2019 at 1:58 PM Yu-Xuan Dong wrote:
>
> It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
mod_wsgi-express but I get the same results running from the command line.
>
> YX. D.
> ________________________________
> ???: Flask ?? Larry Martell
> ????: Thursday, August 22, 2019 1:49:34 AM
> ???: flask at python.org
> ??: [Flask] Getting 404 on one endpoint on one system
>
> I have a flask app deployed on 2 systems. On one system all endpoints
> work. On the other 1 endpoint gives a 404 (all the others work). I
> have verified that the code is identical on both systems. Anyone have
> any thoughts on what could be going on or how I can debug this?
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
From yuxuan.dong at outlook.com Thu Aug 22 00:17:53 2019
From: yuxuan.dong at outlook.com (Yu-Xuan Dong)
Date: Thu, 22 Aug 2019 04:17:53 +0000
Subject: [Flask] Getting 404 on one endpoint on one system
In-Reply-To:
References:
,
Message-ID:
You mean it has the same issue even you use the dev server of Flask?
1. Do Python/Flask on two system have the same version?
2. Could you provide your definition code of the endpoint?
YX. D.
________________________________
???: Larry Martell
????: Thursday, August 22, 2019 2:03:11 AM
???: Yu-Xuan Dong
??: flask at python.org
??: Re: [Flask] Getting 404 on one endpoint on one system
On Wed, Aug 21, 2019 at 1:58 PM Yu-Xuan Dong wrote:
>
> It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
mod_wsgi-express but I get the same results running from the command line.
>
> YX. D.
> ________________________________
> ???: Flask ?? Larry Martell
> ????: Thursday, August 22, 2019 1:49:34 AM
> ???: flask at python.org
> ??: [Flask] Getting 404 on one endpoint on one system
>
> I have a flask app deployed on 2 systems. On one system all endpoints
> work. On the other 1 endpoint gives a 404 (all the others work). I
> have verified that the code is identical on both systems. Anyone have
> any thoughts on what could be going on or how I can debug this?
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From adamenglander at yahoo.com Thu Aug 22 09:24:55 2019
From: adamenglander at yahoo.com (Adam Englander)
Date: Thu, 22 Aug 2019 06:24:55 -0700
Subject: [Flask] Getting 404 on one endpoint on one system
Message-ID: <028CDB26-9835-4732-806C-8DB4EE93CABB@yahoo.com>
Do you have code that looks up an entity and returns a 404 if not found? That tends to be how I get that difference in two environments.
Adam Englander
> On Aug 21, 2019, at 9:17 PM, flask-request at python.org wrote:
>
> Send Flask mailing list submissions to
> flask at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/flask
> or, via email, send a message with subject or body 'help' to
> flask-request at python.org
>
> You can reach the person managing the list at
> flask-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Flask digest..."
>
>
> Today's Topics:
>
> 1. Getting 404 on one endpoint on one system (Larry Martell)
> 2. Re: Getting 404 on one endpoint on one system (Yu-Xuan Dong)
> 3. Re: Getting 404 on one endpoint on one system (Larry Martell)
> 4. Re: Getting 404 on one endpoint on one system (Yu-Xuan Dong)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 21 Aug 2019 13:49:34 -0400
> From: Larry Martell
> To: flask at python.org
> Subject: [Flask] Getting 404 on one endpoint on one system
> Message-ID:
>
> Content-Type: text/plain; charset="UTF-8"
>
> I have a flask app deployed on 2 systems. On one system all endpoints
> work. On the other 1 endpoint gives a 404 (all the others work). I
> have verified that the code is identical on both systems. Anyone have
> any thoughts on what could be going on or how I can debug this?
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 21 Aug 2019 17:58:53 +0000
> From: Yu-Xuan Dong
> To: Larry Martell , "flask at python.org"
>
> Subject: Re: [Flask] Getting 404 on one endpoint on one system
> Message-ID:
>
>
> Content-Type: text/plain; charset="gb2312"
>
> It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
>
> YX. D.
> ________________________________
> ???: Flask ?? Larry Martell
> ????: Thursday, August 22, 2019 1:49:34 AM
> ???: flask at python.org
> ??: [Flask] Getting 404 on one endpoint on one system
>
> I have a flask app deployed on 2 systems. On one system all endpoints
> work. On the other 1 endpoint gives a 404 (all the others work). I
> have verified that the code is identical on both systems. Anyone have
> any thoughts on what could be going on or how I can debug this?
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
> ------------------------------
>
> Message: 3
> Date: Wed, 21 Aug 2019 14:03:11 -0400
> From: Larry Martell
> To: Yu-Xuan Dong
> Cc: "flask at python.org"
> Subject: Re: [Flask] Getting 404 on one endpoint on one system
> Message-ID:
>
> Content-Type: text/plain; charset="UTF-8"
>
>> On Wed, Aug 21, 2019 at 1:58 PM Yu-Xuan Dong wrote:
>>
>> It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
>
> mod_wsgi-express but I get the same results running from the command line.
>
>>
>> YX. D.
>> ________________________________
>> ???: Flask ?? Larry Martell
>> ????: Thursday, August 22, 2019 1:49:34 AM
>> ???: flask at python.org
>> ??: [Flask] Getting 404 on one endpoint on one system
>>
>> I have a flask app deployed on 2 systems. On one system all endpoints
>> work. On the other 1 endpoint gives a 404 (all the others work). I
>> have verified that the code is identical on both systems. Anyone have
>> any thoughts on what could be going on or how I can debug this?
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 22 Aug 2019 04:17:53 +0000
> From: Yu-Xuan Dong
> To: Larry Martell
> Cc: "flask at python.org"
> Subject: Re: [Flask] Getting 404 on one endpoint on one system
> Message-ID:
>
>
> Content-Type: text/plain; charset="gb2312"
>
> You mean it has the same issue even you use the dev server of Flask?
>
> 1. Do Python/Flask on two system have the same version?
>
> 2. Could you provide your definition code of the endpoint?
>
> YX. D.
> ________________________________
> ???: Larry Martell
> ????: Thursday, August 22, 2019 2:03:11 AM
> ???: Yu-Xuan Dong
> ??: flask at python.org
> ??: Re: [Flask] Getting 404 on one endpoint on one system
>
>> On Wed, Aug 21, 2019 at 1:58 PM Yu-Xuan Dong wrote:
>>
>> It may be caused by your HTTP server config. What HTTP server are you using and how do you canfigure it?
>
> mod_wsgi-express but I get the same results running from the command line.
>
>>
>> YX. D.
>> ________________________________
>> ???: Flask ?? Larry Martell
>> ????: Thursday, August 22, 2019 1:49:34 AM
>> ???: flask at python.org
>> ??: [Flask] Getting 404 on one endpoint on one system
>>
>> I have a flask app deployed on 2 systems. On one system all endpoints
>> work. On the other 1 endpoint gives a 404 (all the others work). I
>> have verified that the code is identical on both systems. Anyone have
>> any thoughts on what could be going on or how I can debug this?
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
>
> ------------------------------
>
> End of Flask Digest, Vol 50, Issue 16
> *************************************
From larry.martell at gmail.com Thu Aug 22 11:11:32 2019
From: larry.martell at gmail.com (Larry Martell)
Date: Thu, 22 Aug 2019 11:11:32 -0400
Subject: [Flask] Getting 404 on one endpoint on one system
In-Reply-To: <028CDB26-9835-4732-806C-8DB4EE93CABB@yahoo.com>
References: <028CDB26-9835-4732-806C-8DB4EE93CABB@yahoo.com>
Message-ID:
On Thu, Aug 22, 2019 at 9:25 AM Adam Englander via Flask
wrote:
>
> Do you have code that looks up an entity and returns a 404 if not found? That tends to be how I get that difference in two environments.
Indeed that is exactly what was happening. I did not write the code so
I did not realize that was the case. I discovered that late yesterday.
> > Date: Wed, 21 Aug 2019 13:49:34 -0400
> > From: Larry Martell
> > To: flask at python.org
> > Subject: [Flask] Getting 404 on one endpoint on one system
> > Message-ID:
> >
> > Content-Type: text/plain; charset="UTF-8"
> >
> > I have a flask app deployed on 2 systems. On one system all endpoints
> > work. On the other 1 endpoint gives a 404 (all the others work). I
> > have verified that the code is identical on both systems. Anyone have
> > any thoughts on what could be going on or how I can debug this?
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Wed, 21 Aug 2019 17:58:53 +0000
> > From: Yu-Xuan Dong