Jump to content

Search the Community

Showing results for tags 'psycopg2'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • Website Management and Coding
    • Technology and the Internet
    • Philosophy, Politics, and Science
    • Art and Entertainment
    • Other Discussion
  • HelioHost
    • Questions
    • Customer Service
    • How You Can Help
  • HelioNet
    • News
    • Contact HelioNet

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. Hi I would like you to install the psycopg2 module. postgresql wont work without it. thanks in anticipation.
  2. Hi I have a flask application that runs perfectly when passing a json package, and returns the same package to the client with no problems but when importing psycopg2 the json package returned is "None" and client complain about the parsing something that is not a json package. Working Code using json library: #!/usr/bin/env pythonimport sys#import psycopg2import jsonfrom flask import Flask,request,jsonify, __version__app = Flask(__name__)application = app @app.route("/")def hello(): return """ HelioHost rules!<br><br> <a href="/flask/python/version/">Python version</a><br> <a href="/flask/flask/version/">Flask version</a> """ @app.route("/python/version/")def p_version(): return "Python version %s" % sys.version @app.route("/flask/version/")def f_version(): return "Flask version %s" % __version__ @app.route("/mother")def mother(): return "Hello world mother" @app.route("/jsonp",methods=['POST'])def jsonp(): webdatajson = request.get_json() # get json package #datajson = jsonify(webdatajson) #make a json package to send back datajson = json.dumps(webdatajson) #makes a json package to send back return(datajson) if __name__ == "__main__": app.run() Another working code using jsonify from flask: #!/usr/bin/env pythonimport sys#import psycopg2import jsonfrom flask import Flask,request,jsonify, __version__app = Flask(__name__)application = app @app.route("/")def hello(): return """ HelioHost rules!<br><br> <a href="/flask/python/version/">Python version</a><br> <a href="/flask/flask/version/">Flask version</a> """ @app.route("/python/version/")def p_version(): return "Python version %s" % sys.version @app.route("/flask/version/")def f_version(): return "Flask version %s" % __version__ @app.route("/mother")def mother(): return "Hello world mother" @app.route("/jsonp",methods=['POST'])def jsonp(): webdatajson = request.get_json() # get json package datajson = jsonify(webdatajson) #make a json package to send back #datajson = json.dumps(webdatajson) #makes a json package to send back return(datajson) if __name__ == "__main__": app.run() NOT WORKING CODE once importing psycopg2: #!/usr/bin/env pythonimport sysimport psycopg2import jsonfrom flask import Flask,request,jsonify, __version__app = Flask(__name__)application = app @app.route("/")def hello(): return """ HelioHost rules!<br><br> <a href="/flask/python/version/">Python version</a><br> <a href="/flask/flask/version/">Flask version</a> """ @app.route("/python/version/")def p_version(): return "Python version %s" % sys.version @app.route("/flask/version/")def f_version(): return "Flask version %s" % __version__ @app.route("/mother")def mother(): return "Hello world mother" @app.route("/jsonp",methods=['POST'])def jsonp(): webdatajson = request.get_json() # get json package #datajson = jsonify(webdatajson) #make a json package to send back datajson = json.dumps(webdatajson) #makes a json package to send back return(datajson) if __name__ == "__main__": app.run() I'm trying to get the json from the client and then store the data into the postgresql that is why i need the psycopg2 adapter. Is this adapter installed or am I doing something wrong? Also for the future when connecting to the postgresql database from the flask app how should I specify the host? ("http://localhost:5432" or "http://ricky.heliohost.org:5432") Thanks in advanced Forgot to mention my data username: ioteche domain: ioteche.heliohost.org server: Ricky
×
×
  • Create New...