Friday, October 29, 2021

Hi, i had question in django rest framework

Hello I am a backend developer who is developing python django.
I sent you an e-mail because I had a question.
Currently, my company provides web services using pure django.
As the company grew bigger and bigger,
the direction of development was decided through api communication by separating the front and backend from one django project,
and we are trying to proceed with api communication using the django rest framework.
At this time, do I have to pay the usage fee when I want to develop it using the django rest framework for commercial purposes in the project currently being serviced by the company?
Or if you can use it without paying the usage fee, do you have to disclose the source or any restrictions under the license?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ffda96a9-7ef1-4318-b895-aa4d5e61d80dn%40googlegroups.com.

Thursday, October 28, 2021

TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases


Annotation 2021-10-29 081743.png

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f7d8a010-0f68-437c-b3df-ec99a4460aafn%40googlegroups.com.

Recognize Tags in templates

Good morning,

Hello Everybody,

I use the tags to templates but it is being recognized for Server to show content



Please Help me.

Greetings,

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/427f3c64-923a-4d31-89ed-17a5d9536eb8n%40googlegroups.com.

Wednesday, October 27, 2021

Re: facing problems while deploying the project some error with static files

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHmRmrqYVFzXu1a
SBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiytNkhOOIYA/l8ppvyaRlrp/jP
jAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgx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HZBHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----On 27/10/2021 12.51, 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science
and Engineering' via Django users wrote:
> i am using heroku
>

You are probably doing something wrong. Try to do things correctly
instead and see if that doesn't solve your problems.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2731da45-a49a-409a-5b8f-e6f11dcd5cac%40stacktrace.dk.

Tuesday, October 26, 2021

Re: Modeform Foreign key column not working

Hi,

I am trying to save the model form and getting error that foreign key column is not there. 

Error:
column "connection_type_id" of relation "connection_details_test" does not exist ( There is no column connection_type_id, why its looking for this column, should I change my model?)

Models:
======

class ConnectionTypes(models.Model):
      connection_type_id = models.IntegerField(primary_key=True,default=re_sequence('connection_type_seq'))
      connection_type_name = models.CharField(max_length=100)
      connection_type_desc = models.CharField(max_length=300)
      connection_type_category = models.CharField(max_length=100)
      last_update_date = models.DateTimeField(default=dbcurr_ts)

      class Meta: 
            managed = False
            db_table ='connection_types_test'
            verbose_name = 'connection_types_test'
            verbose_name_plural = 'connection_types_test'

      def __str__(self):
        return str(self.connection_type_id)
    


class ConnectionDetails(models.Model):
      connection_id = models.IntegerField(primary_key=True,default=re_sequence('connection_seq'))
      connection_name = models.CharField(max_length=200)
      connection_type = models.ForeignKey(ConnectionTypes, on_delete=models.CASCADE)
      endpoint = models.CharField(max_length=100)
      port = models.IntegerField()
      login_id = models.CharField(max_length=100)
      login_password = fields.CharPGPPublicKeyField(max_length=100)
      connection_string_1 = fields.CharPGPPublicKeyField(max_length=100)
      connection_string_2 = fields.CharPGPPublicKeyField(max_length=100)
      connection_string_3 = fields.CharPGPPublicKeyField(max_length=100)
      aws_region = models.CharField(max_length=20)
      owner_id = models.IntegerField()
      last_update_date = models.DateTimeField(default=dbcurr_ts)
      working_schema = models.CharField(max_length=100)
      service = models.CharField(max_length=100)

      def generate_enc(mystrenc):
          return 'pass'

      class Meta:
            managed = False
            db_table = 'connection_details_test'
            verbose_name = 'connection_details_test'
            verbose_name_plural = 'connection_details_test'

Model Form :
==========

class ConnectionForm(forms.ModelForm):

    login_password = forms.CharField(widget=forms.PasswordInput())
    owner_id = forms.IntegerField(widget=forms.HiddenInput(), required=False)
    
    class Meta:
        model = ConnectionDetails
        exclude = ['connection_id','last_update_date']


