hi,
i know this sounds stupid, but i got lost creating a user...
i can log in to the web interface, but besides listing a lof of things i
cant do anything.
connecting to a "calendar" url (im pretty new to this)
http://localhost/davical/caldav.php/julius/testcalendar/
gives me a user/password prompt.
but how do you actually create a user?
ive been following:
http://wiki.davical.org/index.php/Debian
but it leaves one kinda stranded...
looking at client configurations doesnt help either
my client software: python caldav
https://pypi.python.org/pypi/caldav/0.4.0 says:
python caldav-test.py
Traceback (most recent call last):
File "caldav-test.py", line 25, in <module>
principal = client.principal()
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 113, in principal
return Principal(self)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 307, in __init__
cup = self.get_properties([dav.CurrentUserPrincipal()])
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 172, in get_properties
response = self._query_properties(props, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 99, in _query_properties
return self._query(root, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 114, in _query
url, body, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 127, in propfind
return self.request(url or self.url, "PROPFIND", props, {'Depth':
str(depth)})
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 242, in request
raise ex
caldav.lib.error.AuthorizationError: AuthorizationError at
'http://localhost:80/davical/caldav.php/julius/testcalendar/', reason
'Unauthorized'
client code:
from datetime import datetime
import caldav
from caldav.elements import dav, cdav
url = "http://localhost/davical/caldav.php/julius/testcalendar/"
vcal = """BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:1234567890
DTSTAMP:20100510T182145Z
DTSTART:20100512T170000Z
DTEND:20100512T180000Z
SUMMARY:This is an event
END:VEVENT
END:VCALENDAR
"""
client = caldav.DAVClient(url)
principal = client.principal()
calendars = principal.calendars()
if len(calendars) > 0:
calendar = calendars[0]
print "Using calendar", calendar
print "Looking for events in 2010-05"
results = calendar.date_search(
datetime(2015, 5, 1), datetime(2016, 9, 12))
for event in results:
print "Found", event
how do you get a successfull connection?
i know this sounds stupid, but i got lost creating a user...
i can log in to the web interface, but besides listing a lof of things i
cant do anything.
connecting to a "calendar" url (im pretty new to this)
http://localhost/davical/caldav.php/julius/testcalendar/
gives me a user/password prompt.
but how do you actually create a user?
ive been following:
http://wiki.davical.org/index.php/Debian
but it leaves one kinda stranded...
looking at client configurations doesnt help either
my client software: python caldav
https://pypi.python.org/pypi/caldav/0.4.0 says:
python caldav-test.py
Traceback (most recent call last):
File "caldav-test.py", line 25, in <module>
principal = client.principal()
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 113, in principal
return Principal(self)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 307, in __init__
cup = self.get_properties([dav.CurrentUserPrincipal()])
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 172, in get_properties
response = self._query_properties(props, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 99, in _query_properties
return self._query(root, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/objects.py",
line 114, in _query
url, body, depth)
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 127, in propfind
return self.request(url or self.url, "PROPFIND", props, {'Depth':
str(depth)})
File
"/home/julius/.local/lib/python2.7/site-packages/caldav/davclient.py",
line 242, in request
raise ex
caldav.lib.error.AuthorizationError: AuthorizationError at
'http://localhost:80/davical/caldav.php/julius/testcalendar/', reason
'Unauthorized'
client code:
from datetime import datetime
import caldav
from caldav.elements import dav, cdav
url = "http://localhost/davical/caldav.php/julius/testcalendar/"
vcal = """BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:1234567890
DTSTAMP:20100510T182145Z
DTSTART:20100512T170000Z
DTEND:20100512T180000Z
SUMMARY:This is an event
END:VEVENT
END:VCALENDAR
"""
client = caldav.DAVClient(url)
principal = client.principal()
calendars = principal.calendars()
if len(calendars) > 0:
calendar = calendars[0]
print "Using calendar", calendar
print "Looking for events in 2010-05"
results = calendar.date_search(
datetime(2015, 5, 1), datetime(2016, 9, 12))
for event in results:
print "Found", event
how do you get a successfull connection?