Anonymous
Here is a snippet from my settings.py file and a snippet, from my urls.py and from my model.py and views.py. I tried everything I could but again can't display images (uploaded to my admin site) in user-site.
Dev4vin
Need help here
Dev4vin
Hello guys, I need some help here
Dev4vin
Kindly take a look at my question here https://stackoverflow.com/q/57284734/10701409
Mirco
Mihail
Hey there!
I have to fields in a Model: team1 & team2
Now I what to create a game for team1 & team2 but I what that Django to check if id for team1 is the same as team2 to raise an exception and not allow to create a new filed in DB.
Where in the docs should I search, I’m using the drf also. Thanks
Mirco
None
Hello. What's best practice for such case? I have duplicated models in different projects but database is only one. How can I apply migrations at once to all projects?
inchidi
None
yes. It will keep duplicated after migration
inchidi
None
elioni
How to return form data as json response?
elioni
Help guys..
Mirco
Mirco
Instead of HttpResponse
elioni
Yes i used jsonresponse
Mirco
And ?
elioni
But i don't know the steps
elioni
To get the data
elioni
From form
Mirco
what do you have to do with that data ? display them somewhere ?
Anonymous
Any Complete resource for Dockerizing Django ?
Log
Hi everyone, I need a consultant on django. I try to explain the problem... I have configured django on a remote machine, and with nginx I do the reverse proxy on the ip of the machine to interface with django, and so far everything is ok. What I am not succeeding in doing is to get me to return under a url declared in the urls.py of diango the http response of a process that is listening on localhost of the remote machine on which it is also configured django.
Mohit
What should I use for connection pooling with django ?
ಶಶಾಂಕ್
In django if I use multiple data it will store in default so how to fetch data from it to other database
ಶಶಾಂಕ್
Multiple database
Muflone
Multiple database
There's an official guide how to use multiple databases with Django.
Just be sure don't place relations between tables across two databases
Tags
Hi everyone. In terms of speed which is better?
1.
class FooSerializer(serializers.ModelSerializer):
bar = BarSerializer(required=False)
2.
class FooSerializer(serializers.ModelSerializer):
def to_representation(self, instance):
bar = {
'id': 1,
'name': 'foobar',
}
Alexey
godmode
This is maybe a stupid question, but what kind if apps can you make with Django+Rest compare to Django alone... You know any example of api app?
godmode
Cuz i've been reading about... But ain't get the concept of api App...
Muflone
Asynchronous requests.
The most simple example is the hierarchical country -> city relation
Muflone
You choose the country and the client sends an asynchronous requests to the server API to get the related cities
Muflone
Is it doable without DRF? Surely but you have to create a lot of stuff already implemented in DRF
godmode
Umm
godmode
Ok, i get it...
Shaun
Easiest thing to think of is AJAX requests to your Rest backend. Typcailly your app will be a mix ofDjango pages and some rest.
Mirco
Mirco
PyCoder
Course link or tutorial for beginners please
Mirco
PyCoder
Mirco
Mirco
Mirco
Anonymous
Okay, Django Champions
Anonymous
Can anyone suggest me a realtime connection solution with Django?
Anonymous
Like I have to connect with a mobile software and then get stats in realtime.
Mirco
django-channels 2
Anonymous
Ha!
Anonymous
I myself used to suggest it to people.
Mirco
Anonymous
😃
Have you used it for this case though?
Anonymous
That looks nice
Anonymous
Also, anyone got experience with push notifications from Django?
Anonymous
Should I use django or Google Firebase would be a better choice?
Ярик
hey guys, i have a question
i have 2 models like so:
class Model_1(models.Model):
patient_name = models.CharField( )
card_number = models.PositiveIntegerField()
class Model_2(models.Model):
patient_name = models.ForeignKey(Model_1)
card_number = models.PositiveIntegerField()
to fill the 2nd model i have to first fill the Model_1
the question is how can i make Model_2 card_number field autofill depending on what FK choice i did?
Anonymous
browser?
Anonymous
I want it for mobile
inchidi
Anonymous
Maybe, browser is in plan too but currently I want push notifications for mobile.
inchidi
inchidi
now push notifications not only about mobile tho
Anonymous
Why is it difficult to generate subscriber key generation?
inchidi
Ярик
https://stackoverflow.com/a/46180048
i've done it, but probably the wrong way
def save(self, *args, **kwargs):
self.patient_name__card_number = self.card_number
super(Model_2, self).save(*args, **kwargs)
inchidi
inchidi
and looks like what you need is one to one instead one to many (foreign key)
Ярик
Anonymous
أمجد☄
i have created an AbstractUser model with a regex validation in validators.py but it just creates the User without any validation! 🤦🏻♂️