View.py
======
def addconnection(request):
    connectionform = ConnectionForm(request.POST or None)
    if connectionform.is_valid():
        ownerqs = AuthUser.objects.values('id').get(username = request.user.username)
        connectionform.cleaned_data['owner_id'] = int(ownerqs['id'])
        connectionform.save()
        messages.success(request, f"sucess!")
    else:
        messages.success(request, f"Failure!")
    return render(request,'main/ssaddconnection.html',{"cform":
    connectionform,"CanUseMod":UserModules.objects.filter(user_id=request.user.id).filter(module_id=1).count(),"UserIsAuth":request.user.is_authenticated})
    
Anyone can help me on this??

Thanks,
Aruna 
On Saturday, 23 October 2021 at 18:53:38 UTC+1 sutharl...@gmail.com wrote:
cool! mention not :)

On Thu, 21 Oct 2021 at 19:57, Aruna Priya Nagarajan <arunapriya...@gmail.com> wrote:

yeah, it is a foreign key and I have put integer field instead of foreign key in the model. I changed it now and its working by itself without specifying ModelChoiceField. 

Thanks for your help!! 


On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com wrote:
is `ConnectionTypes` a foreign key to `ConnectionDetails`?
in that case you don't need to put it as a field in form, it will be added automatically in the form. 
On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote:
Hi,

I am trying to create a form from model and the model has a foreign key and am not able to populate the values from the column it refers to.

My form,

class ConnectionForm(forms.ModelForm):
 connection_type = forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), to_field_name='connection_type_id')

    class Meta:
        model = ConnectionDetails
        exclude = ['connection_id','last_update_date']


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ddb8c862-57fc-4bb0-97a0-f5c235b00a1fn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3000878a-cc44-4fd9-9c2b-2f72ce85d664n%40googlegroups.com.

Saturday, October 23, 2021

Re: Modeform Foreign key column not working

cool! mention not :)

On Thu, 21 Oct 2021 at 19:57, Aruna Priya Nagarajan <arunapriya.nagarajan@gmail.com> wrote:

yeah, it is a foreign key and I have put integer field instead of foreign key in the model. I changed it now and its working by itself without specifying ModelChoiceField. 

Thanks for your help!! 


On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com wrote:
is `ConnectionTypes` a foreign key to `ConnectionDetails`?
in that case you don't need to put it as a field in form, it will be added automatically in the form. 
On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote:
Hi,

I am trying to create a form from model and the model has a foreign key and am not able to populate the values from the column it refers to.

My form,

class ConnectionForm(forms.ModelForm):
 connection_type = forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), to_field_name='connection_type_id')

    class Meta:
        model = ConnectionDetails
        exclude = ['connection_id','last_update_date']


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ddb8c862-57fc-4bb0-97a0-f5c235b00a1fn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGp2JVFY3%2BjW1CPPMbsoGwbeVOb8kjUy8rRjTpapCQWoe3N4Gw%40mail.gmail.com.

Thursday, October 21, 2021

Re: Modeform Foreign key column not working


yeah, it is a foreign key and I have put integer field instead of foreign key in the model. I changed it now and its working by itself without specifying ModelChoiceField. 

Thanks for your help!! 


On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com wrote:
is `ConnectionTypes` a foreign key to `ConnectionDetails`?
in that case you don't need to put it as a field in form, it will be added automatically in the form. 
On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote:
Hi,

I am trying to create a form from model and the model has a foreign key and am not able to populate the values from the column it refers to.

My form,

class ConnectionForm(forms.ModelForm):
 connection_type = forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), to_field_name='connection_type_id')

    class Meta:
        model = ConnectionDetails
        exclude = ['connection_id','last_update_date']


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ddb8c862-57fc-4bb0-97a0-f5c235b00a1fn%40googlegroups.com.