Problem with get_absolute_url()

2021-04-26 Thread Mike Dewhirst
This code in the chemical model indicates that I'm trying to display two 
different views of the same chemical which has certain data in a details 
1:1 record



class Chemical(models.Model):
    ...
    def get_absolute_url(self):
    detail = self.get_detail()
    if detail and detail.report_type == INTRO:
   return f"/report/intro/{self.id}/"
    return f"/report/audit/{self.id}/"




But it doesn't matter what report_type is selected, the same report 
displays. Print statements inserted indicate the correct report_type 
branch is being executed and the correct url is being returned.


The url which displays the report is always the first of whichever of 
the following patterns is above the other ...




from django.urls import re_path
from report import views as report_views

app_name = "report"

urlpatterns = [
    re_path(r"(?P\d+)/$",
    report_views.audit,
    name="audit",
    ),
    re_path(r"(?P\d+)/$",
    report_views.intro,
    name="intro",
    ),
]




Both reports are identifiably different. In the above configuration the 
audit report always shows no matter which report_type is selected.


Where am I going wrong?

I have tried to get reverse() working by following along with ...

https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url

... but to no avail. I think if I can get it working with specified urls 
I should be able to get reverse working.


Thanks for any hints

Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
That's because both have the same path, and Django will always choose the
one it sees first, in this case, the audit. Just change the path of any of
the two will solve the problem.

On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:

> This code in the chemical model indicates that I'm trying to display two
> different views of the same chemical which has certain data in a details
> 1:1 record
>
>
> class Chemical(models.Model):
>  ...
>  def get_absolute_url(self):
>  detail = self.get_detail()
>  if detail and detail.report_type == INTRO:
> return f"/report/intro/{self.id}/"
>  return f"/report/audit/{self.id}/"
>
>
>
>
> But it doesn't matter what report_type is selected, the same report
> displays. Print statements inserted indicate the correct report_type
> branch is being executed and the correct url is being returned.
>
> The url which displays the report is always the first of whichever of
> the following patterns is above the other ...
>
>
>
> from django.urls import re_path
> from report import views as report_views
>
> app_name = "report"
>
> urlpatterns = [
>  re_path(r"(?P\d+)/$",
>  report_views.audit,
>  name="audit",
>  ),
>  re_path(r"(?P\d+)/$",
>  report_views.intro,
>  name="intro",
>  ),
> ]
>
>
>
>
> Both reports are identifiably different. In the above configuration the
> audit report always shows no matter which report_type is selected.
>
> Where am I going wrong?
>
> I have tried to get reverse() working by following along with ...
>
>
> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>
> ... but to no avail. I think if I can get it working with specified urls
> I should be able to get reverse working.
>
> Thanks for any hints
>
> Cheers
>
> Mike
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
> .
>
-- 
KeLLs

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX0f%3Dg%3DOwex7QL0bJYARga_iYZoJFEpmDgf%2BuHPZOLKS9g%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
In your URL pattern, just indicate that the audit URL pattern must first go
to “audit/{id}/”,and intro URL pattern to “intro/{id}/”.

On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:

> This code in the chemical model indicates that I'm trying to display two
> different views of the same chemical which has certain data in a details
> 1:1 record
>
>
> class Chemical(models.Model):
>  ...
>  def get_absolute_url(self):
>  detail = self.get_detail()
>  if detail and detail.report_type == INTRO:
> return f"/report/intro/{self.id}/"
>  return f"/report/audit/{self.id}/"
>
>
>
>
> But it doesn't matter what report_type is selected, the same report
> displays. Print statements inserted indicate the correct report_type
> branch is being executed and the correct url is being returned.
>
> The url which displays the report is always the first of whichever of
> the following patterns is above the other ...
>
>
>
> from django.urls import re_path
> from report import views as report_views
>
> app_name = "report"
>
> urlpatterns = [
>  re_path(r"(?P\d+)/$",
>  report_views.audit,
>  name="audit",
>  ),
>  re_path(r"(?P\d+)/$",
>  report_views.intro,
>  name="intro",
>  ),
> ]
>
>
>
>
> Both reports are identifiably different. In the above configuration the
> audit report always shows no matter which report_type is selected.
>
> Where am I going wrong?
>
> I have tried to get reverse() working by following along with ...
>
>
> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>
> ... but to no avail. I think if I can get it working with specified urls
> I should be able to get reverse working.
>
> Thanks for any hints
>
> Cheers
>
> Mike
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
> .
>
-- 
KeLLs

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%40mail.gmail.com.


