Wednesday, November 30, 2022

Re: URL evaluates to 'slug' literally instead of the variable slug

On Wed, Nov 30, 2022 at 09:16:39AM -0800, Michael Starr wrote:
> Thank you. Though, that hard codes everything, which is bad. How do I
> generalize it?

You'll need to do 2 things:

1. Add the pet(s) you want to the template context, probably by implementing get_context_data[1].

2. Change your template to use the pet from the template context instead of the hard code pet, Mocha. Assuming your pet in the template context is named 'pet':

<a href="{% url 'pet_details' slug=pet.slug %}">Pet Profile: {{ pet.name }}</a>

...alternatively since you've implemented get_absolute_url:

<a href="{{ pet.get_absolute_url }}">Pet Profile: {{ pet.name }}</a>


[1] https://docs.djangoproject.com/en/4.1/ref/class-based-views/mixins-simple/#django.views.generic.base.ContextMixin.get_context_data

--
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/20221201004300.GE8954%40fattuba.com.

Re: URL evaluates to 'slug' literally instead of the variable slug

Thank you. Though, that hard codes everything, which is bad. How do I
generalize it?

Also, this worked. I had to specify template_name = pet_profile.html in
the pet detail view.


On 11/30/22 7:15 AM, Ryan Nowakowski wrote:
> On Tue, Nov 29, 2022 at 06:35:25PM -0800, Michael Starr wrote:
>> *home folder / home.html*
>> <!DOCTYPE html>
>> <html lang="en" dir="ltr">
>> <head>
>> <meta charset="utf-8">
>> <title></title>
>> </head>
>> <body>
>> test
>> <a href="{% url 'pet_details' slug='slug' %}">Pet Profile: Mocha</a>
>> </body>
>> </html>
> In your home.html you've hard coded a link to a specific pet named Mocha.
> You'll need to hard code the slug as well so:
>
> <a href="{% url 'pet_details' slug='mocha' %}">Pet Profile: Mocha</a>
>

--
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/4f4f2184-48c9-5448-2fe2-a1ae5550a89c%40spinningcow.xyz.

Re: URL evaluates to 'slug' literally instead of the variable slug

On Tue, Nov 29, 2022 at 06:35:25PM -0800, Michael Starr wrote:
> *home folder / home.html*
> <!DOCTYPE html>
> <html lang="en" dir="ltr">
> <head>
> <meta charset="utf-8">
> <title></title>
> </head>
> <body>
> test
> <a href="{% url 'pet_details' slug='slug' %}">Pet Profile: Mocha</a>
> </body>
> </html>

In your home.html you've hard coded a link to a specific pet named Mocha.
You'll need to hard code the slug as well so:

<a href="{% url 'pet_details' slug='mocha' %}">Pet Profile: Mocha</a>

--
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/20221130151510.GC8954%40fattuba.com.

django.core.exceptions.ImproperlyConfigured: Requested setting REST_FRAMEWORK, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Hi All,

I'm still getting this error:

django.core.exceptions.ImproperlyConfigured: Requested setting REST_FRAMEWORK, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings
Képkivágás.jfif
image.png
  
Anybody has an idea which settings are wrong?  

Thank you!

--
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/828b8cf8-b646-4fd2-ab31-8208617a8d85n%40googlegroups.com.

Tuesday, November 29, 2022

Re: access an attribute of a target model in a many-to-many relationship

mess = Message.objects.get(title="sos")
// print(mess.person.email) // the error occurs here.

emails = []
for m in mess:
    emails.append(m.email)

print(emails)

Pada tanggal Rab, 30 Nov 2022 07.13, Issa N'golo Coulibaly <coulibalyissa956@gmail.com> menulis:
Hi, when I try to access an attribute of a target model in a many to many relationship, I get an error : AttributeError: 'ManyRelatedManager' object has no attribute 'full_name'
so, how to do ?

An exemple:

Class Person(models.Model):
    full_name = models.CharField(max_length=200)
    email = models.EmailField()

Class Message(models.Model):
   
    person = models.ManyToManyField(Person)
    title = models.CharField(max_length=200)
    body = models.TextField()
    
I have already created a Person object and Message object to the database:
   
mess = Message.objects.get(title="sos")
print(mess.person.email) // the error occurs here.

