Re: Can't render images from database

2023-03-03 Thread Chelsea Fan
did you setup static and media files? On Sat, Mar 4, 2023 at 3:00 AM Michael Starr wrote: > My next issue is that I'm having difficulty displaying images stored in > the database. > > It's a mouthful so I'll spare you, but I'll add details as I go along. > > Michael > > -- > You received this

Re: Ordering of code

2023-03-03 Thread Michael Starr
Thank you, David. Michael On Friday, March 3, 2023 at 4:14:46 PM UTC-8 David Nugent wrote: > Both are related to the python language, nothing Django specific about > them. > > This may help (not in explaining so much as demonstrating workarounds): > >

Re: Ordering of code

2023-03-03 Thread David Nugent
Both are related to the python language, nothing Django specific about them. This may help (not in explaining so much as demonstrating workarounds): https://stackoverflow.com/questions/4162456/forward-declaration-of-classes https://erdantic.drivendata.org/v0.4/forward-references/ Regards, /d

Trying to render images from database

2023-03-03 Thread Michael Starr
It's not working. class PetOwnerDetailView(DetailView): model = PetOwner context_object_name = "owner" template_name = "pet_owner_profile.html" def get_context_data(self, *args, **kwargs): context = super().get_context_data(**kwargs) context['pet_photos'] = {}

Can't render images from database

2023-03-03 Thread Michael Starr
My next issue is that I'm having difficulty displaying images stored in the database. It's a mouthful so I'll spare you, but I'll add details as I go along. Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: django.db.utils.OperationalError: foreign key mismatch - "pet_profile_petphoto_pet" referencing "pet_profile_petphoto"

2023-03-03 Thread Michael Starr
I fixed it. Let me see if I can find the stack article that helped... Well anyway, the command that did it was python manage.py migrate --run-syncdb after deleting the pycache files, the db.sqlite file, and the migration files. So delete all those, then run migrate --run-syncdb. That did an

Ordering of code

2023-03-03 Thread Michael Starr
Does anyone know why in django models (and I don't know how it is in etc. python), you can define a function below, and use it above in the code, but a class can't reference a class defined later in the code, or it won't find it? That seems like beyond stupid to me. Michael -- You received

Re: Upload image submit by users to another serveur

2023-03-03 Thread Ahmed Mulla
Hey off the top of my head there are a bunch of ways you can do it. 1. Create a separate function that uploads the image to the new server, call that function in the upload view(you should make it async) 2. Write the input to something like Kafka and then write read functions that cater to

Upload image submit by users to another serveur

2023-03-03 Thread Théodore KOSSI
Hello guys, I hope you are well I want to upload image submitting by user to another server Please , do you have any solutions to help me. -- theodoros17@python-developer -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: "Django road map and resources"

2023-03-03 Thread Prosper Lekia
Hi Yaqiinso. Just start small. All you need is a good understanding of your project logic, and what you want to achieve. You can also try collaborating on a existing project. You can always reach out to me. I started Django with the docs, and by studying the code base of cloned projects. I have