Anonymous
👍
Anonymous
pls tell me how i replace textarea with rich text editor in Django Admin?
Ori
pls tell me how i replace textarea with rich text editor in Django Admin?
https://github.com/aljosa/django-tinymce Works with django admin
Jorge Luis
path('<pk>', views.P_detail, name='p_detail') from django.urls import path dont use urls https://docs.djangoproject.com/en/2.2/topics/http/urls/
This is the code from the tutorial i have used. And the error is that it doesnt find the URL in the patterns. I think the problem is because I use Django angular brackets and the tutorial use regex, but dont know how to make a test for the angular brackets path in the urlpatterns. And the aire works perfectly, only problems with this function from django.urls import resolve def test_url_resolves_view(self): view = resolve('/p/1/') self.assertEquals(view.func, P_detail)
Ghorz
What's your django version
أمجد☄
I have accidentally deleted all of my init.py files while trying to reset migrations, i have recreated the migrations file on each of my apps with a blank init file but some errors seem to pop up like: no module named "myprojectname.users".
Jorge Luis
I don't quite understand why you are resolving a regex, if you are trying to resolve the url then def test....... view = resolve('p_detail') self.assertEquals(resolve(view).func,p_detail)
This is the tutorial https://simpleisbetterthancomplex.com/series/2017/09/18/a-complete-beginners-guide-to-django-part-3.html#using-the-urls-api I use Django 2.2 and there is used 1.11
Bernard Kwey
IntegrityError at /admin/auth/user/3/delete/ FOREIGN KEY constraint failed
Bernard Kwey
help please
Bedilbek
you can not delete an object if it is used as a foreign key somewhere else
Vishal
.
Bedilbek
IntegrityError at /admin/auth/user/3/delete/ FOREIGN KEY constraint failed
you can only delete if inside a model definition you have set to Cascade. otherwise you have to delete all relations first, then the object itself
Anonymous
I have a problem in pycharm
Anonymous
OperationalError: (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.\r\n")
Anonymous
This problem was occured in django
Anonymous
Anyone help me
Damian
hi guys, any tutorial with Shopify and Django? thanks!
Alexander
hi! how can i connect to database and get all tables in django?
Alexander
db.connections.databases['mydb’] how i can make query?
Rohan
hi! how can i connect to database and get all tables in django?
https://docs.djangoproject.com/en/2.2/ref/databases/
Mohan
Brothers my virtual env successful set-up but server is not responding May ik the reason
Mohan
Thanks
Ghorz
Hey guys. Got a hick down here. Was developing an image sharing system between users. I noticed uploaded files and images could be accessed by anyone using the file path. How do I secure images and files from unauthorised access
Jimmies San
I hate my phone
Mirco
🤣🤣
Jimmies San
I hate myself
Jimmies San
😂😂😂
Jimmies San
fixed!!!!!
Mirco
Kek 🤪
Ghorz
Kek 🤪
site.com/media/myhealthinsurancecard.pdf Can be view by both everyone I need a way to allow only the uploaded and admin access it.
Jimmies San
bot deleted your message. use loginrequired without @ or it will trigger the bot check
Ghorz
site.com/media/myhealthinsurancecard.pdf Can be view by both everyone I need a way to allow only the uploaded and admin access it.
Ghorz
I've duckduckgo but found no result
Ghorz
Set permissions for the view where you give the access to that media
I did it using LoginRequiredMixin and User Permissions. The problem is if someone guess an image link and it exist, it will display on the browser. I need a way to secure the uploaded images so only the uploader and admin can view it. If the direct link is accessed, it should redirect
Ghorz
Put some logic in template also
No one seem to understand me. It's not template. If you know what hotlink is, then you'll understand mw
Ghorz
Me
Anonymous
😂
Ghorz
No one seem to understand me. It's not template. If you know what hotlink is, then you'll understand mw
https://s.yimg.com/uu/api/res/1.2/ugnwhNK0quj9LZzi21FYvA--~B/Zmk9c3RyaW07aD0zODg7cHlvZmY9MDtxPTk1O3c9NzIwO3NtPTE7YXBwaWQ9eXRhY2h5b24-/https://media-mbst-pub-ue1.s3.amazonaws.com/creatr-uploaded-images/2019-08/4a4c2020-bbd2-11e9-abce-56c556679592.cf.webp This is what I mean. when you click on that link, it will take you straight to the image. I want only the image uploader and admin to have the acess to view it
Ghorz
are you using a s3 bucket to store the files?
Not yet but will, am in development
Jimmies San
because maybe the problem is on aws side. the bucket is a public bucket so all can access to stored files
Jimmies San
No one seem to understand me. It's not template. If you know what hotlink is, then you'll understand mw
share your code. at least the view. or debugging/helping is almost impossible
Syam
I am new to django. Please explain me the difference between modelform and normal form while creating a form in django
Jimmies San
I am new to django. Please explain me the difference between modelform and normal form while creating a form in django
https://stackoverflow.com/questions/2303268/djangos-forms-form-vs-forms-modelform
Ghorz
someone pls convert this to django2
Acidflow
Hi, i have a issue with regex, i need to complete one exercise on open edx platform but i have a problem with url pattern in django 1.11 with regex the exercise consists on modify system url's creating a new endpoint like this -> "https://youropenedx.com/karim?greeting=hello" The actual regex is -> Url(r".*greeting=(.*)") but this doesnt work for me sorry for me english lvl and thx
#
hi everybody, how do u do?, my django couldn't work, is there any who have expericed it?
inchidi
inchidi
simply add authorization to your media urls
#
Whats your problem
when run command python manage.py shell, it couldn't works
Acidflow
is this your own system url or third party url? am wondering why you need regex for url tho
Solution r"^karim$" request.get["greeting"]
Acidflow
Thx
Ghorz
if permitted, image will show else not permitted. no hotlinking.
Ghorz
I wrote a code to protect media files from unauthorised view
Ghorz
If someone try url/media/cc/visa.png It will show 403. Except the instance owner
inchidi
I wrote a code to protect media files from unauthorised view
what's the difference between your approach and what suggested? you didnt use views permissions?
Ghorz
Why
Ghorz
model permission only
It's when the is hotlink to a media file