--
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/544808b8-d60f-4020-a7f6-eb415dd37fdbn%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/CAHKnc1xvh3qtnOtg1T-KPMGFZpPV3xUdW7q_AGvXCzhbgEOZeQ%40mail.gmail.com.

Re: access an attribute of a target model in a many-to-many relationship

With a ManyToManyField field you're saying that a message can have many people and a person can have many messages. So:

mess.person.email

... doesn't make sense. You'll need to filter for the person whose email you want. Ex:

mess.person.first().email



By the way, the Django documentation recommends[1] that a ManyToManyField be plural to avoid this confusion. So:

people = models.ManyToManyField(Person)

...instead of:

person = models.ManyToManyField(Person)

[1] https://docs.djangoproject.com/en/4.1/topics/db/examples/many_to_many/#many-to-many-relationships


On November 29, 2022 12:31:28 PM CST, Issa N'golo Coulibaly <coulibalyissa956@gmail.com> wrote:
Hi, when I try to access an attribute of a target model in a many to many relationship, I get an error : AttributeError: 'ManyRelatedManager' object has no attribute 'full_name'
so, how to do ?

An exemple:

Class Person(models.Model):
    full_name = models.CharField(max_length=200)
    email = models.EmailField()

Class Message(models.Model):
   
    person = models.ManyToManyField(Person)
    title = models.CharField(max_length=200)
    body = models.TextField()
    
I have already created a Person object and Message object to the database:
   
mess = Message.objects.get(title="sos")
print(mess.person.email) // the error occurs here.

access an attribute of a target model in a many-to-many relationship

Hi, when I try to access an attribute of a target model in a many to many relationship, I get an error : AttributeError: 'ManyRelatedManager' object has no attribute 'full_name'
so, how to do ?

An exemple:

Class Person(models.Model):
    full_name = models.CharField(max_length=200)
    email = models.EmailField()

Class Message(models.Model):
   
    person = models.ManyToManyField(Person)
    title = models.CharField(max_length=200)
    body = models.TextField()
    
I have already created a Person object and Message object to the database:
   
mess = Message.objects.get(title="sos")
print(mess.person.email) // the error occurs here.

--
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/544808b8-d60f-4020-a7f6-eb415dd37fdbn%40googlegroups.com.

Re: django internationalization

Hi,

Please follow this


On Tue, 29 Nov 2022, 11:53 am Dhrub Kumar Sharma, <dhrubkumar50@gmail.com> wrote:
I want the remaining slug part print dynamically rather than listing manually like https://example.com/ru/hello-world

Here,

ru - country code

Hello-word is slug 

Domain and country code is easy to print using for loop up to available country code but for slug i dint get exact code to print when I use {{% request.path %} } it also wont work because when the user visit the page


Then request.path become 
ru/hello-word 

And at this time {{% request.path %} } fetch ru/hello-world so ru will be repeated twice in this case and our url become insane like


But acutally i want to print only the page path not the full url directory

In the django documentation there is only code avaiable form type select to switch language but i want there dropdown with anchor tag there also i am facing the same problm and second picture is of dropdown

On Tue, Nov 29, 2022, 4:08 AM David Emanuel Sandoval <davidemanuelsandoval@gmail.com> wrote:
Hi, in my case I'm not sure if I'm understanding the problem well. 

Do you have a different url for every language? Are the urls also translated?

In the docs i see they use a tag to get the correct url for the given language, but as I said, I'm not sure if that is what you want.


El lun, 28 nov 2022 16:54, Dhrub Kumar Sharma <dhrubkumar50@gmail.com> escribió:
Hi everybody I am applying Django internalization for a multilingual site. I am facing a problem with making href URL dynamic instead of repeating same code manually.

url.png
I tried this but cant get perfect href dynamically. please help me same problem I am facing in language switcher href also.

    {% get_current_language as LANGUAGE_CODE %}
    {% get_available_languages as LANGUAGES %}
    {% get_language_info_list for LANGUAGES as languages %}
    {% get_language_info for LANGUAGE_CODE as lang %}
    {% for lang in languages %}
        <link rel="alternate" hreflang="{{ lang.code }}" href="/{{ lang.code }}/">
    {% endfor %}

