last day (61 days later) » 

6:10 AM
@tabassum hi
What problem
 
hi
@VigneshKalai
 
How are you
 
i want to store data in database in my project .....so first i need simple demo to run...like in page i have two textfield and one submit button..when i click on submit button...2 textfield data stored in database ...so how can i do that
i hope u understand
f9 wbu???
 
Yeah fine
As of now are you able to get the two fields when you hit submit
 
no i dont get
@Dannehkown hiii
 
6:16 AM
You created the page using flask right
 
yup
wait i saw u demo page
in that i craeate author nd book...when i click login the data should be store in database
how can i do that
 
How come it is saying invalid username
You are geting the user name and checking it right
 
because username nd password should be same
 
It is saying welcome the usename
how are you getting the username
Welcome, sad!
 
that is not the issue
 
6:23 AM
How are you getting it
 
wait
 
Like wise you can get both Author and book right
 
ya it display a msg
on using flash message
it not stored in database
 
What is your data base
MSQL or TSQL or SQllite
etc..
 
SQllite
 
6:26 AM
So have you created a table
in sqllite
 
nope
u have any example
 
import sqlite3

conn = sqlite3.connect('test.db')

print "Opened database successfully";
This creates the connection and create a local test.db file
conn.execute('''CREATE TABLE AUTHOR
       (USERNAME TEXT     NOT NULL,
       AUTHOR TEXT    NOT NULL,
       BOOK TEXT     NOT NULL);''')
To create a a table author with three columns username,author,book
 
see my code
now tell me where i add this
thing
main.py
file
 
wait making
 
oki np
 
6:35 AM
	@app.route('/')
	def welcome():

		conn = sqlite3.connect('test.db')
		conn.execute('''CREATE TABLE AUTHOR(USERNAME TEXT     NOT NULL, AUTHOR TEXT    NOT NULL, BOOK TEXT     NOT NULL);''')
		query="INSERT INTO COMPANY (USERNAME,AUTHOR,BOOK) VALUES ({},{},{})".format(session['username'],session['author'],session['book'])
		   conn.execute("INSERT INTO COMPANY (D,NAME,AGE,ADDRESS,SALARY) \
			  VALUES (1, 'Paul', 32, 'California', 20000.00 )");
		if 'username' in session:
			return render_template('welcome.html', username=session['username'])
Try this
 
okie wait
 
Change this
@app.route('/login', methods=['POST', 'GET'])
def login():
    error = None
    if request.method == 'POST':
        if valid_login(request.form.get('username'),
                        request.form.get('password')):
            flash("Succesfully logged in")
            session['username'] = request.form.get('username')
		session['author'] = request.form.get('author')
		session['book'] = request.form.get('book')
            return redirect(url_for('welcome'))
        else:
            error = "Incorrect username and password"
 
above one also
 
Any unity developer here?
 
@Dannehkown no one as of now.
 
6:42 AM
Ohh i see.
 
Change both and run
 
okie
not working
i dont know why
 
What error did it throw
 
File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 948, in load_module

raise ImportError('No module named %s' % fullname)

ImportError: No module named _sqlite3

INFO 2015-11-26 22:50:58,973 module.py:794] default: "GET / HTTP/1.1" 500 -
 
pip instal sqllite module
you have install the module first :p
pip instal sqllite module
 
6:56 AM
i already install
 
Oh did you add import sqlite3 in the first line
 
yup
 
could you share the code after alteration
 
where are you running this
Could you show the full trace back
 
7:05 AM
localhost
 
try typing this in your local host
import sqllite3
 
Anyone here with experience in machine learning techniques?
 
@user1675395 no one as of now mate
 
see this
 
what did import sqllite3 do
in python
what is your OS
 
7:17 AM
windows
7
 
so what version of pyhton
what did import sqllite3 do
 
python 2.7
 
so sqlilte is preinstalled
try importing it and see
in python
 
oki wait
i give u project try to run on u r pc
check it should
run or nor
not
 
I don'tknow how to run it and check
 
7:29 AM
okie
let me try
now break tym
 
Hey, what's going on here?
:-)
 
nothing tp
:P
 
Hey guys... just liked the subject of the group :)
 
@AvinashRaj chumma
 
7:38 AM
chumma chumma pesi, chumma chumma palagi ...
@VigneshKalai You know Flask well?
 
ella ji liteha than
@AvinashRaj
@tabassum what nothing
 
error
@VigneshKalai
 
Could you show the full error
And not an image it not showing all
@user1977867 thanks :)
 
@tabassum type print session to see what is there in session
 
7:54 AM
oki
 
anyone knows how to work with windows task scheduler ?
 
 
1 hour later…
9:21 AM
@tabassum what happend
 
trying
define session globaly
 
what did it print
 
nothing
 
