Re: Function-based Views vs Class-based Views

2023-03-06 Thread Carsten Fuchs
I would like to recommend this excellent guide by Luke Plant:

https://spookylukey.github.io/django-views-the-right-way/

Best regards,
Carsten


Am 06.03.23 um 21:19 schrieb Michael Starr:
> What are the pros and cons of either method of rendering HTTP request 
> responses?
> 
> https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/
> 
> In the article above it states that CBVs are DRYer, but I don't understand 
> why. The article doesn't explain, it just states it.
> 
> The rest of the article is pretty good but it's a pretty slim introduction.
> 
> I thought many of you would like to chime in on this topic. Leave your 
> opinion below! What do you use?
> 
> Mike

-- 
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/010ccb6f-bd96-c42a-40cf-b4503708edf6%40cafu.de.


Re: Function-based Views vs Class-based Views

2023-03-06 Thread Prosper Lekia
Using classes is always a good way of promoting code usability, and 
inheritance. With class base views you don't need to reinvent the wheel. 
You can access other  Django classes and methods and reduce code 
complexity. Although most codes are encapsulated, but you can always go 
back to the Django source code for review.

On Monday, March 6, 2023 at 9:19:21 PM UTC+1 Michael Starr wrote:

> What are the pros and cons of either method of rendering HTTP request 
> responses?
>
>
> https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/
>
> In the article above it states that CBVs are DRYer, but I don't understand 
> why. The article doesn't explain, it just states it.
>
> The rest of the article is pretty good but it's a pretty slim introduction.
>
> I thought many of you would like to chime in on this topic. Leave your 
> opinion below! What do you use?
>
> Mike
>

-- 
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/d998e837-efcf-4f42-94cb-cc174135d35bn%40googlegroups.com.


Backend In Web Programming | PHP, Laravel, ASP.NET, Django

2023-03-06 Thread PATRICK OFOSU AGYEMANG
Hi everyone, currently looking for a remote challenging opportunity for my 
next career.

Kindly find attached my CV.

Let me know if any help comes up.

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/a5314098-4f11-4a64-bcdd-08e27515bc88n%40googlegroups.com.


PAT_RICK_AGYE_MANG_CV.pdf
Description: Adobe PDF document


Function-based Views vs Class-based Views

2023-03-06 Thread Michael Starr
What are the pros and cons of either method of rendering HTTP request 
responses?

https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/

In the article above it states that CBVs are DRYer, but I don't understand 
why. The article doesn't explain, it just states it.

The rest of the article is pretty good but it's a pretty slim introduction.

I thought many of you would like to chime in on this topic. Leave your 
opinion below! What do you use?

Mike

-- 
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/7bfa978b-3c11-4509-9160-799e5da43b44n%40googlegroups.com.


Re: Path Not Found Error