Re: Connect Django authentication to windows ldap/windows active directory

2021-04-26 Thread Kasper Laudrup
On 25/04/2021 18.43, Swelan Auguste wrote:
> I'm trying to connect my Django applications to ldap/windows active
> directory.
>

https://django-auth-ldap.readthedocs.io/en/latest/index.html

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6354b54a-9b7b-3d87-14b6-83bd4b8dd293%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Assistance for deploying django app to heroku

2021-04-26 Thread Ejike Enyinnaya
Good day Jim,

My process from beginning includes:

1. I reset the database: rm -f db.sqlite3
2. python manage.py migrate
3. In django admin platform: I added all the books information from the
fixtures.json and tied it to the user which is admin
4. Implemented a new fixtures.json
5. ran python manage.py makemigrations
6. ran python manage.py migrate
7. git add .
8. git commit -m "[updated information here]"
9. git push origin master
10. git push heroku master
11. heroku run python manage.py migrate
12. heroku run python manage.py loaddata books/fixtures.json (This is
where i get the error)


BR,
Ejike Chiboka
0804537; 08166516400


On Sat, Apr 24, 2021 at 9:38 PM Jim Illback  wrote:

> I didn’t see a “createsuperuser" command. Was that done or is it part of
> your fixtures.json load?
>
> Jim
>
> On Apr 24, 2021, at 8:04 AM, Ejike Enyinnaya 
> wrote:
>
> Good day Kasper,
>
> Thanks for your response.
>
> The git commands I put in the email was just to give a summary of what I
> had done and not the full details, that way my email is not too long and
> cumbersome to read.
>
> I can assure you on my CLI, I ran the proper git commands putting in the
> right information and not leaving it empty.
>
> BR,
> Ejike Chiboka
> 0804537; 08166516400
>
>
> On Fri, Apr 23, 2021 at 7:53 PM Kasper Laudrup 
> wrote:
>
>> On 23/04/2021 20.41, Ejike Enyinnaya wrote:
>> > I did a git add ., git commit -m and git push heroku master
>>
>> Not sure if it's related, but it's possible: This is not how you should
>> use revision control (git).
>>
>> You should keep your source files under revision control, not just
>> blindly add everything and committing it with an empty commit message.
>> Then you might as well not use any kind of revision control at all.
>>
>> It might be slightly off topic and not related to your problem, but on
>> the other hand, there's a huge chance that you have added a bunch of
>> stuff like your database file and you have zero way of tracking what you
>> have actually changed.
>>
>> Not sure if this has every worked for you, but if you have a similar
>> problem and it used to work and then suddenly didn't, using revision
>> control like git can be an enormous help.
>>
>> Do yourself a huge favor and learn how to use revision control.
>>
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4ebee094-cc84-ce01-ddfd-11ca231960d6%40stacktrace.dk
>> .
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADe59C-Sau_rAhxLJQKBmMcHDMxq_Uc12aTVo%2BRL4YoSdOf7aw%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/F91210CE-9D66-4C64-A1A0-1C6EA001DD67%40hotmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADe59C9qFczEWktkZ%3DwRnc%3Djpkx4QA9ignYmqx2hy%2B86Omj_4w%40mail.gmail.com.


Re: Deploying my Django App to Heroku

2021-04-26 Thread Ejike Enyinnaya
Hi Ayser,

Would try that and give feedback.
BR,
Ejike Chiboka
0804537; 08166516400


On Fri, Apr 23, 2021 at 1:10 PM Ayser shuhaib 
wrote:

> Make sure you create the user objects in the database before loading the
> books data
>
> On Fri, 23 Apr 2021 at 14:02, Nzekwe Isaac  wrote:
>
>> I think there's a problem with your database. Try deleting your dbsqlite
>> database and run migrations a again.
>>
>> On Fri, 23 Apr 2021, 12:50 Ejike Enyinnaya, 
>> wrote:
>>
>>> Good day Isaac,
>>>
>>> I ran makemigrations and migrate before deploy as seen in my screenshots
>>> but I am still having the same problem.
>>>
>>> Find attached my screenshots.
>>>
>>> Please what else should i look at?
>>> BR,
>>> Ejike Chiboka
>>> 0804537; 08166516400
>>>
>>>
>>> On Wed, Apr 21, 2021 at 11:44 PM Nzekwe Isaac 
>>> wrote:
>>>
 Try running makemigrations and migrations again before deploying again

 On Wed, 21 Apr 2021, 22:30 ejike@gmail.com, <
 ejike.chib...@gmail.com> wrote:

