First Download the gdal wheel from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal now pip install the gdal in env jus like normally also install psycopg2 and pscopg2-binary add postgres database to the settings if the liberror then add the version in django contrib gis gdal libgdal.py add to lib_name get the verison of dll from sitescrips osgeo, add the path into ypur settings import os if os . name == 'nt' : VENV_BASE = os . environ [ 'VIRTUAL_ENV' ] os . environ [ 'PATH' ] = os . path . join ( VENV_BASE , 'Lib \\ site-packages \\ osgeo' ) + ';' + os . environ [ 'PATH' ] os . environ [ 'PROJ_LIB' ] = os . path . join ( VENV_BASE , 'Lib \\ site-packages \\ osgeo \\ data \\ proj' ) + ';' + os . environ [ 'PATH' ]
#***(1)Returns all customers from customer table customers = Customer.objects.all() #(2)Returns first customer in table firstCustomer = Customer.objects.first() #(3)Returns last customer in table lastCustomer = Customer.objects.last() #(4)Returns single customer by name customerByName = Customer.objects.get( name = 'Peter Piper' ) #***(5)Returns single customer by name customerById = Customer.objects.get( id = 4 ) #***(6)Returns all orders related to customer (firstCustomer variable set above) firstCustomer.order_set.all() #(7)***Returns orders customer name: (Query parent model values) order = Order.objects.first() parentName = order.customer.name #(8)***Returns products from products table with...
Comments
Post a Comment