Doragonsureiyā
raven
does anybody here uses django saleor ?
Mirco
Orack
can we send email verification
Orack
from django
Anonymous
Yes we can! ;)
😂👌🏻👍🏻
Anonymous
how
search for it it have to many tutorials
El
https://pastebin.com/42aGetgs
El
href="{% url 'admin' %}"
El
when I write the url in html it sends me an error and the path is correct
Orack
localhost:8000/admin/
Orack
in browser
El
localhost:8000/admin/
but if I upload it to the internet, the localhost will not work
Mirco
but if I upload it to the internet, the localhost will not work
because you need to go to your-domain/admin , not localhost or your-ip-address
Orack
so ip/admin/
Orack
every person is using some different approach
Orack
i want to do it for api
Anders (izzno / gooood) 🇳🇴
Whats your favorite way (the best way) to add multiple images to a model ?
Anders (izzno / gooood) 🇳🇴
hm...
Anders (izzno / gooood) 🇳🇴
model one to many with an Image model
what about something like: https://pastebin.com/PP313LFX
Anders (izzno / gooood) 🇳🇴
Then you have more control over the pictures?
Mirco
what about something like: https://pastebin.com/PP313LFX
I don't know what's your use case for example in one of my projects a user can upload multiple images of a product, so I have Product and ProductImage and I can easily handle images
Anders (izzno / gooood) 🇳🇴
The collection is redundant you mean ?
أمجد☄
Hi, anyone knows how to make other paths display able when a user created by the usercreationform submits a field in a form of a page ?
Mirco
Thats exactly my usecase hehe...
I suggest to have Model and ModeImage, it's easy to handle them
Anders (izzno / gooood) 🇳🇴
model one to many with an Image model
How do you handle filestructure (one giant folder with no subfolders, or would you make picture model for each model requiering pictures)
Anders (izzno / gooood) 🇳🇴
My OCD need some sort of structure to the files 🥺
Mirco
My OCD need some sort of structure to the files 🥺
you can do all you want , just need to define your structure into model's upload_to
Anders (izzno / gooood) 🇳🇴
ahh you mean use a function and return a path based on the instance passed to the function ?
Anders (izzno / gooood) 🇳🇴
exactly
my man! ;) Thank you! Brilliant
Orack
https://del.dog/rajesuxapa
Orack
i have this Record: to linked to /register
Orack
how can i add to make it confirm email like this https://del.dog/apomacixek.py
Mirco
django already has this feature when you reset your password so you can use its method
Orack
django already has this feature when you reset your password so you can use its method
tlhis https://medium.com/@blakeyang22/django-signup-with-activation-email-via-api-7384e6766710
Orack
?
Mirco
https://blog.hlab.tech/part-ii-how-to-sign-up-user-and-send-confirmation-email-in-django-2-1-and-python-3-6/ Something like this
Sander
How to host a Django application on a subdomain using Plesk?
Sander
I don't think u can with plesk
What's the reason for that?
Mirco
What's the reason for that?
if I don't go wrong plesk is not python friendly
Sander
if I don't go wrong plesk is not python friendly
I am able to just host it on a port so I think that's not the case
Anders (izzno / gooood) 🇳🇴
https://www.plesk.com/blog/guides/django-hosting-latest-plesk-onyx/
Anders (izzno / gooood) 🇳🇴
use python 3 not 2 (if it's not obvious)
Anders (izzno / gooood) 🇳🇴
Thanks
It's result 1 from googling: django on plesk
Orack
nicely explained blog
Orack
but here they use form = UserSignUpForm(request.POST)
Orack
i dont need that form in rest api
Orack
so how should i go on
Anders (izzno / gooood) 🇳🇴
the serializer does the validation in DRF
Anders (izzno / gooood) 🇳🇴
https://www.django-rest-framework.org/api-guide/serializers/#validation
Anders (izzno / gooood) 🇳🇴
form / serialzer tomato/tomAto
Mirco
but here they use form = UserSignUpForm(request.POST)
You need to use serializer It was an example to help ya
Anders (izzno / gooood) 🇳🇴
@pyflare What instance property do you use to seperate the pictures in different folder ? The model instance will be the same each time (a picture model)
Mirco
@pyflare What instance property do you use to seperate the pictures in different folder ? The model instance will be the same each time (a picture model)
Usually media folder is the parent and children depends on the app but you should use some unique fields , otherwise you will have issues So user pk could be the first idea
Anders (izzno / gooood) 🇳🇴
Usually media folder is the parent and children depends on the app but you should use some unique fields , otherwise you will have issues So user pk could be the first idea
hm, the problem would be to save files under say: "/product/productname" since when the files are uploaded on another model the product wont exist as you would need to upload the files and then connect it to the product instance.
Anders (izzno / gooood) 🇳🇴
(using the admin site that is)
Anders (izzno / gooood) 🇳🇴
I can solve this by writing an img model for each model requiering pictures hehe...
Anders (izzno / gooood) 🇳🇴
https://medium.com/@qasimalbaqali/upload-multiple-images-to-a-post-in-django-ff10f66e8f7a Something like this wont work in admin i mean:
Anders (izzno / gooood) 🇳🇴
No, while creating a product.
Mirco
No, while creating a product.
Ok so just create the product without committing, create images , link them to the product and the save with commit as True
Anders (izzno / gooood) 🇳🇴
we use the admin site to plot the api, hence when creating objects in admin.