> Good day All,
>
> Please I am trying to deploy my App which uses Django/Python as the
> backend and React as the frontend to Heroku but I keep getting this error
> in the attached picture.
>
> Also attached is a screenshot of my Models.py.
>
> I would be very grateful for any assistance.
>
> Kind 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/287b1a3a-abc5-4848-ade7-2de414e7b549n%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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CACD%2B4V%3DPmh1OJbEYPW5u6vJG_aovPE-2vnHmwNGQrddbNjqHQg%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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CADe59C9cyhquav%2Be-%3Dgh59Kaj2xDeqmnUg0e4vHtJcX1VK8Ztg%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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACD%2B4VmnG7WD5%2BrJX7z0ZPjYZ9iPv6Ykc6QZw4Rb6aCDi39veA%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE0AZGKMpOoA6xHsA9j0iWy1X-8hqLM3yJm9rHDV%2BeN2DjJNNg%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADe59C_1d0Ax82gvSA-Ui65P5a%2BJaAdDgVTUJpNMVWoFJO5hjg%40mail.gmail.com.


Cannot successfully upload file in a ChannelsLiveServerTestCase server

2021-04-26 Thread Jerald Talledo
I am using ChannelsLiveServerTestCase to spin up a server for testing in 
behave for a reason that the StaticLiveServerTestCase does not support 
websockets. My issue is after changing to ChannelsLiveServerTestCase one of 
my feature which have to upload a file is now failing I am not sure if 
uploading file is supported in ChannelsLiveServerTestCase or is there a 
workaround for StaticLiveServerTestCase to support websockets.

Cheers,

Jerald

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a597a1e5-7a8f-4bd2-a112-4f0ac778fb07n%40googlegroups.com.


Front Camera and Sound recording

2021-04-26 Thread Kushal Neupane
I am developing front camera and sound recording app for one project. I do 
not have experience in these. I need some suggestion and guide for this 
work. 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6e7627ba-5bd4-4635-bd72-5a7ebc70a602n%40googlegroups.com.


Re: Front Camera and Sound recording

2021-04-26 Thread Kasper Laudrup
On 26/04/2021 13.37, Kushal Neupane wrote:
> I am developing front camera and sound recording app for one project. I
> do not have experience in these. I need some suggestion and guide for
> this work. Thank you.
>

Try to describe your project a bit more in details and how you think
this is related to Django.

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ef00570-402e-998f-210f-e49a142ea0f0%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: module not found

2021-04-26 Thread Benjamin Schollnick
Okay, it appears you are on a Macintosh….

Which is not the problem, but I ran into the same issue, and it’s most likely 
that you installed a different version of Python than what came with the OS?

try:

python3 -m pip  list | grep -i django
python2 -m pip  list | grep -i django

I would bet even money, that the python2 command comes back with django being 
installed there…

That’s because the python2 install is earlier in the path than python3

How did I work around it, well.  That’s going to be a bit different for you 
since your using a different terminal package.
(In Apple’s Terminal -> Preferences -> Profiles -> Shell -> Startup,   check 
“Run Command”, and type “source ~/” assuming it’s in the user 
home directory.  
That will run the profile file on every opening of a terminal window, and thus 
load your presets.  I suspect that Parrot Terminal will have something similar)

(Yes, I know, why not use .profile or .bash_rc, etc, etc.  Because I don’t want 
the file to be hidden.  It can be updated by any text editor, even dropbox’s 
editor in the cloud, and it’s synced without having to worry about it.)

export PATH="/opt/homebrew/opt/python@3.9/libexec/bin:$PATH"
export PATH="/opt/homebrew/lib/python3.9/site-packages:$PATH"

Which points to the python 3.9.2 install that I have from homebrew.  

