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' ]
VIEWS from django.shortcuts import render, redirect from django.http import HttpResponse from django.forms import inlineformset_factory from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import authenticate, login, logout from django.contrib import messages from django.contrib.auth.decorators import login_required # Create your views here. from .models import * from .forms import OrderForm, CreateUserForm from .filters import OrderFilter def registerPage ( request ): if request.user.is_authenticated: return redirect( 'home' ) else : form = CreateUserForm() if request.method == 'POST' : form = CreateUserForm(request.POST) if form.is_valid(): form.save() user = form.cleaned_data.get( 'username' ) messages.success(request, 'Account was created for ' + user) return
Comments
Post a Comment