Rajjix
how to host django for free
by not paying money for it
Maz
how to host django for free
By running localhost
Code9
Sorry Iโ€™m late but noSQL could help
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
Ever tried MongoDB?
No, how would that help?
Code9
Basically u will have a table containing all the product id
Code9
Then u use that id to query the product item in MongoDB
Code9
You wonโ€™t know how many attributes until runtime
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
Hello guys can anyone tell me where to learn django i am new in this.โ˜น๏ธโ˜น๏ธ
Rajjix
Then u use that id to query the product item in MongoDB
why do you like to make things complex.
Code9
why do you like to make things complex.
Took me a while to learn But RDBMS really isn't designed for items with variable attributes
Rajjix
Took me a while to learn But RDBMS really isn't designed for items with variable attributes
True but Iโ€™ve heard bad rumors about django and mongodb. And django offers too much when it comes to models, just with this particular framework and itโ€™s orm, i have not yet seen any use of mongo, a couple of null fields wonโ€™t harm nobody.
Rajjix
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
hey i want to make E - learning website with online exam test features. can i make this on django.
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
if yes then which moduls i need to learn to solve this problem
Mirco
if yes then which moduls i need to learn to solve this problem
everything you find on official docs then u can think about third party packs
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
can you suggest me any
Mirco
again, start from official docs
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
ok thank bro
Mirco
you have to learn how django works first of all
Mirco
๐Ÿ…œ๐Ÿ…ž๐Ÿ…—๐Ÿ…˜๐Ÿ…ฃ
yes i am working on it
Mirco
yes i am working on it
💪🏻💪🏻💪🏻
Code9
oh yea
Code9
btw
Code9
Python does not allow accessing variables of its subclass unless called
Anonymous
Hey, I am using drf to make an API. I am displaying the list of users using ListAPIView. I want to pass some extra data ( I mean adding context, while returning data to user) how to do it ??
Anonymous
somthing like this ?
I guess this passes the data to serializers right ?? ( Not to users I guess ?)
Mirco
yup, you mean inside view instead ?
Anonymous
yup, you mean inside view instead ?
But I want to add some other json field ( suppose 'user count') at the end of the listview while returning the json data to user is it possible ?
Mirco
if I don't go wrong, you can make another serializer of 'user count' and add to your list serializer
Mirco
yw 😁
Rammanoj
I am following this link to get the combined data from the two different models https://medium.freecodecamp.org/nested-relationships-in-serializers-for-onetoone-fields-in-django-rest-framework-bdb4720d81e6
Rammanoj
I am following this link to get the combined data from the two different models https://medium.freecodecamp.org/nested-relationships-in-serializers-for-onetoone-fields-in-django-rest-framework-bdb4720d81e6
class UserAccessSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('username', 'pk') read_only_fields = ('pk',) class ProfileSerializer(serializers.ModelSerializer): user = UserAccessSerializer(required=True) class Meta: model = models.Profile fields = ('user', 'userid', 'user_requset_role')
Rammanoj
class UserAccessSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('username', 'pk') read_only_fields = ('pk',) class ProfileSerializer(serializers.ModelSerializer): user = UserAccessSerializer(required=True) class Meta: model = models.Profile fields = ('user', 'userid', 'user_requset_role')
this is my code, I am not sure why I am getting this error: Got AttributeError when attempting to get a value for field user on serializer ProfileSerializer. The serializer field might be named incorrectly and not match any attribute or key on the User instance. Original exception text was: 'User' object has no attribute 'user'.
R
Probably you have a typing error in โ€˜user_requset_roleโ€™
Rammanoj
These are my model definations
Rammanoj
These are my model definations
class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) userid = models.CharField(max_length=100) user_requset_role = models.CharField( max_length=50, null=True, blank=True) def str(self): return self.user.username
Rammanoj
I guess there is no change in the model even, unknowingly I made the same typo boththe places
Danil
redis.exceptions.ConnectionError: Too many connections Got ths error trying to call ัelery task from a django shell. how to fix it?
Rammanoj
I am following this link to get the combined data from the two different models https://medium.freecodecamp.org/nested-relationships-in-serializers-for-onetoone-fields-in-django-rest-framework-bdb4720d81e6
I have two models, User and Profile. In listapiview I try to access username, some attributes of profile model. So, I followed this medium tutorial to perform it. While acessing the serializer, I am getting the error
Rammanoj
this worked
Rammanoj
this worked
class ProfileSerializer(serializers.ModelSerializer): class Meta: model = models.Profile fields = ('user', 'userid', 'user_requset_role') class UserAccessSerializer(serializers.ModelSerializer): profile = ProfileSerializer(read_only=True) class Meta: model = User fields = ('username', 'pk', 'profile',) read_only_fields = ('pk',)
Rammanoj
Previously, I have a OnetoOne relation from User model to Profile model, (But I tried to access it in the reverse manner, so I am getting the error😅😅)
Mirco
😂😂
ilyandho
Hey guys, I deployed to heroku but it isn't going live . Any help?
Modou-dev
Hi you need to add a dynos in your heroku settings
ilyandho
Hi you need to add a dynos in your heroku settings
How do I do that? I realised that when I created the first project, the Procfile was all lowercase. When I did the second project with the Procfile properly named, it worked and it ran online
Modou-dev
so change the procfile name it must be (Procfile) with a uppercase (P)
ilyandho
so change the procfile name it must be (Procfile) with a uppercase (P)
Do I go through the same proceedure in order to update the files that I already pushed?
ilyandho
Okay, thanks a lot
Modou-dev
Okay, thanks a lot
don't mention
Modou-dev
if u there is any question we are here for helping each other
ilyandho
Karthik
Guys any idea
Karthik
how to solve this issue
Karthik
Here I forget to create API Token anyway thank you guys
Abdul-Salaam
And it helps especially for beginners
Is there any specific idle for django? And where can I learn django?
Anonymous
Django app host through apache2 server and database mysql then i geting error "attempt to write a readonly database"
สšษžร‡herry ลoveสšษž
Yes
but why ?
Anonymous
Root permission is required for connect with database..
Anonymous
I did already.!
Ghorz
That resolved mine
Manish
this is my model https://del.dog/upepumavas.py
Manish
i want to retrieve instances of featuredlisting something like this featuredlisting.objects.all().listing.title