I previously used aliases with mixed luck at times.. 
(eg 
alias pip='python3.9 -m pip $*'
alias pip='python3.9 -m pip $*’
)
But that broke when I went to an M1 Mac, because it wasn’t possible to reliably 
get it to distinguish between an Rosetta2 session and an M1 session.  So
I stopped using the aliases.  I did eventually resolve the M1 / Rosetta2 
session smartly, but that’s a chunk of the profile file, and probably better 
left for another time.

Hope that helps…  

> On Apr 26, 2021, at 4:35 AM, Théodore KOSSI  wrote:
> 
> can you help me for this problem?
> 
> -- 
> 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+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAKiMjQG3F-qktrhRd3mF-ucK2fn8ph55r_sKD8ue5HakuWc%3DRQ%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20E47B5D-99D9-41A6-95BF-91B606C08B07%40schollnick.net.


Re: Front Camera and Sound recording

2021-04-26 Thread Kushal Neupane
Can i inbox you?

On Mon, Apr 26, 2021 at 5:42 PM Kasper Laudrup 
wrote:

> On 26/04/2021 13.37, Kushal Neupane wrote:
> > I am developing front camera and sound recording app for one project. I
> > do not have experience in these. I need some suggestion and guide for
> > this work. Thank you.
> >
>
> Try to describe your project a bit more in details and how you think
> this is related to Django.
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9ef00570-402e-998f-210f-e49a142ea0f0%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG7V0bCE9GtVJnT0myOzuf6wDmacFwYNQi7SNkgDqVsXw%2BgZYQ%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Mike Dewhirst
Many thanks Kelvin :-)M--(Unsigned mail from my phone)
 Original message From: Kelvin Sajere  
Date: 26/4/21  18:12  (GMT+10:00) To: django-users@googlegroups.com Subject: 
Re: Problem with get_absolute_url() In your URL pattern, just indicate that the 
audit URL pattern must first go to “audit/{id}/”,and intro URL pattern to 
“intro/{id}/”. On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst 
 wrote:This code in the chemical model indicates that 
I'm trying to display two 
different views of the same chemical which has certain data in a details 
1:1 record


class Chemical(models.Model):
 ...
 def get_absolute_url(self):
 detail = self.get_detail()
 if detail and detail.report_type == INTRO:
    return f"/report/intro/{self.id}/"
 return f"/report/audit/{self.id}/"




But it doesn't matter what report_type is selected, the same report 
displays. Print statements inserted indicate the correct report_type 
branch is being executed and the correct url is being returned.

The url which displays the report is always the first of whichever of 
the following patterns is above the other ...



from django.urls import re_path
from report import views as report_views

app_name = "report"

urlpatterns = [
 re_path(r"(?P\d+)/$",
 report_views.audit,
 name="audit",
 ),
 re_path(r"(?P\d+)/$",
 report_views.intro,
 name="intro",
 ),
]




Both reports are identifiably different. In the above configuration the 
audit report always shows no matter which report_type is selected.

Where am I going wrong?

I have tried to get reverse() working by following along with ...

https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url

... but to no avail. I think if I can get it working with specified urls 
I should be able to get reverse working.

Thanks for any hints

Cheers

Mike

-- 
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au.
-- KeLLs



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6086be14.1c69fb81.48bf2.fe44SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: Front Camera and Sound recording

2021-04-26 Thread Mottaz Hegaze
I think this is more related to Javascript.

Please read about webRTC and see if this is what you are looking for.

On Mon, 26 Apr 2021, 3:11 pm Kushal Neupane,  wrote:

> Can i inbox you?
>
> On Mon, Apr 26, 2021 at 5:42 PM Kasper Laudrup 
> wrote:
>
>> On 26/04/2021 13.37, Kushal Neupane wrote:
>> > I am developing front camera and sound recording app for one project. I
>> > do not have experience in these. I need some suggestion and guide for
>> > this work. Thank you.
>> >
>>
>> Try to describe your project a bit more in details and how you think
>> this is related to Django.
>>
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/9ef00570-402e-998f-210f-e49a142ea0f0%40stacktrace.dk
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAG7V0bCE9GtVJnT0myOzuf6wDmacFwYNQi7SNkgDqVsXw%2BgZYQ%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-e737_hRXYxxeZ9o01DzC6pv5w3NRCBEtJ4s9aE1AP9CA%40mail.gmail.com.


