Python 3.5 + Django + Postgresql on Windows

Asked

Viewed 526 times

1

I am currently starting a web system project using Python 3.5 and the Django 1.9.1 framework, aiming to integrate them with a database Postgresql 9.5, all installed on a Windows 10 x64 OS machine.

Python and Django installed well using "Pip", but I couldn’t find the Django Postgresql adapter for Python 3.5 . Officially is maintained an adapter called win-psycopg (which in its view only supports up to Python version 3.4), derived from psycopg2.

I wonder if there is any other Django DB connection driver option on Windows for Postgresql? or if it is possible to force this adapter from version 3.4 to version 3.5?

  • Postgres libraries are installed in python and postgres DBMS is running on the machine or on some server?

  • everything is running local on my machine

  • have you ever considered the idea of using ctypes and Hibernate? I believe it is not the most viable means, but can solve your problem

2 answers

1

Adapters that refer to version 3 will very rarely be incompatible with more current versions.

But if you are running Python 2.X you should look for one for it! I already say that this adapter version 3.4 should work with version 3.5, since there was no update or anything like that.

If you want to mess with Nosql, I recommend you to use Sqlite or Python’s own open() function, so you’ll have greater efficiency and less need for processing power.

In a project I developed of an URL shortener(http://wp-a.co) it is entirely made in flask and sqlite, so recommend the use! The code is available on github!

0

You can try to force the adapter, but it might have some version differences bugs (which should be minimal but exist) or even test another type of database like sqlite in conjunction with another web framework like Flask or Bottle!

If you use these two that I have indicated(flask and sqlite or Bottle and sqlite) your import should look like this:

import sqlite
from flask import *

Browser other questions tagged

You are not signed in. Login or sign up in order to post.