2023-03-06 Thread John McClain
Go to openai.com create an account (it's free)

Copy and paste this prompt

Pretend you are an expert python django developer. Pretend you have been
writing python django code for over 10 years. With your expert
knowledge writing python code please please debug this [put your manage.py
code here] now.

Make sure your place the entire set of code from manage.py file

it should debug it for you.

always use chatgpt as a resource, it's not perfect but is helpful writing
and debugging code as well as extremely helpful defining elements within
the code

cheers,

J

also can use the git

On Sun, 5 Mar 2023 at 16:00, Sunil Gyawali 
wrote:

> Give correct path in admin
>
> On Sun, Mar 5, 2023, 9:29 PM Rachit Singh  wrote:
>
>> Hi All,
>>
>>   I am learning Django for the first time and getting error "Path Not
>> Found" everytime I am running the command "python manage.py runserver". I
>> have gone through many videos & articles and have tried many things but it
>> is still not working. Can anyone help me on the same.
>> I would like to mention here that I am using a Windows Laptop having 64
>> GB Configuration with AMD Ryzem 5 version.
>>
>> I would be glad to hear your response.
>>
>> Thanks & Regards
>> Rachit
>>
>> --
>> 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/4203b244-81ca-4fa1-bb0c-ee222de71f01n%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/CAGL7DWw_-atjxe%2Ba8FaxjVCNMdDSuMS4V1dq1xnvGacfFmXTDA%40mail.gmail.com
> 
> .
>


-- 
John McClain

Cell: 085-1977-823
Skype: jmcclain0129
Email: jmcclain0...@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/CAN-hv_rqURiDxB%2BKDX%2BARVX%2BeRN54QOb85iwqQBaRUP_%3DMXa0A%40mail.gmail.com.


Migrating from ManyToOne (ForeignKey) into OneToOne in django codebase

2023-03-06 Thread Ngoc Dung Hoang
Hello everyone,

I'm working on the system with 2 very big tables (billion of records) that 
is having ManyToOne relationship with other. The size of these tables are 
nearly the same.

Lets say I have table child and parent. Each of the parent can have 
multiple child (children) records.

The child table is using `parent = models.ForeignKey(Parent, )` 
declaration.

The idea is to change the relationship into "a parent will only have one 
children, with all the legacy records existing."

>From database constraint level, I can do it pretty easy by using 
conditional check/uniq/ constraint. Even the existing indices (django 
indices) can already being used. I also create a new child_id (null for 
legacy record, uniq for new record) column for parent table, to have easier 
control on those constraints condition. This I believed it would be helpful 
for the django part below.

The django part is what I would love look for opinions.
 - I can keep the models as it is and enforce some convention 
rule/supporting method to have usage of one-to-one relationship. This seem 
to be ugly and we tent to live with the legacy records for quite some times.

- Extend the foreignkey class or its relatives/parent class, so that it can 
"behave" as close as OneToOne (for new records) and ManyToOne (for old 
records).

I digged a bit into the source code, I think my jackpot would be looking 
into the Related classes and Descriptor classes. But im pretty far from 
finish getting whole picture.

My wet dream would be something:

a_parent.child might got exception if it is legacy record (or pick the 
newest child, this part not that hard)
a_parent.children still yield list of child (easier on refactoring with 
small steps)
child1.parent = _id1; child2.parent = _id1 still work (for legacy, 
parent.child_id is Null)
parent.child = child3; parent.save(); child4.parent = parent not work (new, 
parent.child_id is not Null, probably depended on my db constraints)

Really appreciate if anyone have any opinions or hint/direction around this 
topic. 

Thanks bunch.

Andy (Dung), Hoang



-- 
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/1e5a4207-7f93-4f82-ac01-c86b97add597n%40googlegroups.com.


Re: Django Guide

2023-03-06 Thread Sumangala S N
Hello  any tell which documents good for django rest Framework  using
polls app create crud operations


On Mon, 6 Mar 2023, 07:35 Sandip Bhattacharya, 
wrote:

> There is a good guide here as well:
> https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
>
>
> - Sandip
>
> On Mar 5, 2023, at 5:20 PM, Kennedy Saavedra 
> wrote:
>
> Hello Abdullah, this is the documentation of
> Django: https://docs.djangoproject.com/en/4.1/
>
> Start from the basics
>
> El dom, 5 mar 2023 a las 10:58, Abdullah Niaz ()
> escribió:
>
>> Hello, My Name is Abdullah. I am pursuing my computer science degree & I
>> am in the second semester. I learned Python At my school. Now, I want to
>> learn Django. Can Anyone guide me
>>
>> --
>> 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/ec131a61-b003-4979-bdb5-de5466bef6b2n%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/CAL-qgjfZ4MGpHOGMaAb%3Dcdw8UPE-RHRRs3Wu5na2TDA9k-Hg0g%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/4C318C9D-D1BF-4DCC-8533-C1F28ABE8C38%40showmethesource.org
> 
> .
>

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


Re: Django Guide

2023-03-06 Thread Muneeb Mughal
Follow this for best step by step
https://www.py4e.com/
https://www.dj4e.com/

On Sun, Mar 5, 2023 at 8:59 PM Abdullah Niaz 
wrote:

> Hello, My Name is Abdullah. I am pursuing my computer science degree & I
> am in the second semester. I learned Python At my school. Now, I want to
> learn Django. Can Anyone guide me
>
> --
> 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/ec131a61-b003-4979-bdb5-de5466bef6b2n%40googlegroups.com
> 
> .
>


-- 



*RegardsMuneeb Afzal*
IT Consultant / Developer


*Cell: +92 333 5646624*

Email: muneeb.afzal...@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/CAApwjV1MPAfk1xHob8suMsM%2B2oR69mYULjgP62u-8uZ1mg6MXw%40mail.gmail.com.


Re: Django Guide

2023-03-06 Thread Chelsea Fan
Hello Abdullah, watch videos Denis Ivy in youtube

On Sun, Mar 5, 2023 at 8:58 PM Abdullah Niaz 
wrote:

> Hello, My Name is Abdullah. I am pursuing my computer science degree & I
> am in the second semester. I learned Python At my school. Now, I want to
> learn Django. Can Anyone guide me
>
> --
> 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/ec131a61-b003-4979-bdb5-de5466bef6b2n%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/CAJwZnddMo%3D0RT_OMw0fbo4quSiTtq7np6vV-W4YzJ%3D_d3%3Djkng%40mail.gmail.com.