loop.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/6c5c96ea-9866-40b2-9c23-9b03d771ae7en%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/CAHUWMCaTSbE%2B9fhkNxYJ9ApmRqs9nGfUXgmft8pzajHtuwgmgw%40mail.gmail.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/CAEgZrmGTB9u%2BdO31zrAK37b0T%3DGJznaqDYDhDAb2Akd2QWmYFA%40mail.gmail.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/CAK5m317X9H-UT-y12%2BbCf25FLRSec3fy-sZSK4CgppLiT2ohYw%40mail.gmail.com.

Monday, November 28, 2022

Re: django internationalization

I want the remaining slug part print dynamically rather than listing manually like https://example.com/ru/hello-world

Here,

ru - country code

Hello-word is slug 

Domain and country code is easy to print using for loop up to available country code but for slug i dint get exact code to print when I use {{% request.path %} } it also wont work because when the user visit the page


Then request.path become 
ru/hello-word 

And at this time {{% request.path %} } fetch ru/hello-world so ru will be repeated twice in this case and our url become insane like


But acutally i want to print only the page path not the full url directory

In the django documentation there is only code avaiable form type select to switch language but i want there dropdown with anchor tag there also i am facing the same problm and second picture is of dropdown

On Tue, Nov 29, 2022, 4:08 AM David Emanuel Sandoval <davidemanuelsandoval@gmail.com> wrote:
Hi, in my case I'm not sure if I'm understanding the problem well. 

Do you have a different url for every language? Are the urls also translated?

In the docs i see they use a tag to get the correct url for the given language, but as I said, I'm not sure if that is what you want.


El lun, 28 nov 2022 16:54, Dhrub Kumar Sharma <dhrubkumar50@gmail.com> escribió:
Hi everybody I am applying Django internalization for a multilingual site. I am facing a problem with making href URL dynamic instead of repeating same code manually.

url.png
I tried this but cant get perfect href dynamically. please help me same problem I am facing in language switcher href also.

    {% get_current_language as LANGUAGE_CODE %}
    {% get_available_languages as LANGUAGES %}
    {% get_language_info_list for LANGUAGES as languages %}
    {% get_language_info for LANGUAGE_CODE as lang %}
    {% for lang in languages %}
        <link rel="alternate" hreflang="{{ lang.code }}" href="/{{ lang.code }}/">
    {% endfor %}

loop.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/6c5c96ea-9866-40b2-9c23-9b03d771ae7en%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/CAHUWMCaTSbE%2B9fhkNxYJ9ApmRqs9nGfUXgmft8pzajHtuwgmgw%40mail.gmail.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/CAEgZrmGTB9u%2BdO31zrAK37b0T%3DGJznaqDYDhDAb2Akd2QWmYFA%40mail.gmail.com.

Re: getting unique id

On Wed, Nov 23, 2022 at 3:11 PM Larry Martell <larry.martell@gmail.com> wrote:
>
> On Wed, Nov 23, 2022 at 3:01 PM Thomas Lockhart <tlockhart1976@gmail.com> wrote:
> >
> > Why not use the existing Django AutoField?
>
> Because I have multiple rows with the same batch_id, and also I would
> like the batch_ids to be sequential.
>
> The use case is a batch job dashboard. Users run jobs that spawn many
> sub jobs. The jobs all record their status in the JobStatus table. The
> batch dashboard shows all the sub jobs grouped under their parent job.
> The parent job creates a row with a new batch_id, and that is passed
> to the sub jobs. They all record their status using that same batch
> id, but each in its own row.
>
> > > On Nov 23, 2022, at 8:56 AM, Larry Martell <larry.martell@gmail.com> wrote:
> > >
> > > I have an app that needs to get a unique ID. Many threads run at the
> > > same time that need one. I would like the IDs to be sequential. When I
> > > need a unique ID I do this:
> > >
> > > with transaction.atomic():
> > > max_batch_id =
> > > JobStatus.objects.select_for_update(nowait=False).aggregate(Max('batch_id'))
> > > json_dict['batch_id'] = max_batch_id['batch_id__max'] + 1
> > > status_row = JobStatus(**json_dict)
> > > status_row.save()
> > >
> > > But multiple jobs are getting the same ID. Why does the code not work
> > > as I expect? What is a better way to accomplish what I need?

I ended up using another table to get the batch_ids from. It works,
but I still wonder how to make it work without a second table.

