Anonymous
It create manage.py
Anonymous
yes , it is ok
Anonymous
👍
🏳️‍🌈Robby [ Private Message = Spam]
How to solve this problem
by not using shitty screenshots.
Anonymous
this is the mistake
Anonymous
output = self.handle(*args, **options) File "/usr/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 95, in handle self.run(**options) File "/usr/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 102, in run autoreload.run_with_reloader(self.inner_run, **options) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 579, in run_with_reloader start_django(reloader, main_func, *args, **kwargs) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 564, in start_django reloader.run(django_main_thread) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 272, in run get_resolver().urlconf_module File "/usr/lib/python3.7/site-packages/django/utils/functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "/usr/lib/python3.7/site-packages/django/urls/resolvers.py", line 564, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 724, in exec_module File "<frozen importlib._bootstrap_external>", line 860, in get_code File "<frozen importlib._bootstrap_external>", line 791, in source_to_code File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/noflag/site/mysite/mysite/urls.py", line 21 path('', include(pages.urls')), #new ^ SyntaxError: EOL while scanning string literal
Anonymous
i dont understand , :/ someone ?
Anonymous
someone helpe me ?
cokicoki
its a syntax error
cokicoki
check your syntax
cokicoki
i think you missed a single quote
cokicoki
in urls.py
Anonymous
hum ,as well ?
cokicoki
hum ,as well ?
i dont understand, check your grammar
Anonymous
sorry
Anonymous
how come
Anonymous
there is no mistake , in syntax
Anonymous
Operations to perform: Apply all migrations: admin, auth, contenttypes, sessions Running migrations: No migrations to apply. [noflag@arch mysite]$
Anonymous
Not
Nitesh
output = self.handle(*args, **options) File "/usr/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 95, in handle self.run(**options) File "/usr/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 102, in run autoreload.run_with_reloader(self.inner_run, **options) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 579, in run_with_reloader start_django(reloader, main_func, *args, **kwargs) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 564, in start_django reloader.run(django_main_thread) File "/usr/lib/python3.7/site-packages/django/utils/autoreload.py", line 272, in run get_resolver().urlconf_module File "/usr/lib/python3.7/site-packages/django/utils/functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "/usr/lib/python3.7/site-packages/django/urls/resolvers.py", line 564, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 724, in exec_module File "<frozen importlib._bootstrap_external>", line 860, in get_code File "<frozen importlib._bootstrap_external>", line 791, in source_to_code File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/noflag/site/mysite/mysite/urls.py", line 21 path('', include(pages.urls')), #new ^ SyntaxError: EOL while scanning string literal
Line 21 mysite/mysite/urls.py path(' ', include('pages.urls')),
Ashok
how can I log this in django <django.db.models.fields.related.RelatedManager object at 0x10f730c90>
Ashok
when I try to log user objects its logs like the above
Ashok
using logger.info
inchidi
what you want to see from that object?
Ashok
it's a kind of JSON
Ashok
I need to print entire JSON(dictionary)
Hugo
Can anyone help me to upload a file to sharepoint using python?
Mirco
Can anyone help me to upload a file to sharepoint using python?
Try to post it into @python group if u don't use Django
Hugo
I really wanted to use django for that
Mirco
I really wanted to use django for that
U need to check if SharePoint has APIs to let u upload files
Hugo
I've tried some solutions via stackoverflow
Hugo
but getting '400' error
Mirco
If u don't share your code , we cannot help ya
Mirco
Use code sharing tool pls, read the pinned message
Hugo
which one is that?
Mirco
Pinned message on top of this chat
Hugo
https://dpaste.de/yQbr
Hugo
Please have a look
Hugo
@pyflare ....any idea
Mirco
Not at the moment, never read SharePoint APIs docs
Hugo
https://dpaste.de/UoH1# If anyone can help please use this link
Hugo
@pyflare .. are those headers correct??
Hugo
it's 7 days
Mirco
it's 7 days
Yup 😁
cokicoki
but getting '400' error
can you share that error msg?
Hugo
@katalaluan ...no error message
Hugo
but when I printed the respose status_code..its 400
cokicoki
under line 38
cokicoki
try add this
cokicoki
print(uploadResult.content)
Hugo
b'A potentially dangerous Request.Path value was detected from the client (:).' this is what it is returning @katalaluan
cokicoki
thats your error msg
Hugo
What does that means??
Hugo
@katalaluan
cokicoki
are you using sharepoint 2013?
Hugo
@katalaluan let me check
Hugo
@katalaluan ....its 2013
cokicoki
does your sharepoint account username got space?
Hugo
@katalaluan ...its 2013...
cokicoki
what about sharepoint url? does it contains space?
Hugo
no...no spaces
Hugo
@katalaluan ...any idea?
cokicoki
you have to look for malformed url
cokicoki
line 18
cokicoki
inspect that url
Hugo
OK When I'm trying to authenticate the username...its returning 200
Rohan
Told you already
Rohan
Try using a repl shell or maybe a REST client to make request
Rohan
Like postman
Rohan
so you're sure the problem is not in request
Hugo
OK...
cokicoki
your request contains illegal char
cokicoki
google that, you will find lots of resource on that
Hugo
What are the headers to be passed when uploading a file?? Are they correct in my code?
Rohan
What are the headers to be passed when uploading a file?? Are they correct in my code?
Depends on the API. You'll have to use multipart data for files if I'm not wrong but requests handle it by itself iirc