Re: Front Camera and Sound recording

2021-04-26 Thread Kasper Laudrup
On 26/04/2021 15.11, Kushal Neupane wrote:
> Can i inbox you?
>

No, please don't, but thanks for asking.

I doubt I have the time to help you any further, I was mostly trying to
help you getting help.

If you describe what you are trying to do here in more details, it is
very likely that someone can give you some pointers on where to look for
information, especially if it is related to Django, but to be honest it
doesn't sound like that.

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0489478a-00bb-52fd-5db7-7b934ae976d4%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Front Camera and Sound recording

2021-04-26 Thread Kelvin Sajere
This has little to do with the backend of an application, so it’s is going
to be a JavaScript problem to solve. I would suggest using Django to write
the backend (REST API) using Django rest framework preferably, then use
some frontend framework like Vuejs, Reactjs, or Angular. I would suggest
Vuejs cos I use both Vuejs and Reactjs, but I find that the former is more
beginner-friendly and overall easier to learn and use.

On Mon, Apr 26, 2021 at 09:48 Kasper Laudrup  wrote:

> On 26/04/2021 15.11, Kushal Neupane wrote:
> > Can i inbox you?
> >
>
> No, please don't, but thanks for asking.
>
> I doubt I have the time to help you any further, I was mostly trying to
> help you getting help.
>
> If you describe what you are trying to do here in more details, it is
> very likely that someone can give you some pointers on where to look for
> information, especially if it is related to Django, but to be honest it
> doesn't sound like that.
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0489478a-00bb-52fd-5db7-7b934ae976d4%40stacktrace.dk
> .
>
-- 
KeLLs

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX1ZYpzU7fQ0wTFgXi_9W48Rq%2BJ-FAcp6%2Bp1UA4pfumOUQ%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
Glad I could help.
On Mon, Apr 26, 2021 at 09:21 Mike Dewhirst  wrote:

> Many thanks Kelvin :-)
>
> M
>
>
>
> --
> (Unsigned mail from my phone)
>
>
>
>  Original message 
> From: Kelvin Sajere 
> Date: 26/4/21 18:12 (GMT+10:00)
> To: django-users@googlegroups.com
> Subject: Re: Problem with get_absolute_url()
>
> In your URL pattern, just indicate that the audit URL pattern must first
> go to “audit/{id}/”,and intro URL pattern to “intro/{id}/”.
>
> On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:
>
>> This code in the chemical model indicates that I'm trying to display two
>> different views of the same chemical which has certain data in a details
>> 1:1 record
>>
>>
>> class Chemical(models.Model):
>>  ...
>>  def get_absolute_url(self):
>>  detail = self.get_detail()
>>  if detail and detail.report_type == INTRO:
>> return f"/report/intro/{self.id}/"
>>  return f"/report/audit/{self.id}/"
>>
>>
>>
>>
>> But it doesn't matter what report_type is selected, the same report
>> displays. Print statements inserted indicate the correct report_type
>> branch is being executed and the correct url is being returned.
>>
>> The url which displays the report is always the first of whichever of
>> the following patterns is above the other ...
>>
>>
>>
>> from django.urls import re_path
>> from report import views as report_views
>>
>> app_name = "report"
>>
>> urlpatterns = [
>>  re_path(r"(?P\d+)/$",
>>  report_views.audit,
>>  name="audit",
>>  ),
>>  re_path(r"(?P\d+)/$",
>>  report_views.intro,
>>  name="intro",
>>  ),
>> ]
>>
>>
>>
>>
>> Both reports are identifiably different. In the above configuration the
>> audit report always shows no matter which report_type is selected.
>>
>> Where am I going wrong?
>>
>> I have tried to get reverse() working by following along with ...
>>
>>
>> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>>
>> ... but to no avail. I think if I can get it working with specified urls
>> I should be able to get reverse working.
>>
>> Thanks for any hints
>>
>> Cheers
>>
>> Mike
>>
>> --
>> Signed email is an absolute defence against phishing. This email has
>> been signed with my private key. If you import my public key you can
>> automatically decrypt my signature and be sure it came from me. Just
>> ask and I'll send it to you. Your email software can handle signing.
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
>> .
>>
> --
> KeLLs
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6086be14.1c69fb81.48bf2.fe44SMTPIN_ADDED_MISSING%40gmr-mx.google.com
> 
> .
>
-- 
KeLLs

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX2O29yoVrSLqKNmo474DXsX-zTZ6PyLKKfRS3yfsbf1nA%40mail.gmail.com.