--
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/CACwCsY57mQ%2Bp19gPf21AuhwXi66yatSY10gdSWuGk9s5XZx-HQ%40mail.gmail.com.

Sunday, November 27, 2022

Re: Get current user in model signal pre_save

I had an issue where the password field didn't match the password field used in the default User Model Admin.
This fixed that issue:
https://stackoverflow.com/questions/73816296/password-field-is-visible-and-not-encrypted-in-django-admin-site
Hope it helps somebody else!

On Thursday, September 10, 2015 at 1:20:44 PM UTC+5:30 Xavier Palacín Ayuso wrote:
Finally overrite a UserAdmin ModelAdmin:

from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.utils.translation import ugettext, ugettext_lazy as _
from django.core.exceptions import PermissionDenied


class UserAdmin(admin.ModelAdmin):
    actions
= ['delete_model']
   
def get_fieldsets(self, request, obj=None):
       
if not obj:
           
return self.add_fieldsets


       
if request.user.is_superuser:
            perm_fields
= ('is_active', 'is_staff', 'is_superuser',
                           
'groups', 'user_permissions')
       
else:
           
# modify these to suit the fields you want your
           
# staff user to be able to edit
            perm_fields
= ('is_active', 'is_staff', 'groups')


       
return [(None, {'fields': ('username', 'password')}),
               
(_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
               
(_('Permissions'), {'fields': perm_fields}),
               
(_('Important dates'), {'fields': ('last_login', 'date_joined')})]


   
# Prevent super user edition for no super users
   
def save_model(self, request, obj, form, change):
       
print 'save_model'
       
if not change:
           
# New user
            obj
.save()
       
else:
           
# Update user
           
if obj.is_superuser:
               
if request.user.is_superuser:
                    obj
.save()
               
else:
                   
raise PermissionDenied
           
else:
                obj
.save()


   
def get_actions(self, request):
        actions
= super(UserAdmin, self).get_actions(request)
       
del actions['delete_selected']
       
return actions


   
# Prevent super user deletion for no super users  
   
def delete_model(modeladmin, request, queryset):
       
for obj in queryset:
           
if obj.is_superuser:
               
if request.user.is_superuser:
                   
# obj.delete()
               
else:
                   
raise PermissionDenied
           
else:
               
# obj.delete()
    delete_model
.short_description = 'Eliminar usuario/s seleccionados'


El miércoles, 9 de septiembre de 2015, 12:00:18 (UTC+2), Xavier Palacín Ayuso escribió:
I want to collects current user in model signal pre_save, to prevent remove super user permission to current super users.
As I have now so I can not give administrative privileges to a normal user.

from django.db.models.signals import pre_delete, pre_save, post_save
from django.dispatch.dispatcher import receiver
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied


@receiver(pre_save, sender=User)
def save_user(sender, instance, **kwargs):
   
if instance._state.adding is True:
       
# we would need to create the object
       
print "Creating an object"
   
else:
       
#we are updating the object
       
if instance.is_superuser:
           
raise PermissionDenied

--
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/19cee1e0-109e-4500-9764-f04d6b69fc7bn%40googlegroups.com.

Re: AttributeError: module 'django.db.models' has no attribute 'PointField'

On Sun, Nov 27, 2022 at 2:40 PM Ilyas Modni <modniilyas@gmail.com> wrote:
>
> AttributeError: module 'django.db.models' has no attribute 'PointField'

Are you importing:

from django.contrib.gis.db import models

--
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/CACwCsY6VyNv5RdQ5UbA2N2j9W2OKN0B0vg0gjS_kuphmAmd8xg%40mail.gmail.com.

Re: AttributeError: module 'django.db.models' has no attribute 'PointField'

On Sun, Nov 27, 2022 at 2:41 PM Ilyas Modni <modniilyas@gmail.com> wrote:
AttributeError: module 'django.db.models' has no attribute 'PointField'

--
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/CACS9raddif%3DiWrMUHUqEoK%2BTBxDoTYeXQ-mW0D_OZPyfoZqnpg%40mail.gmail.com.

Saturday, November 26, 2022

Re: Django-Firebase Connection


On Sun, Nov 27, 2022 at 2:03 AM Adeboye Igbinyemi <adeboyeamos7@gmail.com> wrote:
Dont know how to connect firebase as a database to  my Django project 

--
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/CAHXnsF2UaNF_2Re8LgiJY3enr%3DCfXazFruYqW30qO62R2jjNjQ%40mail.gmail.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/CAE9p%3DA4rSWuN7d94kC2%2B%2BesW2WjYacrU94G%2BzYF_vQxsmpKHhQ%40mail.gmail.com.

AttributeError: module 'django.db.models' has no attribute 'PointField'

AttributeError: module 'django.db.models' has no attribute 'PointField'

--
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/84040dbe-1512-43ca-a9be-996839f4f527n%40googlegroups.com.

Re: Heroku Timeout When Sending Emails

Are you trying to send 100 emails from your Django view? If so, you might consider sending them asynchronously via something like celery:

https://devcenter.heroku.com/articles/celery-heroku

- Ryan N

On November 25, 2022 10:29:33 AM CST, Annadatha Rao <annadatha.rao@gmail.com> wrote:
You can create timer event with delay of x seconds and try. 

Annadatha. 

On Fri, Nov 25, 2022, 9:33 PM Lightning Bit <thelegendofearthreturns@gmail.com> wrote:
Heroku timesout and says application error when sending emails to 100+ customers. How can this be resolved with Django? Does Heroku have an upgrade feature that will allow larger requests to be sent?

--
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/df86004d-cb37-42fc-ba43-e85ae51160b5n%40googlegroups.com.

Re: Django Internationalization

Only 1 line or you make a break with double quotes and makes behind </br>

Dhrub Kumar Sharma <dhrubkumar50@gmail.com> schrieb am Sa., 26. Nov. 2022, 17:59:
I am getting problems with {% trans " "%} when implementing with paragraph. Will anyone help me how to fix it to translate paragraphs correctly in template and what's wrong with my code here?

--
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/5d2b8788-de2a-4db7-9cd4-05b177b2e2e6n%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/CAKGT9mz5UvXutKVjhbmC9g6KHgy_znkSScvYAuS410CSAuL2hA%40mail.gmail.com.

Django-Firebase Connection

Dont know how to connect firebase as a database to  my Django project 

--
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/CAHXnsF2UaNF_2Re8LgiJY3enr%3DCfXazFruYqW30qO62R2jjNjQ%40mail.gmail.com.

Re: join on plain integerfield

It only uses 2 columns, the "type" of the relation and the id of the
related object. That's why I thought it might be a good fit for your
use case. If you can't use it as-is because your "type" column is a
boolean instead of a foreignkey to ContentType, you can look at the
GenericForeignKey code[1] to see if you can copy and adapt it.

[1] https://github.com/django/django/blob/main/django/contrib/contenttypes/fields.py#L25

On Fri, Nov 25, 2022 at 07:43:47AM +0100, Marek Rouchal wrote:
> Thanks Ryan, that looks promising. I have to dig deeper, but upon first
> read I saw that an additional field would be required in the model
> definition; question: would that also require an additional column in the
> database (which I could not afford), or is it purely a „meta" kind of field
> for ORM purposes only?
>
>
> Ryan Nowakowski <ryan@fattuba.com> schrieb am Mo. 21. Nov. 2022 um 20:41:
>
> > That's sort of how generic relations[1] work. You might be able to make it
> > fit.
> >
> > [1]
> > https://docs.djangoproject.com/en/4.1/ref/contrib/contenttypes/#generic-relations
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "Django users" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/django-users/1YTjSHaj0x0/unsubscribe.
> > To unsubscribe from this group and all its topics, 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/C5E28F70-7521-4CFF-A43E-1B5576D144CF%40fattuba.com
> > <https://groups.google.com/d/msgid/django-users/C5E28F70-7521-4CFF-A43E-1B5576D144CF%40fattuba.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> 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/CA%2Bb80mBJqZWsBg_QiTY7O-0dzxcCXEhYv6-PQQ_ukV895bs%2Bww%40mail.gmail.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/20221126134731.GB8954%40fattuba.com.

Django Internationalization

I am getting problems with {% trans " "%} when implementing with paragraph. Will anyone help me how to fix it to translate paragraphs correctly in template and what's wrong with my code here?Screenshot_1.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/5d2b8788-de2a-4db7-9cd4-05b177b2e2e6n%40googlegroups.com.

Friday, November 25, 2022

Re: Django rest framework

It depend on what form of authentication you want to use e.g Session based authentication, token based. But would recommend token based authentication. Check out Django Rest Framework simple jwt

On Fri, Nov 25, 2022 at 5:56 PM Pooja Kumari <poojaissar143@gmail.com> wrote:
Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.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/CABqs0MxNh%3Da5m1%3D-iHdX%2BiagBCr_mDby%3DiLtDf7c0fK676%3DmKA%40mail.gmail.com.

Re: Django rest framework

Follow this website https://www.cdrf.co/
It has all cheat sheet.
If you you want to implement login and signup please use either rest-auth or dj-rest-auth package 

On Fri, 25 Nov 2022, 22:39 M Adnan, <adnanshab205@gmail.com> wrote:
Message in the group if no body will help than I will guide you in group I am in admin in group

On Fri, 25 Nov 2022, 10:02 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Yeah.. I'm already in group.

On Fri, Nov 25, 2022, 10:29 PM M Adnan <adnanshab205@gmail.com> wrote:
https://chat.whatsapp.com/ICXdXOrbgoNFQTbKxalZD1



Join this group to discuss all django query here all the developers will help of you

On Fri, 25 Nov 2022, 9:56 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.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/CABNyTSrsY6_xHg%3D3pwggyj4bR06b%2Bc%3Dyor1dpM-AVf2E3C_PQw%40mail.gmail.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/CAHYvwbU%3Da-KMjjxQcci1tOk2bAmCwg%2BxOaPi29q8-jOs-TzF6g%40mail.gmail.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/CABNyTSppEMBG1OAL8wm-YcYmGzJUQUvG80Ead8K%2Beyg1pHsCeA%40mail.gmail.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/CA%2BU2%3DaiiOfDPuQ_VgpbgQzDDkF32kT3kG-_wvxvg-ouXYig7Bg%40mail.gmail.com.

RE: Django rest framework

You can use Django rest framework and jwt authentication. Once you understand Django rest framework  you can watch this Youtube video by Denis Ivy,  It explains jwt authentication with Django very well.

 

Sent from Mail for Windows

 

From: Pooja Kumari
Sent: Friday, November 25, 2022 5:56 PM
To: django-users@googlegroups.com
Subject: Django rest framework

 

Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 

Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.com.

 

Re: Django rest framework

Message in the group if no body will help than I will guide you in group I am in admin in group

On Fri, 25 Nov 2022, 10:02 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Yeah.. I'm already in group.

On Fri, Nov 25, 2022, 10:29 PM M Adnan <adnanshab205@gmail.com> wrote:
https://chat.whatsapp.com/ICXdXOrbgoNFQTbKxalZD1



Join this group to discuss all django query here all the developers will help of you

On Fri, 25 Nov 2022, 9:56 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.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/CABNyTSrsY6_xHg%3D3pwggyj4bR06b%2Bc%3Dyor1dpM-AVf2E3C_PQw%40mail.gmail.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/CAHYvwbU%3Da-KMjjxQcci1tOk2bAmCwg%2BxOaPi29q8-jOs-TzF6g%40mail.gmail.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/CABNyTSppEMBG1OAL8wm-YcYmGzJUQUvG80Ead8K%2Beyg1pHsCeA%40mail.gmail.com.

Re: Django rest framework

Yeah.. I'm already in group.

On Fri, Nov 25, 2022, 10:29 PM M Adnan <adnanshab205@gmail.com> wrote:
https://chat.whatsapp.com/ICXdXOrbgoNFQTbKxalZD1



Join this group to discuss all django query here all the developers will help of you

On Fri, 25 Nov 2022, 9:56 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.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/CABNyTSrsY6_xHg%3D3pwggyj4bR06b%2Bc%3Dyor1dpM-AVf2E3C_PQw%40mail.gmail.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/CAHYvwbU%3Da-KMjjxQcci1tOk2bAmCwg%2BxOaPi29q8-jOs-TzF6g%40mail.gmail.com.

Re: Django rest framework

https://chat.whatsapp.com/ICXdXOrbgoNFQTbKxalZD1



Join this group to discuss all django query here all the developers will help of you

On Fri, 25 Nov 2022, 9:56 pm Pooja Kumari, <poojaissar143@gmail.com> wrote:
Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.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/CABNyTSrsY6_xHg%3D3pwggyj4bR06b%2Bc%3Dyor1dpM-AVf2E3C_PQw%40mail.gmail.com.

Django rest framework

Hello.. Can anybody help me with APIs in django? I have to create registration and login APIs but my concepts are not clear yet. Any reference will be enough also. 
Thank you...

--
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/CAHYvwbXMgfynTL%2Bj5mwpfyn_Q7Oq%3Dq%2BPPZc6rb5V2_K8m9nOzQ%40mail.gmail.com.

Re: Heroku Timeout When Sending Emails

You can create timer event with delay of x seconds and try. 

Annadatha. 

On Fri, Nov 25, 2022, 9:33 PM Lightning Bit <thelegendofearthreturns@gmail.com> wrote:
Heroku timesout and says application error when sending emails to 100+ customers. How can this be resolved with Django? Does Heroku have an upgrade feature that will allow larger requests to be sent?

--
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/df86004d-cb37-42fc-ba43-e85ae51160b5n%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/CAFtPNJwBnFOjc_iGx94SEgLetJ3SEyECkoFYQebDiok-6MfSGg%40mail.gmail.com.

Heroku Timeout When Sending Emails

Heroku timesout and says application error when sending emails to 100+ customers. How can this be resolved with Django? Does Heroku have an upgrade feature that will allow larger requests to be sent?

--
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/df86004d-cb37-42fc-ba43-e85ae51160b5n%40googlegroups.com.

Thursday, November 24, 2022

Re: join on plain integerfield

Thanks Ryan, that looks promising. I have to dig deeper, but upon first read I saw that an additional field would be required in the model definition; question: would that also require an additional column in the database (which I could not afford), or is it purely a „meta" kind of field for ORM purposes only?


Ryan Nowakowski <ryan@fattuba.com> schrieb am Mo. 21. Nov. 2022 um 20:41:
That's sort of how generic relations[1] work. You might be able to make it fit.

[1] https://docs.djangoproject.com/en/4.1/ref/contrib/contenttypes/#generic-relations

-- 
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/1YTjSHaj0x0/unsubscribe.
To unsubscribe from this group and all its topics, 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/C5E28F70-7521-4CFF-A43E-1B5576D144CF%40fattuba.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/CA%2Bb80mBJqZWsBg_QiTY7O-0dzxcCXEhYv6-PQQ_ukV895bs%2Bww%40mail.gmail.com.

Re: Forbidden (403) - CSRF verification failed. Request aborted.

Try adding your ngrok domain to the list of CSRF_TRUSTED_ORIGINS: https://docs.djangoproject.com/en/4.1/ref/settings/#csrf-trusted-origins

E.g. assuming you're using https:

CSRF_TRUSTED_ORIGINS = ["https://*.ngrok.io"]

On Wednesday, November 23, 2022 at 2:22:14 PM UTC dhana...@gmail.com wrote:
Make your database as a public make format of database chmod www-data=www-data ./filename 

On Wed, 23 Nov, 2022, 7:33 am Chukwudi Onwusa, <chuks...@gmail.com> wrote:
Check your template, immediately after the <form> opening tag add  
{% csrf_token %}
If you have it already, kindly check to ensure it's correctly spelt and placed and then restart your server.
Best Regards.

On Wed, Nov 23, 2022, 00:58 Carlos Roberto <carlo...@gmail.com> wrote:
Hi everyone!

I use ngrok to make my projects available in django. I'm having trouble accessing the admin page. After I enter the username and password I get the error 403.

Has anyone had the same problem and could help me?

Regards


--
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/de5c4738-f540-4596-b1bf-0b0b16aabbf2n%40googlegroups.com.


On Nov 23, 2022 00:58, "Carlos Roberto" <carlo...@gmail.com> wrote:
Hi everyone!

I use ngrok to make my projects available in django. I'm having trouble accessing the admin page. After I enter the username and password I get the error 403.

Has anyone had the same problem and could help me?

Regards



--
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/de5c4738-f540-4596-b1bf-0b0b16aabbf2n%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...@googlegroups.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/680fc4f4-8b32-445d-9819-f93f00925ab5n%40googlegroups.com.