so there is nothing in session so it is throwing error
@app.route('/login', methods=['POST', 'GET'])
def login():
    if request.method == 'POST':
        if valid_login(request.form.get('username'), request.form.get('password')):
            flash("Succesfully logged in")
            session['username'] = request.form.get('username')
            session['author'] = request.form.get('author')
            session['book'] = request.form.get('book')
            return redirect(url_for('welcome'))
is your route like this
 
yes
 
9:28 AM
So did you try running it again
how can I run this in my computer
what will the url be
 
wait i m trying
using cmd u can run
just go to that directory
and type command
python filename.py
it will run on localhost:5000
 
The python program stops after running it.
 
yes
 
No it does not show anything in the URL
 
okie np let me try
 
9:55 AM
"""`main` is the top level module for your Flask application."""
import sqlite3
import os
from flask import Flask, request, render_template, redirect, url_for, flash, session
import logging
from logging.handlers import RotatingFileHandler
conn = sqlite3.connect('test.db')
app = Flask(__name__)
app.secret_key = '\xd1M<n)\xf1\xf9\x08\xe2z\x8ai\x99\xf8\xb8\xf0\xe9\x06\x95"0\x9d\xd2\xf9'

usename=""
author=""
book=""
@app.route('/login', methods=['POST', 'GET'])
def login():
    global usename
    global author
try this @tabassum
 
okie wait
 
@tabassum what happend
 
nope not working
 
What error
 
i m refering this document
sqlite3.OperationalError

OperationalError: table AUTHOR1 already exists
Traceback (most recent call last)

File "C:\Python27\lib\site-packages\flask\app.py", line 1836, in __call__

return self.wsgi_app(environ, start_response)

File "C:\Python27\lib\site-packages\flask\app.py", line 1820, in wsgi_app

response = self.make_response(self.handle_exception(e))

File "C:\Python27\lib\site-packages\flask\app.py", line 1403, in handle_exception

reraise(exc_type, exc_value, tb)

File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
error
 
10:04 AM
okay remove that create query then run it
@tabassum what happend now
"""`main` is the top level module for your Flask application."""
import sqlite3
import os
from flask import Flask, request, render_template, redirect, url_for, flash, session
import logging
from logging.handlers import RotatingFileHandler
conn = sqlite3.connect('test.db')
app = Flask(__name__)
app.secret_key = '\xd1M<n)\xf1\xf9\x08\xe2z\x8ai\x99\xf8\xb8\xf0\xe9\x06\x95"0\x9d\xd2\xf9'

usename=""
author=""
book=""
@app.route('/login', methods=['POST', 'GET'])
def login():
    global usename
    global author
Change it run this @tabassum
 
okie
this will work
but how should i see data now
@VigneshKalai
 
10:22 AM
Type conn.execute("select * from author")
 
where
??/
@VigneshKalai
 
It shows all sqllite python query
It is usefull for you
 
okie
 
You have to see it through python console
 
i check it
 
10:27 AM
cursor = conn.execute("SELECT * FROM AUTHOR")
for row in cursor:
       print row
This will work
 
not working
error is also not there
 
10:57 AM
So there is no value there
@tabassum oppen the test.db
So there is no value there
try adding conn.commit after the insert statement in our main code run it again and check the sqllite db
 
in test.db
is not readable file
 
open with notepad ++
the problem is we did not add a commit statement
 
i added
 
"""`main` is the top level module for your Flask application."""
import sqlite3
import os
from flask import Flask, request, render_template, redirect, url_for, flash, session
import logging
from logging.handlers import RotatingFileHandler
conn = sqlite3.connect('test.db')
app = Flask(__name__)
app.secret_key = '\xd1M<n)\xf1\xf9\x08\xe2z\x8ai\x99\xf8\xb8\xf0\xe9\x06\x95"0\x9d\xd2\xf9'

usename=""
author=""
book=""
@app.route('/login', methods=['POST', 'GET'])
def login():
    global usename
    global author
 
in notepad++ is also not redable
 
11:03 AM
Try running this
First and after that we could check the test.db
 
same thing
i already do it
 
now then run this
cursor = conn.execute("SELECT * FROM AUTHOR")
for row in cursor:
       print row
 
i already do it
 
If output is not available can you mail this test.db
 
emailid
 
11:09 AM
vignesh.vigneshdece@gmail.com
 
wait
 
hey
any one who knows somthing about image processing in c#?
 
@Slashy none at the moment mate
 
damn
:)
 
you may want to look at the c# room
 
11:15 AM
yeah im also there
it's too quiet tho
 
All the well developed rooms are quite :P
@tabassum did you sent it
 
@VigneshKalai it's not actually pure image proceesing idea
if you leanred network programing it could help me too :)
 
@Slashy I am more a python person If you want you can post it here someone may know and will try to help
 
11:42 AM
@VigneshKalai net prblm
i cant send now
 
 
1 hour later…
12:47 PM
@tabassum ok
 
thanx for help :)
@VigneshKalai
 
@tabassum it worked ?
 

  last day (61 days later) »