Re: i just moved from bottleframework to flask. I changes what needed to be altered to convert the code and when i run it i just get "Internal server error" Running tail -f ../logs/error_log i get no

2021-07-08 Thread Νίκος Βέργος
No, the way i have installed flask was under root account with the command pip3 install flask. But even if i installed flask under my nikos user account its evene worse as the file flask is not entered into PATH. So i guess as root i have to install flask, but then why cant it import 'run" ?

Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
You will see if you create a route endpoint called 'mailform' within '/' which is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' when the latter tries to post data to '/mailform' instead of sending them to 'superhost.gr/test/' it sends them to '/' which is

Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
Τη Σάββατο, 7 Μαρτίου 2020 - 9:00:41 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε: > On 7/03/20 2:33 AM, îØî-îºî¿ïé îÆî ïüî³î¿ïé wrote: > > First i must say i use Bottle, but the same may also be the case in Flask > too. I ask here and not in sub Bottle because there are only a few people > there and i

Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
î¤î· î£î¬î²î²î±ïäî¿, 7 î£î±ïüïäî-î¿ïà 2020 - 12:34:21 ï .î¼. UTC+2, î¿ ïçïüîRïâïäî·ïé DL Neil î î³ïüî±ïêîµ: > Please post the full error message and traceback. > > To clarify: is the error coming from Python or from the web server? I beleive it comes from the web server. Here it is: Error: 500

Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
You will see if you create a route endpoint called 'mailform' within '/' which is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' when the latter tries to post data to '/mailform' instead of sending them to 'superhost.gr/test/' it sends them to '/' which is

Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
Τη Σάββατο, 7 Μαρτίου 2020 - 12:34:21 π.μ. UTC+2, ο χρήστης DL Neil έγραψε: > Please post the full error message and traceback. > > To clarify: is the error coming from Python or from the web server? I beleive it comes from the web server. Here it is: Error: 500 Internal Server Error Sorry,

How to POST html data to be handled by a route endpoint

2020-03-06 Thread Νίκος Βέργος
First i must say i use Bottle, but the same may also be the case in Flask too. I ask here and not in sub Bottle because there are only a few people there and i receive no responses. Actualy since i started here let me say what i have found. Iam just trying to post html form data to the

How to POST html data to be handled by a route endpoint

2020-03-06 Thread Νίκος Βέργος
First i must say i use Bottle, but the same may also be the case in Flask too. I ask here and not in sub Bottle because there are only a few people there and i receive no responses. Actualy since i started here let me say what i have found. Iam just trying to post html form data to the

WHY it compains about the missing argument is WHAT i don't understand

2019-10-08 Thread Νίκος Βέργος
plugin = bottle_pymysql.Plugin( dbuser='user', dbpass='pass', dbname='counters', dictrows=False ) app.install(plugin) ... ... @app.route( '/' ) @auth_basic( counters.is_authenticated_user ) def listall( pymydb ): But when i try to load the app's URL like http://superhost.gr/clientele

Re: pymysql.err.InterfaceError after some hours of usage

2019-10-02 Thread Νίκος Βέργος
Τη Τετάρτη, 2 Οκτωβρίου 2019 - 7:11:52 μ.μ. UTC+3, ο χρήστης Inada Naoki έγραψε: > 2019年10月3日(木) 0:56 Νίκος Βέργος : > > > Τη Τετάρτη, 2 Οκτωβρίου 2019 - 8:26:38 π.μ. UTC+3, ο χρήστης Inada Naoki > > έγραψε: > > > MySQL connection can be closed automatically by various

Re: pymysql.err.InterfaceError after some hours of usage

2019-10-02 Thread Νίκος Βέργος
Τη Τετάρτη, 2 Οκτωβρίου 2019 - 8:26:38 π.μ. UTC+3, ο χρήστης Inada Naoki έγραψε: > MySQL connection can be closed automatically by various reasons. > For example, `wait_timeout` is the most common but not only reason for > closing the connection. > > You should connect and close MySQL connection

