python - Django [[WinError 5]] IIS

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg har et problem med Django 1.11 på Windows IIS. På localhost fungerer det, men på IIS ikke. Nogle ideer?


Fejl [[WinError 5]] Adgang nægtet
http://www.wklej.org/id/3223563/[2]


views.py


from django.shortcuts import render
from django.utils import timezone
from . models import Order

import sqlite3
import time
import datetime

import xml.etree.ElementTree as et
import urllib.request as ur

def get\_order(request):
web\_data = ur.urlopen('http://www.xxxx.com/pl/pl/xml/index/id/xxxx/password/xxxxx/no\_tagging/1')
str\_data = web\_data.read()
xml\_data = et.fromstring(str\_data)
order\_list = xml\_data.findall("order")
conn = sqlite3.connect('db.sqlite3')
c = conn.cursor()
for order in order\_list:
    order\_id = order.find("bestellungid").text
    add\_date = order.find("datum").text
    amount = order.find("anzahl").text
    price = order.find("a\_preis\_a").text
    desc = order.find("a\_bezeichnung1").text
    sap = order.find("a\_int\_artikelid").text
    customer\_name = order.find("h\_name1").text
    customer\_street = order.find("h\_anschrift").text
    customer\_code = order.find("h\_plz").text
    customer\_city = order.find("h\_ort").text
    customer\_phone = order.find("h\_telefon").text
    payment = 'Pobranie'
    status = 'Nie zrealizowane'

    c.execute("INSERT OR IGNORE INTO tyre24\_order (order\_id, add\_date, amount, price, desc, sap, customer\_name, customer\_street, customer\_code, customer\_city, customer\_phone, payment, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (order\_id, add\_date, amount, price, desc, sap, customer\_name, customer\_street, customer\_code, customer\_city, customer\_phone, payment, status))

conn.commit()
c.close()
conn.close()
return render(request, 'get\_tyre.html')

Bedste reference