Re: Validate group of fields

2021-04-26 Thread Roberth Solis Martínez

Perfect, thanks a lot Derek!

El lunes, 26 de abril de 2021 a las 0:14:32 UTC-6, Derek escribió:

> The docs cover this use case:
>
>
> https://docs.djangoproject.com/en/3.2/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
>
> On Saturday, 24 April 2021 at 19:57:50 UTC+2 robert...@gmail.com wrote:
>
>>
>>
>> Hello guys!
>>
>> I've 3 fields, but I need validate it as a group, Ej:
>>
>> adults = forms.IntegerField(initial=0)
>> kids = forms.IntegerField(initial=0)
>> students = forms.IntegerField(initial=0)
>>
>> The Idea is to validate it as a group, not sure if that makes sense or if 
>> I need custom validation for that fields
>>
>> Thanks,
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5997a97d-80fb-458a-93c1-054c2c12aa80n%40googlegroups.com.


Re: module not found

2021-04-26 Thread Roberth Solis Martínez
I think is a problem with your virtual envinmont, just you need add the 
PYTHONPATH variable, like:

export PYTHONPATH="/the/path/of/python3"

I think maybe you have a global lib in yout machine maybe, try verify with 
"pip freeze --local" (without "base" env activated)

try to clean your global requirements with:

pip freeze | xargs pip uninstall -y

And then create a new env and try again maybe

El lunes, 26 de abril de 2021 a las 5:40:30 UTC-6, kossit...@gmail.com 
escribió:

> can you help me for this problem?
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/73067aed-1912-4fa1-bd9f-d33e5c97211en%40googlegroups.com.


Re: How to save a result of multiplication

2021-04-26 Thread Roberth Solis Martínez
 I'm according with Derek, but I saw you have a mix of languages and 
method, spanish and english, I'm speak spanish too, but as a best practice 
and prevent mix langagues try to use english, you know is like a standard 
or best practice in latin America

El lunes, 26 de abril de 2021 a las 0:18:20 UTC-6, Derek escribió:

> I think you have used the wrong name - "saveit" instead of "save" - also 
> have a look at the example in the docs:
>
> https://docs.djangoproject.com/en/3.2/topics/db/models/#overriding-predefined-model-methods
> and see which parameters are needed for it.
>
> On Saturday, 24 April 2021 at 20:50:15 UTC+2 encinas...@gmail.com wrote:
>
>> Hi everyone i build a web application in Django 3.1.7 and i try to do the 
>> next opeation(multiplication).
>>
>> in my models a have:
>> class Articles(models.Model):
>>  quantity = models.PositiveIntegerField()
>> cost_buy = models.DecimalField(max_digits=10, decimal_places=2)
>> total_todo = models.DecimalField(max_digits=10, decimal_places=3)
>>
>> @property
>> def total_valores(self):
>>  return (self.cost_buy*self.quantity)
>>
>> def saveit(self):
>> self.total_todo = self.total_valores
>> super (Articles, self).save()
>> __
>>
>> so, I was tried with this functions , but it's doesn't save anything
>>
>> would you give me some recomendations.
>>
>> Thank you very much in advance and I remain at your service 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2413bcb7-be67-40e0-9df6-0938576f74f8n%40googlegroups.com.


Re: Connect Django authentication to windows ldap/windows active directory

2021-04-26 Thread Swelan Auguste
Thanks much

Thankfully,

Swelan R. Auguste (Mr.)
KingShip
Technical - Information Officer
758-729-5289
https://KingShip.business.site/

On Mon, Apr 26, 2021, 05:22 Kasper Laudrup  wrote:

> On 25/04/2021 18.43, Swelan Auguste wrote:
> > I'm trying to connect my Django applications to ldap/windows active
> > directory.
> >
>
> https://django-auth-ldap.readthedocs.io/en/latest/index.html
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6354b54a-9b7b-3d87-14b6-83bd4b8dd293%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKj-cefzk0deaBM%2BfveDRSEAaM9PbKH4FMwpMydykU6NUkw6aQ%40mail.gmail.com.