pymysql.err.InterfaceError after some hours of usage

2019-10-01 Thread Νίκος Βέργος
Hello, i use 'module pymysql' for connectivity in my wsgi scripts. For some reason after some hours of i.e. 'http://superhost.gr/files' i get the following error when the script tries to run: Do you know why this is happening?! Error: 500 Internal Server Error Sorry, the requested URL

Re: Convert a list with wrong encoding to utf8

2019-02-14 Thread Νίκος Βέργος
con = pymysql.connect( db = 'clientele', user = 'vergos', passwd = '***', charset = 'utf8' ) cur = con.cursor() Στις Πέμ, 14 Φεβ 2019 στις 9:13 μ.μ., ο/η Igor Korot έγραψε: > Hi, > > On Thu, Feb 14, 2019 at 1:10 PM wrote: > > > > Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Νίκος Βέργος
Thank you very much Johann. i was using print(update wuery here) and i was seeing that print was able to parser the query and that consused me as to why execute wont do the same since with print all values was gettign substituted. of course pymysql doesnt behave the same with print but until i

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 6:00:34 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Its NOT that i have not read it exactly, but for some strange reason i was > > under the belief that the wa

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 5:43:01 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος <me.on@gmail.com> wrote: > >> MariaDB / MySQL shows part of your SQL from where they failed to parse. > >> In your case, yo

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 2:27:31 π.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > > i dont have to update table set column1 = this value, column2=that value and > > so on > > Why do you think so? Did you really read the manual? > > mysql> create table test_update (a int primary key, b int, c

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 11:59:21 μ.μ. UTC+3, ο χρήστης Larry Hudson έγραψε: > On 03/26/2017 01:21 AM, Νίκος Βέργος wrote: > > print('''UPDATE visitors SET (pagesID, host, ref, location, useros, > > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE &g

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 11:05:34 μ.μ. UTC+3, ο χρήστης Νίκος Βέργος έγραψε: > Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: > > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > > > Since i'm inc

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Since i'm incopetent as you suggest i'am show us your level of skills and > > expertise and provide a so

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης bream...@gmail.com έγραψε: > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > > > The database wrapp

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:04:31 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 5:52 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico > > έγραψε: > >> On Mon,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:58:55 μ.μ. UTC+3, ο χρήστης alister έγραψε: > On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister > > έγραψε: > >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέ

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki > > έγραψε: > >> Read my mail

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > Read my mail again. > > > This error came from MySQL. If there are no logs in error_log, it's > > your configuration issue. > > > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > > statement

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
I do not see why my UPDATE fails. cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s)''') works i dont have to update table set column1 = this value, column2=that value and so on It's just when the LIKE clause jumps in

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Any ideas on how to make progress on that? After all its just an UPDATE with a WHERE clause?! Do you also think is DBI related issue? -- https://mail.python.org/mailman/listinfo/python-list

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Currently to avoid any misinformations my code looks as follows: domain = '.'.join( host.split('.')[-2:] ) domain_query = '%%%s' % domain cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE %s''', (pID,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano έγραψε: > On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: > > > I just tried: > > > > domain = '.'.join( host.split('.')[-2:] ) > > domain = '%' + domain + '%' > > > > cur.exe

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:28:12 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > >> The database

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
domain = '.'.join( host.split('.')[-2:] ) domain = '%' + domain + '%' domain = '%%%s%%' % domain domain = '%{}%'.format(domain) cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s" ''',

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > The database wrapper won't do substitution into the middle of a string > like that. Either concatenate the literal %'s on in the SQL statement > or add them to the string before you pass it in, i.e. '%' + domain + > '%' or

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
t;>> '%%%s%%' % (42,) > '%42%' > > On Sun, Mar 26, 2017 at 11:35 PM, Νίκος Βέργος <me.on@gmail.com> > wrote: > > i have tried that 2 days ago. > > > > Problem is that you maintained space before and after '%s' which wont > work > > within like >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
i have tried that 2 days ago. Problem is that you maintained space before and after '%s' which wont work within like How would you type it without space as in "%%s%" ? Στις Κυρ, 26 Μαρ 2017 στις 5:32 μ.μ., ο/η INADA Naoki < songofaca...@gmail.com> έγραψε: > > I MEAN HOW TO DIFFERENTIATE '%S'

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister έγραψε: > On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > >> You need to change the placeholders ba

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > You need to change the placeholders back. The poster who told you to > replace them was misinformed. okey altered them back to cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits)

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:04:27 μ.μ. UTC+3, ο χρήστης INADA Naoki This error came from MySQL. If there are no logs in error_log, it's > your configuration issue. > > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > statement syntax. cur.execute('''UPDATE visitors SET

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES ({}, {}, {}, {}, {}, {}, {}) WHERE host LIKE "{}"'''.format(pID, domain, ref, location, useros, browser, lastvisit, domain) ) Same kind of output in the error-log even with this attempt. --

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε: > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > > with import cgitb; cgitb.enable() > > > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε: > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > > with import cgitb; cgitb.enable() > > > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Ths is the whole snippert i'am trying so you can see what i'm tryong to do. [code] # if bot is contained in hostname update all previous database bot hostname entries with current bot hostname for bot in bots: if bot in host:

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
with import cgitb; cgitb.enable() ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(pagesID, host, ref, location, useros, browser, visits) VALUES (1, 'cyta.gr', '' at line 1") that

Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref, location, useros, browser, lastvisit, domain) ) prints out: UPDATE visitors SET (pagesID, host, ref, location, useros, browser,

Downloading and Sending the file to the client's browser

2017-02-02 Thread Νίκος Βέργος
== # Give user the file requested url = "http://superhost.gr/data/files/%s; % realfile response = requests.get( url, stream=True ) with open( realfile, 'wb' ) as f: f.write( response.content ) == The above code will

Re: Python3 using requests to grab HTTP Auth Data

2017-02-02 Thread Νίκος Βέργος
Τη Πέμπτη, 2 Φεβρουαρίου 2017 - 9:38:47 μ.μ. UTC+2, ο χρήστης Ian έγραψε: > If you want the user to authenticate to your script and not just > whatever file you're redirecting them to, then you need to configure > the server to require authorization for the script and not just the > redirect

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
# Give user the file requested print('''http://superhost.gr/data/files/%s;>''' % realfile) authuser = os.environ.get( 'REMOTE_USER', 'Άγνωστος' ) print( authuser ) Trying this, feels liek i'm almost there except

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Πέμπτη, 2 Φεβρουαρίου 2017 - 1:51:52 π.μ. UTC+2, ο χρήστης Ian έγραψε: > On Wed, Feb 1, 2017 at 2:51 PM, Νίκος Βέργος <me.on@gmail.com> wrote: > > Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 11:41:28 μ.μ. UTC+2, ο χρήστης Michael > > Torrie έγραψε: > >> On 02/01/201

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 11:41:28 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 02/01/2017 01:51 PM, Νίκος Βέργος wrote: > > as well as input() for both user & pass combo but iam not getting in chrome > > the basic pop-up HTTP auth window. > > > >

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 9:22:46 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > You should use the input() function (called raw_input() in Python 2) > for a user name, and the getpass module for the password: I have just tried === # Give user the file

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 9:22:46 μ.μ. UTC+2, ο χρήστης Chris > You should use the input() function (called raw_input() in Python 2) > for a user name, and the getpass module for the password: i have just tried: # Give user the file requested url =

Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
# Give user the file requested url = "http://superhost.gr/data/files/%s; % realfile user, password = 'user', 'passwd' r = requests.get( url, auth = (user, password) ) # send auth unconditionally r.raise_for_status() == How can i ASK the user for http auth data and