Re: Select Boxes and Database

2023-12-02 Thread Vishesh Mangla
Hi Mike ,
You can do the following using query parameters.
Create a separate endpoint /getcities?city=... . You send the state and get
array of cities.
This endpoint would give you a json array of cities.
On selection of state on the frontend, your event listener would make api
call to above endpoint and get list of cities without a reload.

Thanks,
Vishesh




On Sun, 3 Dec, 2023, 04:22 Mike Dewhirst,  wrote:

> On 3/12/2023 7:27 am, David Merrick wrote:
>
> Hi. I can put an item from the database into a select box ie Countries of
> the World. What I want to know is saying, having chosen New Zealand from
> the select box, how do I display all the cities of New Zealand in another
> select box.
>
> The database has two tables. First one is Countries. The second table is
> cities with populations and the foreign key of Countries table.
>
> Then having chosen Auckland a city in New Zealand I want to display
>
> Country
> City
> Population
>
> In a template.
>
> I have done this in Php, Javascript and Mysql already.
>
>
> Check
> https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html
>
> Also, I recently had a similar task with companies and divisions from
> querysets and had trouble using the form.__init__() method. Here is an
> alternative approach. You can tweak what the form displays by calling a
> form method - here set_division_queryset(). In other words, you can
> populate selection choices based on code elsewhere. In my case I did it
> from within the view code like this ...
>
> # forms.py
>
> class List_Import(forms.Form):
>
> ...
>
> division = forms.ModelChoiceField(
>
> required=False,
>
> empty_label="Must select a Division",
>
> queryset=Division.objects.none(),
>
> ...
>
> def set_division_queryset(self, divqs):
>
> self.fields["division"].queryset = divqs
>
>
>
> def clean(self):
>
> cleaned_data = super().clean()
>
> selected_division = cleaned_data.get('division')
>
> available_divisions = self.fields['division'].queryset
>
> if selected_division not in available_divisions:
>
> self.add_error('division', 'Invalid choice. Please select a valid 
> division.')
>
> return cleaned_data
>
>
>
> # views.py
>
> @login_required(redirect_field_name="next")
>
> @ensure_csrf_cookie
>
> def list_import(request, template="list_import.html", context=None):
>
> ...
>
> # User model has get_company() method and Company has get_all_divisions()
>
> divqs = request.user.get_company().get_all_divisions()
>
> form.set_division_queryset(divqs)
>
> ...
>
> if request.method == 'POST':
>
> form = List_Import(request.POST, request.FILES)
>
> # because form.is_valid() needs available_divisions and we are
>
> # not using form.__init__(), we have to send divqs again
>
> form.set_division_queryset(divqs)
>
> if form.is_valid():
>
> ...
>
>
>
> Cheers
>
> Mike
>
>
>
>
> Cheers Dave
>
>
> --
> Dave Merrick
>
> TutorInvercargill
>
> http://tutorinvercargill.co.nz
>
> Daves Web Designs
>
> Website https://tutorinvercargill.co.nz/daveswebdesigns/public_html/
>
> Email merrick...@gmail.com
>
> Ph   03 216 2053
>
> Cell 027 3089 169
> --
> 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/CA%2B%3DMcKYDfzhvQ8ueCKKccYX3gcQUmfoX9NXipqf%3DDipsXPzG7g%40mail.gmail.com
> 
> .
>
>
>
> --
> 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. 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/edf8f49f-295e-4ccd-a65f-1cad7b35880e%40dewhirst.com.au
> 
> .
>

-- 
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 

Re: Django Rest framework

2023-11-13 Thread Vishesh Mangla
Use selenium

On Mon, 13 Nov, 2023, 18:48 Vishesh Mangla, 
wrote:

> Don't use postman for gui based login
>
> On Mon, 13 Nov, 2023, 18:25 Denny (Python developer), <
> denniskinan...@gmail.com> wrote:
>
>> i think the the error is from vercel itself assist me my tech guys
>>
>> On Monday, November 13, 2023 at 3:54:29 PM UTC+3 Denny (Python developer)
>> wrote:
>>
>>> i hosted my django application to vercel and am using free postgress
>>> database from railway so when i try to register the user i get an error
>>>  attached below. when i connect my endpoints with fronted of which am using
>>> React i get an error cors origin assist me please
>>>
>> --
>> 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/55866942-048b-4c25-8b81-e4d259dca936n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/55866942-048b-4c25-8b81-e4d259dca936n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x7-disfcjs434cO741LM6QqOki6gs272KVCdxXm-my9Dw%40mail.gmail.com.


Re: Django Rest framework

2023-11-13 Thread Vishesh Mangla
Don't use postman for gui based login

On Mon, 13 Nov, 2023, 18:25 Denny (Python developer), <
denniskinan...@gmail.com> wrote:

> i think the the error is from vercel itself assist me my tech guys
>
> On Monday, November 13, 2023 at 3:54:29 PM UTC+3 Denny (Python developer)
> wrote:
>
>> i hosted my django application to vercel and am using free postgress
>> database from railway so when i try to register the user i get an error
>>  attached below. when i connect my endpoints with fronted of which am using
>> React i get an error cors origin assist me please
>>
> --
> 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/55866942-048b-4c25-8b81-e4d259dca936n%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/CACaE8x4NsSgMhEcH1m8oVYrRwLyM9ck-JkuaGkjxQrmYEFP%2Byw%40mail.gmail.com.


Re: hello forks.i have in my sitting file :

2023-08-28 Thread Vishesh Mangla
Just move forward with your code , dint give attention to red squiggly at
this stage

On Mon, 28 Aug, 2023, 20:08 Vishesh Mangla, 
wrote:

> Edtudiant is French not English
>
> On Mon, 28 Aug, 2023, 19:45 Abdoulaye SENE, 
> wrote:
>
>> i don't understand
>>
>>
>> Le lun. 28 août 2023 à 14:09, Vishesh Mangla 
>> a écrit :
>>
>>> That's just a linting error, ignore it
>>>
>>> On Mon, 28 Aug, 2023, 19:35 Abdoulaye SENE, <
>>> abdoulaye.sen...@unchk.edu.sn> wrote:
>>>
>>>> [image: Cap0.PNG]
>>>> but when i make python manage.py migrate, i only see [image: Capt.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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/d1c23612-2c79-4a82-98a3-3a7eaf27fc05n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/d1c23612-2c79-4a82-98a3-3a7eaf27fc05n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACaE8x6E-RsjhwLi3QpCh6RvjzSWXT-OCztc-VPG9Za6aq4BNw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CACaE8x6E-RsjhwLi3QpCh6RvjzSWXT-OCztc-VPG9Za6aq4BNw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK9RMT1e7UQ9JvpwgQ%3D86CCNac0tJ%2BC7ZmZbesGHFhS-j8XXCw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK9RMT1e7UQ9JvpwgQ%3D86CCNac0tJ%2BC7ZmZbesGHFhS-j8XXCw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x7MAmdHFwDTJsOrX2w74VpoL6RP073enEjA0mUN7HwUZQ%40mail.gmail.com.


Re: hello forks.i have in my sitting file :

2023-08-28 Thread Vishesh Mangla
Edtudiant is French not English

On Mon, 28 Aug, 2023, 19:45 Abdoulaye SENE, 
wrote:

> i don't understand
>
>
> Le lun. 28 août 2023 à 14:09, Vishesh Mangla 
> a écrit :
>
>> That's just a linting error, ignore it
>>
>> On Mon, 28 Aug, 2023, 19:35 Abdoulaye SENE, <
>> abdoulaye.sen...@unchk.edu.sn> wrote:
>>
>>> [image: Cap0.PNG]
>>> but when i make python manage.py migrate, i only see [image: Capt.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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/d1c23612-2c79-4a82-98a3-3a7eaf27fc05n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/d1c23612-2c79-4a82-98a3-3a7eaf27fc05n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x6E-RsjhwLi3QpCh6RvjzSWXT-OCztc-VPG9Za6aq4BNw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x6E-RsjhwLi3QpCh6RvjzSWXT-OCztc-VPG9Za6aq4BNw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK9RMT1e7UQ9JvpwgQ%3D86CCNac0tJ%2BC7ZmZbesGHFhS-j8XXCw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK9RMT1e7UQ9JvpwgQ%3D86CCNac0tJ%2BC7ZmZbesGHFhS-j8XXCw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x6mrgRrXO-S%3D4Xs79bXB1RmwmVJDEeGoG3QgrTh-uocZQ%40mail.gmail.com.


Re: hello forks.i have in my sitting file :

2023-08-28 Thread Vishesh Mangla
That's just a linting error, ignore it

On Mon, 28 Aug, 2023, 19:35 Abdoulaye SENE, 
wrote:

> [image: Cap0.PNG]
> but when i make python manage.py migrate, i only see [image: Capt.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d1c23612-2c79-4a82-98a3-3a7eaf27fc05n%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/CACaE8x6E-RsjhwLi3QpCh6RvjzSWXT-OCztc-VPG9Za6aq4BNw%40mail.gmail.com.


Re: Internship and job in python and Django related

2023-07-21 Thread Vishesh Mangla
You can use fixtures to store json data to your db but it should be in a
specific format based on your model.

On Fri, 21 Jul, 2023, 22:44 Emmanuel Seth, 
wrote:

> Svp parlez en français 
>
>
> Le ven. 21 juil. 2023 à 15:14, Opeyemi Ajayi <
> opeyemichristiana.aj...@gmail.com> a écrit :
>
>> I am Christiana Ajayi from Nigeria, but I am currently based in Rwanda
>> and Nigeria.  I have just concluded development of a realtime dashboard
>> using Django, Reactjs, HTML, CSS,  D3, PostgreSQL deployed on AWS cloud.
>>
>> I also have an engineering  background and hold a Masters degree in
>> Engineering  Artificial Intelligence and Software engineering from Carnegie
>> Mellon University, and I am actively seeking remote/on-site part-time or
>> full-time opportunities that will help build on my skill in Django, Python,
>> Data Analytics and contribute to my professional growth.  I look forward
>> anyone who can accept me as a full time remote role anywhere in the world.
>> Thank you.
>>
>> Attached is my LinkedIn profile: www.linkedin.com/in/
>> opeyemichristianaajayi
>>
>>
>> Kind regards,
>> +250791591554
>> +2348133347565
>>
>> On Wed, Jun 7, 2023, 4:17 PM Shubham DJ 
>> wrote:
>>
>>> Hello, I’m Shubhang Jori from Nerul Navi Mumbai. I have been learning
>>> web development for a few months now and have gained familiarity with
>>> Django, python , MySQL, HTML  and CSS. Also I have completed 3 months
>>> internship in trivia software as a python intern. As a student , I am
>>> actively seeking Full-time job opportunities as well as
>>> internship opportunities that will provide me with hands on experience in
>>> Django , python and contribute to my professional growth.  I look forward
>>> anyone who can accept me as a full time employee as well as an intern
>>>
>>>
>>> Also I attached resume for your reference.
>>> [image: PDF file]
>>> shubham cv-1-2.pdf
>>> 
>>>
>>> --
>>> 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/CA%2B1KL_nGkLuktOc_3GEfDB1yzHCrovb_-rKJgT2trhsqnzn2rg%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/CAA0EoL37E%2BjkeUeggn%2BFoyisMtrp5OK-Du_xqO%2BHMQQW6tzLdg%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/CAMKrB%2B7AB-3aim3S-2meUQjtsOrWxwnx7pMKDhpmx4Lk7stpKw%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/CACaE8x7Pznmgqf_Ctho10pYmc1B82Q-FbBfkT5wWXTQ31osVCA%40mail.gmail.com.


Re: Re:

2023-07-19 Thread Vishesh Mangla
Very true. I am from a tier 1 University and I know how useless the degree
is . Teaches apples and people want oranges, even the CS ones.

On Wed, 19 Jul, 2023, 21:11 David Emanuel Sandoval, <
davidemanuelsando...@gmail.com> wrote:

> Just don't give up.
>
> A degree is always good, it can open more doors.
>
> But not all companies require a degree. You can even work remotely for a
> company.
> I myself got my first dev job with what would be the equivalent of a "high
> school" education.
> I never went to a university.
> But I did work a lot to improve my skills in this field.
> David Emanuel Sandoval
> <https://www.linkedin.com/in/david-emanuel-sandoval/>
> WEB DEVELOPER
> +549 3734 607102
>
> <https://linkedin.com/in/david-emanuel-sandoval/>
> <https://github.com/emasmach/>
>
>
>
>
>
> El mié, 19 jul 2023 a las 11:06, Vitor Angheben (<
> vitor_anghe...@hotmail.com>) escribió:
>
>> Hi Asim, I'm a fresh graduate in Industrial Engineer, but working with
>> software development
>>
>> Please, check my profile on my LinkedIn, if you find it interesting let
>> me know!!
>>
>> https://www.linkedin.com/in/vitor-a-5977a0b3/
>>
>> Best regards!
>> --
>> *De:* django-users@googlegroups.com  em
>> nome de Ibtsam Khan 
>> *Enviado:* terça-feira, 18 de julho de 2023 13:48
>> *Para:* django-users@googlegroups.com 
>> *Assunto:* Re:
>>
>> Hey I'm a fresh graduate from BS IT. And I'm a MERN Stack developer
>> learning Django for the web. What do u think?
>>
>> On Tue, Jul 18, 2023, 9:08 PM Asim Sulehria 
>> wrote:
>>
>> Do you have it or not ?
>> We are just hiring Django developers as fresh graduates !
>>
>>
>> On Tue, Jul 18, 2023 at 8:50 PM Vishesh Mangla 
>> wrote:
>>
>> Degree is not sufficient. Memorizing 250 DSA questions is also a
>> requirement.
>>
>> On Tue, 18 Jul, 2023, 21:18 Asim Sulehria, 
>> wrote:
>>
>> For getting a Job into industry you need a proper degree !
>> Do you have it or not?
>>
>> On Tue, Jul 18, 2023 at 8:36 PM Vishesh Mangla 
>> wrote:
>>
>> No degree teaches django or even web development.
>>
>> On Tue, Jul 18, 2023 at 8:50 PM Asim Sulehria 
>> wrote:
>>
>> Do you have a bachelor's degree in relevant field like Computer Science?/
>> Software Engineering?/ Data Science?
>>
>> On Tue, Jul 18, 2023 at 8:16 PM utibe solomon 
>> wrote:
>>
>> My number is 08102980007
>>
>> On Tue, Jul 18, 2023, 9:27 AM utibe solomon 
>> wrote:
>>
>> Dear community, I am currently looking for a remote internship on Django
>> to gain more experience in this field I currently have skills in django,
>> database testing api development with rest framework using Django channels
>> to integrate websockets and asgi connections I don't mind working for free
>> but would also be glad if I'm payed 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/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40ma

Re:

2023-07-18 Thread Vishesh Mangla
Whats the CTC you are offering?

On Tue, 18 Jul, 2023, 21:38 Asim Sulehria,  wrote:

> Do you have it or not ?
> We are just hiring Django developers as fresh graduates !
>
>
> On Tue, Jul 18, 2023 at 8:50 PM Vishesh Mangla 
> wrote:
>
>> Degree is not sufficient. Memorizing 250 DSA questions is also a
>> requirement.
>>
>> On Tue, 18 Jul, 2023, 21:18 Asim Sulehria, 
>> wrote:
>>
>>> For getting a Job into industry you need a proper degree !
>>> Do you have it or not?
>>>
>>> On Tue, Jul 18, 2023 at 8:36 PM Vishesh Mangla <
>>> manglavishes...@gmail.com> wrote:
>>>
>>>> No degree teaches django or even web development.
>>>>
>>>> On Tue, Jul 18, 2023 at 8:50 PM Asim Sulehria 
>>>> wrote:
>>>>
>>>>> Do you have a bachelor's degree in relevant field like Computer
>>>>> Science?/ Software Engineering?/ Data Science?
>>>>>
>>>>> On Tue, Jul 18, 2023 at 8:16 PM utibe solomon 
>>>>> wrote:
>>>>>
>>>>>> My number is 08102980007
>>>>>>
>>>>>> On Tue, Jul 18, 2023, 9:27 AM utibe solomon 
>>>>>> wrote:
>>>>>>
>>>>>>> Dear community, I am currently looking for a remote internship on
>>>>>>> Django to gain more experience in this field I currently have skills in
>>>>>>> django, database testing api development with rest framework using 
>>>>>>> Django
>>>>>>> channels to integrate websockets and asgi connections I don't mind 
>>>>>>> working
>>>>>>> for free but would also be glad if I'm payed 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/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPz57eENzPCyUHBT71L025d69pnGOr0-8FpdLmUk9O_k4jWwvg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAPz57eENzPCyUHBT71L025d69pnGOr0-8FpdLmUk9O_k4jWwvg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the 

Re:

2023-07-18 Thread Vishesh Mangla
Degree is not sufficient. Memorizing 250 DSA questions is also a
requirement.

On Tue, 18 Jul, 2023, 21:18 Asim Sulehria,  wrote:

> For getting a Job into industry you need a proper degree !
> Do you have it or not?
>
> On Tue, Jul 18, 2023 at 8:36 PM Vishesh Mangla 
> wrote:
>
>> No degree teaches django or even web development.
>>
>> On Tue, Jul 18, 2023 at 8:50 PM Asim Sulehria 
>> wrote:
>>
>>> Do you have a bachelor's degree in relevant field like Computer
>>> Science?/ Software Engineering?/ Data Science?
>>>
>>> On Tue, Jul 18, 2023 at 8:16 PM utibe solomon 
>>> wrote:
>>>
>>>> My number is 08102980007
>>>>
>>>> On Tue, Jul 18, 2023, 9:27 AM utibe solomon 
>>>> wrote:
>>>>
>>>>> Dear community, I am currently looking for a remote internship on
>>>>> Django to gain more experience in this field I currently have skills in
>>>>> django, database testing api development with rest framework using Django
>>>>> channels to integrate websockets and asgi connections I don't mind working
>>>>> for free but would also be glad if I'm payed 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/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPz57eENzPCyUHBT71L025d69pnGOr0-8FpdLmUk9O_k4jWwvg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPz57eENzPCyUHBT71L025d69pnGOr0-8FpdLmUk9O_k4jWwvg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x7uc5tqyS4nhVkHKdjS%2BgB%2BkkNp22US6sPBt791dnoaRg%40mail.gmail.com.


Re:

2023-07-18 Thread Vishesh Mangla
No degree teaches django or even web development.

On Tue, Jul 18, 2023 at 8:50 PM Asim Sulehria 
wrote:

> Do you have a bachelor's degree in relevant field like Computer Science?/
> Software Engineering?/ Data Science?
>
> On Tue, Jul 18, 2023 at 8:16 PM utibe solomon 
> wrote:
>
>> My number is 08102980007
>>
>> On Tue, Jul 18, 2023, 9:27 AM utibe solomon 
>> wrote:
>>
>>> Dear community, I am currently looking for a remote internship on Django
>>> to gain more experience in this field I currently have skills in django,
>>> database testing api development with rest framework using Django channels
>>> to integrate websockets and asgi connections I don't mind working for free
>>> but would also be glad if I'm payed 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/CAJkiqy7MW-44%2BaPGVbhQ2ecY25Gg51jF8eN9AEoAgrdTLOrJsQ%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/CAPz57eEgE4Q_ZittJ4m07LJvjrCwb3RUOJvmatox5E4gtf2ZBQ%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/CACaE8x65jGdWeq5shKuN9C_91hPXJj_w%2B3SznQYqvF56gPVd4A%40mail.gmail.com.


Re: Guidepath to learn django

2023-06-27 Thread Vishesh Mangla
There is a course by Corey Schauffer through which I started and rest the
libera #django channel helped.

On Tue, 27 Jun, 2023, 17:35 lewis machilika,  wrote:

>
> Did you already tried the Django official documentation?
>
> Regards,
> Lewis
> On Tue, 27 Jun 2023 at 2:02 PM, Dilmurod Dilmurod <
> dilmuroddilmurod...@gmail.com> wrote:
>
>> https://youtu.be/xO1O0-L8ze0
>>
>> Sesh, 27-iyn, 2023, 02:00 Mohit Lamba :
>>
>>> Hello
>>>
>>> I hope this email finds you well. My name is Mohit Lamba , and I am
>>> writing to express my interest in learning Django but not getting the right
>>> course that i should follow or a roadmap. I have been an avid member of
>>> this Django group for some time now and greatly admire the knowledge and
>>> expertise shared within this community.
>>>
>>>
>>> I am a recent graduate from college and wanted to learn and improve my
>>> skillset so I could learn more about the industry.
>>>
>>> It would be grateful if someone could guide me on how and where to start
>>> and how to improve.
>>> Tech stack I am familiar with:
>>> REACTJS,  Javascript, Tailwind CSS, Bootstrap, HTML,CSS,
>>> Languages : C++, C, , PYTHON, JAVASCRIPT
>>>
>>>
>>>
>>> Thank You
>>>
>>> Mohit Lamba
>>>
>>> --
>>> 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/875743ed-3d79-4ce0-a3d1-2879fb63149an%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/CANHuyY%2BCJXohbvWU0nbjrj_ZwPFASRAfEJ517zBwa_21JP4DWw%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/CAGRTm9H1LXVD%3Dy0%2BtWypsLqG-3iNvpK%2BTC8Mi1wCo1dZMdCkYQ%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/CACaE8x6JEjnX9%2BKCsgUQ92tYU7KzUwm%2BDE3duGQhEq%2BHdF5Unw%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-14 Thread Vishesh Mangla
One important question, what webserver are you using?

On Wed, Jun 14, 2023 at 10:34 AM Shaheed Haque 
wrote:

> Have you tried using
> https://django-debug-toolbar.readthedocs.io/en/latest/? It can be a
> little fiddling about with, but it's time based profiling support has been
> invaluable in tracking down a few critical queries.
>
> On Sun, 11 Jun 2023, 20:00 Kunal Mittal,  wrote:
>
>> I've a django application serving 10k+ users daily, that application has
>> everything to be on the top of performance metrics but still some API's
>> have high latencies, application serves lots of pages with nice css and
>> various images, on most the pages they are being served by s3 while on some
>> it's via django static files. We have implemented caching on akamai for
>> every static file that application serves, whenever that cache disappears
>> latency of each and every API spikes exponentially, at that time even
>> loading metrics becomes a pain, server does not pick those requests. Can
>> anyone suggest what's going on 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%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/CAHAc2je1B-m24UtOCjfK_VwQj1TYrdQH8czBS-bLotPsx1hGyw%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/CACaE8x6HB%3DVB2bvYCtSbszcEELXqaojWVVKW1kZj0BKguF9mMQ%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-13 Thread Vishesh Mangla
https://medium.com/kami-people/profiling-in-django-9f4d403a394f

On Tue, Jun 13, 2023 at 11:44 PM Vishesh Mangla 
wrote:

> Try profiling your django code
>
> On Tue, 13 Jun, 2023, 23:19 Nisha Jose,  wrote:
>
>> Try to check any N+1 issue available in the code.
>>
>>
>> On Mon, Jun 12, 2023 at 9:46 AM Vishesh Mangla 
>> wrote:
>>
>>> Try cdn, and use Statics based on screen size
>>>
>>> On Mon, 12 Jun, 2023, 11:14 Vishesh Mangla, 
>>> wrote:
>>>
>>>> Lmao
>>>>
>>>> On Mon, 12 Jun, 2023, 10:54 Kunal Mittal, 
>>>> wrote:
>>>>
>>>>> I have read various docs on performance optimization, but still not
>>>>> getting what's taking to render templates and what's the bottleneck when
>>>>> cache get cleared, I takes around 12 hours for application to run smoothly
>>>>> after that event.
>>>>>
>>>>> On Monday, June 12, 2023 at 10:53:06 AM UTC+5:30 Kunal Mittal wrote:
>>>>>
>>>>>> Hi, we are using Django 1.8.5
>>>>>> Architecture is like -  Nginx side car -> wsgi server (gunicorn) ->
>>>>>> application
>>>>>> On Monday, June 12, 2023 at 1:06:18 AM UTC+5:30 Mz Gz wrote:
>>>>>>
>>>>>>> What server do you use ?
>>>>>>>
>>>>>>> On Sun, 11 Jun 2023, 10:00 pm Kunal Mittal, 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I've a django application serving 10k+ users daily, that
>>>>>>>> application has everything to be on the top of performance metrics but
>>>>>>>> still some API's have high latencies, application serves lots of pages 
>>>>>>>> with
>>>>>>>> nice css and various images, on most the pages they are being served 
>>>>>>>> by s3
>>>>>>>> while on some it's via django static files. We have implemented 
>>>>>>>> caching on
>>>>>>>> akamai for every static file that application serves, whenever that 
>>>>>>>> cache
>>>>>>>> disappears latency of each and every API spikes exponentially, at that 
>>>>>>>> time
>>>>>>>> even loading metrics becomes a pain, server does not pick those 
>>>>>>>> requests.
>>>>>>>> Can anyone suggest what's going on 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...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACaE8x4G%3D14_4fw8LELef_FYzRnASFiSdHqqZm47_1k6CuBxgg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CACaE8x4G%3D14_4fw8LELef_FYzRnASFiSdHqqZm47_1k6CuBxgg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANXPAinVh-P_3sPOzNu5rXbEtQS_EfbvOActjrgjw0%3DybMhYYQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CANXPAinVh-P_3sPOzNu5rXbEtQS_EfbvOActjrgjw0%3DybMhYYQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x7gmY47Q2aG_%3DSZJ-yW8Vu%2Bx6dAbfzXce%2BYT%3DVvKTuxsw%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-13 Thread Vishesh Mangla
Try profiling your django code

On Tue, 13 Jun, 2023, 23:19 Nisha Jose,  wrote:

> Try to check any N+1 issue available in the code.
>
>
> On Mon, Jun 12, 2023 at 9:46 AM Vishesh Mangla 
> wrote:
>
>> Try cdn, and use Statics based on screen size
>>
>> On Mon, 12 Jun, 2023, 11:14 Vishesh Mangla, 
>> wrote:
>>
>>> Lmao
>>>
>>> On Mon, 12 Jun, 2023, 10:54 Kunal Mittal, 
>>> wrote:
>>>
>>>> I have read various docs on performance optimization, but still not
>>>> getting what's taking to render templates and what's the bottleneck when
>>>> cache get cleared, I takes around 12 hours for application to run smoothly
>>>> after that event.
>>>>
>>>> On Monday, June 12, 2023 at 10:53:06 AM UTC+5:30 Kunal Mittal wrote:
>>>>
>>>>> Hi, we are using Django 1.8.5
>>>>> Architecture is like -  Nginx side car -> wsgi server (gunicorn) ->
>>>>> application
>>>>> On Monday, June 12, 2023 at 1:06:18 AM UTC+5:30 Mz Gz wrote:
>>>>>
>>>>>> What server do you use ?
>>>>>>
>>>>>> On Sun, 11 Jun 2023, 10:00 pm Kunal Mittal, 
>>>>>> wrote:
>>>>>>
>>>>>>> I've a django application serving 10k+ users daily, that application
>>>>>>> has everything to be on the top of performance metrics but still some 
>>>>>>> API's
>>>>>>> have high latencies, application serves lots of pages with nice css and
>>>>>>> various images, on most the pages they are being served by s3 while on 
>>>>>>> some
>>>>>>> it's via django static files. We have implemented caching on akamai for
>>>>>>> every static file that application serves, whenever that cache 
>>>>>>> disappears
>>>>>>> latency of each and every API spikes exponentially, at that time even
>>>>>>> loading metrics becomes a pain, server does not pick those requests. Can
>>>>>>> anyone suggest what's going on 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...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x4G%3D14_4fw8LELef_FYzRnASFiSdHqqZm47_1k6CuBxgg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x4G%3D14_4fw8LELef_FYzRnASFiSdHqqZm47_1k6CuBxgg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANXPAinVh-P_3sPOzNu5rXbEtQS_EfbvOActjrgjw0%3DybMhYYQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANXPAinVh-P_3sPOzNu5rXbEtQS_EfbvOActjrgjw0%3DybMhYYQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x77J-YC47zf%2BJTW-L6f2y2uKZFm9wGoMn-HpMu3T5ALmg%40mail.gmail.com.


Re: Translating a Django website

2023-06-12 Thread Vishesh Mangla
Why don't you use Google translate api?

On Mon, 12 Jun, 2023, 14:36 אורי,  wrote:

> Hi,
>
> I have a website in English and Hebrew which I want to translate into
> French. The website has about 3 or 4 .po files in each language, which
> should be translated. But the translators I talked to want to have it in a
> Word or Excel format. Is it possible to export .po files into Excel formats
> or CSV? Notice that some translations include context (for example male or
> female), and the context itself should be used too. I think it's better to
> send them the Hebrew .po files which contain English and Hebrew, and then
> they will translate it to French. So is it possible to convert it into CSV
> format?
>
> Thanks,
> Uri Rodberg, Speedy Net.
> אורי
> u...@speedy.net
>
> --
> 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/CABD5YeE06_ZTLvJPZU-Y4RqoF3jpKBQN4cWad8tybZwEUsk_zA%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/CACaE8x6WG5FymwuJuuwuycifiPdY5Gjcr7TYprpGOdTJaFimhQ%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-11 Thread Vishesh Mangla
Try cdn, and use Statics based on screen size

On Mon, 12 Jun, 2023, 11:14 Vishesh Mangla, 
wrote:

> Lmao
>
> On Mon, 12 Jun, 2023, 10:54 Kunal Mittal,  wrote:
>
>> I have read various docs on performance optimization, but still not
>> getting what's taking to render templates and what's the bottleneck when
>> cache get cleared, I takes around 12 hours for application to run smoothly
>> after that event.
>>
>> On Monday, June 12, 2023 at 10:53:06 AM UTC+5:30 Kunal Mittal wrote:
>>
>>> Hi, we are using Django 1.8.5
>>> Architecture is like -  Nginx side car -> wsgi server (gunicorn) ->
>>> application
>>> On Monday, June 12, 2023 at 1:06:18 AM UTC+5:30 Mz Gz wrote:
>>>
>>>> What server do you use ?
>>>>
>>>> On Sun, 11 Jun 2023, 10:00 pm Kunal Mittal, 
>>>> wrote:
>>>>
>>>>> I've a django application serving 10k+ users daily, that application
>>>>> has everything to be on the top of performance metrics but still some 
>>>>> API's
>>>>> have high latencies, application serves lots of pages with nice css and
>>>>> various images, on most the pages they are being served by s3 while on 
>>>>> some
>>>>> it's via django static files. We have implemented caching on akamai for
>>>>> every static file that application serves, whenever that cache disappears
>>>>> latency of each and every API spikes exponentially, at that time even
>>>>> loading metrics becomes a pain, server does not pick those requests. Can
>>>>> anyone suggest what's going on 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...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/e07d773a-db82-4a09-b73c-f36ac90322b1n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x4G%3D14_4fw8LELef_FYzRnASFiSdHqqZm47_1k6CuBxgg%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-11 Thread Vishesh Mangla
Lmao

On Mon, 12 Jun, 2023, 10:54 Kunal Mittal,  wrote:

> I have read various docs on performance optimization, but still not
> getting what's taking to render templates and what's the bottleneck when
> cache get cleared, I takes around 12 hours for application to run smoothly
> after that event.
>
> On Monday, June 12, 2023 at 10:53:06 AM UTC+5:30 Kunal Mittal wrote:
>
>> Hi, we are using Django 1.8.5
>> Architecture is like -  Nginx side car -> wsgi server (gunicorn) ->
>> application
>> On Monday, June 12, 2023 at 1:06:18 AM UTC+5:30 Mz Gz wrote:
>>
>>> What server do you use ?
>>>
>>> On Sun, 11 Jun 2023, 10:00 pm Kunal Mittal,  wrote:
>>>
 I've a django application serving 10k+ users daily, that application
 has everything to be on the top of performance metrics but still some API's
 have high latencies, application serves lots of pages with nice css and
 various images, on most the pages they are being served by s3 while on some
 it's via django static files. We have implemented caching on akamai for
 every static file that application serves, whenever that cache disappears
 latency of each and every API spikes exponentially, at that time even
 loading metrics becomes a pain, server does not pick those requests. Can
 anyone suggest what's going on 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%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/e07d773a-db82-4a09-b73c-f36ac90322b1n%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/CACaE8x63fZiLs_rkSZEYEi8upnp_9Ljc_Z4cJz56eTGJdbDJXA%40mail.gmail.com.


Re: I want help from senior python/django developer to create one django assignment project.

2023-06-05 Thread Vishesh Mangla
Ya, who ll open up Linux for him 

On Mon, 5 Jun, 2023, 22:43 Lakshyaraj Dash, 
wrote:

> Bro please send in pdf format so that it will be possible to open in mobile
>
> On Mon, 5 Jun, 2023, 22:35 AKHIL KORE,  wrote:
>
>> Hi django developer group.
>>
>>  I'm from india. I got one django assignment from xyz comapny. But i
>> can't how to create  that logical way. Please help me. Below file is that
>> assignment. Please open and see it.
>> can any one send that type of related previous projects code.
>>
>> --
>> 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/7988a2b0-95af-4c75-92db-670e541b9af6n%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/CAF7qQgCBQ9jkBb%3DX0TvaSZMcqBRoKYEWM3XFMTddmhBvGDxO8A%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/CACaE8x5JW1bfPvmbWLp-7qmP3Ya-5%3DP30vLkCgj8sc-e9fVvDg%40mail.gmail.com.


Re: JOB | Lead Platform Engineer (Singapore/London)

2023-05-26 Thread Vishesh Mangla
Please be careful whilst looking at the random jobs in this group. Afaik,
these are unverified. If they require you to relocate then think 10 times
before taking any action.

On Sat, May 27, 2023 at 1:32 AM Sakshi  wrote:

> Hi I have around 3 years of experience with python.can you consider my
> profile??
>
> On Fri, 26 May, 2023, 5:24 pm James Tobin,  wrote:
>
>> Hello, I'm working with an employer that is looking to hire someone in
>> London or Singapore to take lead on the modernisation of their
>> on-premises environment.  Python experience is *mandatory*.
>> Consequently, I had hoped that some members of this group may like to
>> discuss.  I can be reached using "JamesBTobin (at) Gmail (dot) Com".
>> Kind regards, James
>>
>> --
>> 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/6cc40ec3-dc19-4dab-82da-bbc43035b154n%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/CADJuPLUs3Y%2BK1%2BU_q4K-N1XPBe_axcDAAHko5CV_1nnmY4jwLg%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/CACaE8x67xpT4o1Gu9xhWdhbnBV%2BWrgSSKkNmZPfQhcqmU6AYHA%40mail.gmail.com.


Re: Tokenized Authentication for subdomains

2023-05-26 Thread Vishesh Mangla
https://stackoverflow.com/a/62782197/4213362

On Thu, May 25, 2023 at 7:35 AM André Lewis  wrote:

> Hi,
>
> I'm currently working on a project with subdomains, and I wanted to
> authenticate the user across the site, regardless of the url. I did some
> digging and found some ideas for implementing Oauth/openID connect
> authentication in Django (wasn't much help). Seeing, I don't intend on
> using third-party providers for this one.
>
>  I have an idea of how it should work 'on paper', but it gets fuzzy when I
> start thinking about server-end verification; how the token is generated,
> and how I get access to it for later verification.
>
> Any suggestions, would be really helpful?
> Thanks in advance.
>
> --
> 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/CAJN6x_gEgbE87yg0NpzhS_Rr_BEwWwo7HkWT02JRccfCfWS2Gw%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/CACaE8x4AXKD7AUqk2%2B4Ck_%2Bp-zc5jOW%2BVDDXF7NMVLm6%3DYkW%3DQ%40mail.gmail.com.


Re: Tokenized Authentication for subdomains

2023-05-24 Thread Vishesh Mangla
use nginx as reverse proxy

On Thu, 25 May, 2023, 07:35 André Lewis,  wrote:

> Hi,
>
> I'm currently working on a project with subdomains, and I wanted to
> authenticate the user across the site, regardless of the url. I did some
> digging and found some ideas for implementing Oauth/openID connect
> authentication in Django (wasn't much help). Seeing, I don't intend on
> using third-party providers for this one.
>
>  I have an idea of how it should work 'on paper', but it gets fuzzy when I
> start thinking about server-end verification; how the token is generated,
> and how I get access to it for later verification.
>
> Any suggestions, would be really helpful?
> Thanks in advance.
>
> --
> 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/CAJN6x_gEgbE87yg0NpzhS_Rr_BEwWwo7HkWT02JRccfCfWS2Gw%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/CACaE8x6BmDOopm%2BF9fwMHLn3e3FiskdASrvTOMj%2BJEbxjrrC9Q%40mail.gmail.com.


Re: upload folder

2023-05-19 Thread Vishesh Mangla
https://api.video/blog/tutorials/uploading-large-files-with-javascript/
On Fri, 19 May, 2023, 18:29 Karuppasamy T, 
wrote:

> how to upload folder and sub directory and including sub files maximum
> 5gb  please help 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/de381e03-816c-4b90-a80b-5062025af9afn%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/CACaE8x5Hc8SM61gT4XKZhGtZAkK7ZhAWR8B4UOjQACLfNjsGaw%40mail.gmail.com.


Re: django smtp.gmail error

2023-05-17 Thread Vishesh Mangla
https://medium.com/@manglavishesh64/using-gmail-smtp-with-3rd-party-apps-be3e15f4a7fc

On Wed, 17 May, 2023, 19:50 Chelsea Fan, 
wrote:

> how can I find your medium stories?
>
> On Wed, May 17, 2023 at 7:09 PM Vishesh Mangla 
> wrote:
>
>> You can't use SMTP with Google.
>> You need to use oauth through Google cloud platform. Actually there is
>> one way to use SMTP with Google to login through third party apps. Check
>> out my stories on medium. I had written one for a solution.
>>
>> On Wed, 17 May, 2023, 19:36 Vishesh Mangla, 
>> wrote:
>>
>>> Are you logging through Gmail?
>>>
>>> On Wed, 17 May, 2023, 19:35 Chelsea Fan, 
>>> wrote:
>>>
>>>> I deleted all passwords and thhen created new password but nothig was
>>>> happen
>>>>
>>>> On Wed, May 17, 2023 at 6:54 PM Lakshyaraj Dash <
>>>> dashlakshyaraj2...@gmail.com> wrote:
>>>>
>>>>> First verify if the email through which the app password was created
>>>>> is same or different. If different then it will not work.
>>>>> OR
>>>>> Please recreate a new app and copy the password again and enter.
>>>>>
>>>>> Thanks and Regards
>>>>> Lakshyaraj Dash
>>>>>
>>>>> On Wed, May 17, 2023, 19:17 Chelsea Fan 
>>>>> wrote:
>>>>>
>>>>>> how can I solve this? I enabled 2fa then created app password but it
>>>>>> does not work.
>>>>>> smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password
>>>>>> not accepted. Learn more at\n5.7.8
>>>>>> https://support.google.com/mail/?p=BadCredentials
>>>>>> ev21-20020a17090729d500b00965b416585bsm12337451ejc.118 - gsmtp')
>>>>>>
>>>>>> --
>>>>>> 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/CAJwZndce5fV-BuwnLUTrU73e%3DvQ_QbArGoyf6qSnQr4wyxHQOw%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAJwZndce5fV-BuwnLUTrU73e%3DvQ_QbArGoyf6qSnQr4wyxHQOw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/CAF7qQgBwYUz8HaRizz_4AVU4rwNcYUX8v1Au%2BWN-UNqHdc1LdQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAF7qQgBwYUz8HaRizz_4AVU4rwNcYUX8v1Au%2BWN-UNqHdc1LdQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAJwZnddw2dpYE35Ww_5W%2BUCQiDvdTzZ1B7ojNry50aBkH-efzA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAJwZnddw2dpYE35Ww_5W%2BUCQiDvdTzZ1B7ojNry50aBkH-efzA%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x4165he-ofirdmyqtc-BksB18dEcKWebnzU2j2h6%3Dhymg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x4165he-ofirdmyqtc-BksB18dEcKWebnzU2j2h6%3Dhymg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJwZndcYssDjkSc%2BFGCpy%3DWVPp6R%2Bd0a8Lo1puUrvDAubErbhw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJwZndcYssDjkSc%2BFGCpy%3DWVPp6R%2Bd0a8Lo1puUrvDAubErbhw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x4Dr%3Dtb_fGKG5TnidLyqo6mApG0autaxyoRuRgM9nevjA%40mail.gmail.com.


Re: django smtp.gmail error

2023-05-17 Thread Vishesh Mangla
You can't use SMTP with Google.
You need to use oauth through Google cloud platform. Actually there is one
way to use SMTP with Google to login through third party apps. Check out my
stories on medium. I had written one for a solution.

On Wed, 17 May, 2023, 19:36 Vishesh Mangla, 
wrote:

> Are you logging through Gmail?
>
> On Wed, 17 May, 2023, 19:35 Chelsea Fan, 
> wrote:
>
>> I deleted all passwords and thhen created new password but nothig was
>> happen
>>
>> On Wed, May 17, 2023 at 6:54 PM Lakshyaraj Dash <
>> dashlakshyaraj2...@gmail.com> wrote:
>>
>>> First verify if the email through which the app password was created is
>>> same or different. If different then it will not work.
>>> OR
>>> Please recreate a new app and copy the password again and enter.
>>>
>>> Thanks and Regards
>>> Lakshyaraj Dash
>>>
>>> On Wed, May 17, 2023, 19:17 Chelsea Fan 
>>> wrote:
>>>
>>>> how can I solve this? I enabled 2fa then created app password but it
>>>> does not work.
>>>> smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password
>>>> not accepted. Learn more at\n5.7.8
>>>> https://support.google.com/mail/?p=BadCredentials
>>>> ev21-20020a17090729d500b00965b416585bsm12337451ejc.118 - gsmtp')
>>>>
>>>> --
>>>> 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/CAJwZndce5fV-BuwnLUTrU73e%3DvQ_QbArGoyf6qSnQr4wyxHQOw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAJwZndce5fV-BuwnLUTrU73e%3DvQ_QbArGoyf6qSnQr4wyxHQOw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAF7qQgBwYUz8HaRizz_4AVU4rwNcYUX8v1Au%2BWN-UNqHdc1LdQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAF7qQgBwYUz8HaRizz_4AVU4rwNcYUX8v1Au%2BWN-UNqHdc1LdQ%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJwZnddw2dpYE35Ww_5W%2BUCQiDvdTzZ1B7ojNry50aBkH-efzA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAJwZnddw2dpYE35Ww_5W%2BUCQiDvdTzZ1B7ojNry50aBkH-efzA%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x4165he-ofirdmyqtc-BksB18dEcKWebnzU2j2h6%3Dhymg%40mail.gmail.com.


Re: django smtp.gmail error

2023-05-17 Thread Vishesh Mangla
Are you logging through Gmail?

On Wed, 17 May, 2023, 19:35 Chelsea Fan, 
wrote:

> I deleted all passwords and thhen created new password but nothig was
> happen
>
> On Wed, May 17, 2023 at 6:54 PM Lakshyaraj Dash <
> dashlakshyaraj2...@gmail.com> wrote:
>
>> First verify if the email through which the app password was created is
>> same or different. If different then it will not work.
>> OR
>> Please recreate a new app and copy the password again and enter.
>>
>> Thanks and Regards
>> Lakshyaraj Dash
>>
>> On Wed, May 17, 2023, 19:17 Chelsea Fan 
>> wrote:
>>
>>> how can I solve this? I enabled 2fa then created app password but it
>>> does not work.
>>> smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not
>>> accepted. Learn more at\n5.7.8
>>> https://support.google.com/mail/?p=BadCredentials
>>> ev21-20020a17090729d500b00965b416585bsm12337451ejc.118 - gsmtp')
>>>
>>> --
>>> 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/CAJwZndce5fV-BuwnLUTrU73e%3DvQ_QbArGoyf6qSnQr4wyxHQOw%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/CAF7qQgBwYUz8HaRizz_4AVU4rwNcYUX8v1Au%2BWN-UNqHdc1LdQ%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/CAJwZnddw2dpYE35Ww_5W%2BUCQiDvdTzZ1B7ojNry50aBkH-efzA%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/CACaE8x6m0YXk3o%3Df360a5F6x7sWOStSwAqOH7skHYKMGuWj9qg%40mail.gmail.com.


Re:

2023-05-11 Thread Vishesh Mangla
Use request module to make a request from django if you meant that
otherwise your question is unclear

On Fri, 12 May, 2023, 10:21 Karthik V A,  wrote:

> Hello friends, Is there any inbuilt function in django for API. Without
> using REST framework and request.
>
> --
> 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/CAHjRVdSmDv28sXqf1FkPLXBooUKWpOGtSR6LZFxLVuU8w3c_PA%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/CACaE8x57rYB4MGAWb95R9zS9MpcFmvZBT47qQ2FX2F9vLB%2B7LQ%40mail.gmail.com.


Re: PDF generation with xhtml2Pdf in Django

2023-05-11 Thread Vishesh Mangla
why don't you just use weasyprint?

On Thu, May 11, 2023 at 11:48 PM Oduwa Imade  wrote:

> Hello everyone, I would like to thank you for your concern and support
> regarding the issue I faced earlier. I am happy to inform you that I was
> able to resolve the error. I discovered that the xhtml2pdf library was
> unable to process or parse an HTML file that contained a table. I'm not
> exactly sure why this was causing an error:
> ValueError at /RecruitmentApp/createcvpdf
>  with cell(0,0) containing
> ' size=x' data error - 23 rows in data
> but 22 row heights
>
> To fix the problem, I removed the table element from my HTML file and used
>  and  elements instead, while also utilizing Django tags for a
> structured layout. I was then able to successfully render the PDF.
>
> On Thursday, May 11, 2023 at 6:54:04 PM UTC+1 Abdulrahman Abbas wrote:
>
>> Send the error details
>>
>> On Thu, May 11, 2023, 14:41 Michael Edet  wrote:
>>
>>> How???
>>>
>>> On Thu, 11 May 2023, 14:25 Vishesh Mangla,  wrote:
>>>
>>>> Try weasyprint
>>>>
>>>> On Thu, 11 May, 2023, 18:38 Oduwa Imade,  wrote:
>>>>
>>>>> Hello Guys! I am trying to generate a Pdf doc(reading data from a
>>>>> database) on Django with xhtml2pdf library. but i encounter this error 
>>>>> when
>>>>> i hit the 'Create PDF' button:
>>>>>
>>>>> ValueError at /RecruitmentApp/createcvpdf
>>>>>  with cell(0,0) containing
>>>>> ' size=x' data error - 23 rows in
>>>>> data but 22 row heights .
>>>>>  ..am not sure what the error is saying or what am doing wrong.
>>>>> Can anyone assist please with ideas on how to tackle this issue?
>>>>>
>>>>> This is the method in the views.py that handles the pdf creation:
>>>>>
>>>>> def createPdf(requst):
>>>>>   #jobseekerID = request.session['rec_ID']
>>>>>   jobseekerID = 2
>>>>>
>>>>>   cv = CV.objects.select_related('f_key_REC').get(f_key_REC =
>>>>> jobseekerID)
>>>>>   skill = Skill.objects.select_related('fk_sCV').get(fk_sCV =
>>>>> cv.id)
>>>>>   qualification = Qualification.objects.select_related(
>>>>> 'fk_qCV').get(fk_qCV=cv.id)
>>>>>   certification = Certification.objects.select_related(
>>>>> 'fk_cCV').get(fk_cCV = cv.id)
>>>>>   experience = Experience.objects.select_related('fk_eCV').
>>>>> filter(fk_eCV = cv.id)
>>>>>
>>>>>   template_path = 'Recruitment_App/createpdf_cv.html'
>>>>>   context = {
>>>>>"cv": cv,
>>>>>"skills" : skill,
>>>>>"qualifications": qualification,
>>>>>"certification": certification,
>>>>>"experience": experience
>>>>>   }
>>>>>   print (cv)
>>>>>   print(skill)
>>>>>   print(experience)
>>>>>   response = HttpResponse(content_type='application/pdf')
>>>>>   response['Content-Disposition'] = 'filename="cv001.pdf"'
>>>>>   template = get_template(template_path)
>>>>>   html = template.render(context)
>>>>>
>>>>>   pisa_status = pisa.CreatePDF(html, dest=response)
>>>>>   print(template)
>>>>>   if pisa_status.err:
>>>>>return HttpResponse('We had some errors ' + html +
>>>>> '')
>>>>>   return response
>>>>>
>>>>>
>>>>> --
>>>>> 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/42a1e5d3-718b-4a09-8dbd-b035756765c9n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/42a1e5d3-718b-4a09-8dbd-b035756765c9n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>

Re: PDF generation with xhtml2Pdf in Django

2023-05-11 Thread Vishesh Mangla
Try weasyprint

On Thu, 11 May, 2023, 18:38 Oduwa Imade,  wrote:

> Hello Guys! I am trying to generate a Pdf doc(reading data from a
> database) on Django with xhtml2pdf library. but i encounter this error when
> i hit the 'Create PDF' button:
>
> ValueError at /RecruitmentApp/createcvpdf
>  with cell(0,0) containing
> ' size=x' data error - 23 rows in data
> but 22 row heights .
>  ..am not sure what the error is saying or what am doing wrong. Can
> anyone assist please with ideas on how to tackle this issue?
>
> This is the method in the views.py that handles the pdf creation:
>
> def createPdf(requst):
>   #jobseekerID = request.session['rec_ID']
>   jobseekerID = 2
>
>   cv = CV.objects.select_related('f_key_REC').get(f_key_REC =
> jobseekerID)
>   skill = Skill.objects.select_related('fk_sCV').get(fk_sCV = cv
> .id)
>   qualification = Qualification.objects.select_related('fk_qCV').
> get(fk_qCV=cv.id)
>   certification = Certification.objects.select_related('fk_cCV').
> get(fk_cCV = cv.id)
>   experience = Experience.objects.select_related('fk_eCV').filter(
> fk_eCV = cv.id)
>
>   template_path = 'Recruitment_App/createpdf_cv.html'
>   context = {
>"cv": cv,
>"skills" : skill,
>"qualifications": qualification,
>"certification": certification,
>"experience": experience
>   }
>   print (cv)
>   print(skill)
>   print(experience)
>   response = HttpResponse(content_type='application/pdf')
>   response['Content-Disposition'] = 'filename="cv001.pdf"'
>   template = get_template(template_path)
>   html = template.render(context)
>
>   pisa_status = pisa.CreatePDF(html, dest=response)
>   print(template)
>   if pisa_status.err:
>return HttpResponse('We had some errors ' + html +
> '')
>   return response
>
>
> --
> 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/42a1e5d3-718b-4a09-8dbd-b035756765c9n%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/CACaE8x6rJ6ie3dAZPaJYcaJLn7P1Mu%3D7Q%2B6eWxvo%3D6KuSCAxEw%40mail.gmail.com.


Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
If I understood the error right.

On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla 
wrote:

> Probably this would help:
> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>
> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
> django-users@googlegroups.com> wrote:
>
>> Sorry Vishesh, thanks for the quick answer but I have no idea what you
>> mean.
>>
>> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>>
>>> False or True check for yourself.
>>>
>>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla, 
>>> wrote:
>>>
>>>> It looks like you are passing a null but null=False is not set
>>>>
>>>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>>>> django...@googlegroups.com> wrote:
>>>>
>>>>> I'm trying to test a django-admin command and don't understand why the
>>>>> tests give errors on the code while the code works as expected.
>>>>>
>>>>> I'm under the impression that the *raise CommandError* is ignored by
>>>>> the test, but don't understand why this would be.
>>>>>
>>>>> Please help.
>>>>>
>>>>> Running the code shows:
>>>>>
>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>>> populate_source 0
>>>>>
>>>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>>>
>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>>> populate_source 1
>>>>>
>>>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>>>
>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>>> populate_source 1
>>>>>
>>>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>>>
>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>>> populate_source 7
>>>>>
>>>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>>>
>>>>> Running the tests shows
>>>>>
>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>>> test tests.test_sources_app_command_populate
>>>>>
>>>>> Found 3 test(s).
>>>>>
>>>>> Creating test database for alias 'default'...
>>>>>
>>>>> System check identified no issues (0 silenced).
>>>>>
>>>>> EEE
>>>>>
>>>>> ==
>>>>>
>>>>> ERROR: test_command_output_been_there
>>>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>>>
>>>>> Test for failure: in_use = True.
>>>>>
>>>>> --
>>>>>
>>>>> Traceback (most recent call last):
>>>>>
>>>>>   File
>>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>>> line 89, in _execute
>>>>>
>>>>> return self.cursor.execute(sql, params)
>>>>>
>>>>>
>>>>>
>>>>>   File
>>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>>> line 328, in execute
>>>>>
>>>>> return super().execute(query, params)
>>>>>
>>>>>^^
>>>>>
>>>>> sqlite3.IntegrityError: NOT NULL constraint failed:
>>>>> domain_sources_app_characternumber.number_of_combinations
>>>>>
>>>>>
>>>>> The above exception was the direct cause of the following exception:
>>>>>
>>>>>
>>>>> Traceback (most recent call last):
>>>>>
>>>>>   File
>>>>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>>>> line 30, in test_command_output_been_there
>>>>>
>>>>> thingy.save(

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
Probably this would help:
https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django

On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
django-users@googlegroups.com> wrote:

> Sorry Vishesh, thanks for the quick answer but I have no idea what you
> mean.
>
> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>
>> False or True check for yourself.
>>
>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  wrote:
>>
>>> It looks like you are passing a null but null=False is not set
>>>
>>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>>> django...@googlegroups.com> wrote:
>>>
>>>> I'm trying to test a django-admin command and don't understand why the
>>>> tests give errors on the code while the code works as expected.
>>>>
>>>> I'm under the impression that the *raise CommandError* is ignored by
>>>> the test, but don't understand why this would be.
>>>>
>>>> Please help.
>>>>
>>>> Running the code shows:
>>>>
>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>> populate_source 0
>>>>
>>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>>
>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>> populate_source 1
>>>>
>>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>>
>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>> populate_source 1
>>>>
>>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>>
>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>>>> populate_source 7
>>>>
>>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>>
>>>> Running the tests shows
>>>>
>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
>>>> tests.test_sources_app_command_populate
>>>>
>>>> Found 3 test(s).
>>>>
>>>> Creating test database for alias 'default'...
>>>>
>>>> System check identified no issues (0 silenced).
>>>>
>>>> EEE
>>>>
>>>> ==
>>>>
>>>> ERROR: test_command_output_been_there
>>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>>
>>>> Test for failure: in_use = True.
>>>>
>>>> --
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>   File
>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>> line 89, in _execute
>>>>
>>>> return self.cursor.execute(sql, params)
>>>>
>>>>
>>>>
>>>>   File
>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>> line 328, in execute
>>>>
>>>> return super().execute(query, params)
>>>>
>>>>^^
>>>>
>>>> sqlite3.IntegrityError: NOT NULL constraint failed:
>>>> domain_sources_app_characternumber.number_of_combinations
>>>>
>>>>
>>>> The above exception was the direct cause of the following exception:
>>>>
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>   File
>>>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>>> line 30, in test_command_output_been_there
>>>>
>>>> thingy.save()
>>>>
>>>>   File
>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>> line 814, in save
>>>>
>>>> self.save_base(
>>>>
>>>>   File
>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>> line 877, in save_base
>>>>
>>>> updated = s

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
False or True check for yourself.

On Wed, 10 May, 2023, 17:29 Vishesh Mangla, 
wrote:

> It looks like you are passing a null but null=False is not set
>
> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> I'm trying to test a django-admin command and don't understand why the
>> tests give errors on the code while the code works as expected.
>>
>> I'm under the impression that the *raise CommandError* is ignored by the
>> test, but don't understand why this would be.
>>
>> Please help.
>>
>> Running the code shows:
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 0
>>
>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 1
>>
>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 1
>>
>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 7
>>
>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>
>> Running the tests shows
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
>> tests.test_sources_app_command_populate
>>
>> Found 3 test(s).
>>
>> Creating test database for alias 'default'...
>>
>> System check identified no issues (0 silenced).
>>
>> EEE
>>
>> ==
>>
>> ERROR: test_command_output_been_there
>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>
>> Test for failure: in_use = True.
>>
>> --
>>
>> Traceback (most recent call last):
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>> line 89, in _execute
>>
>> return self.cursor.execute(sql, params)
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>> line 328, in execute
>>
>> return super().execute(query, params)
>>
>>^^
>>
>> sqlite3.IntegrityError: NOT NULL constraint failed:
>> domain_sources_app_characternumber.number_of_combinations
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>>
>> Traceback (most recent call last):
>>
>>   File
>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>> line 30, in test_command_output_been_there
>>
>> thingy.save()
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 814, in save
>>
>> self.save_base(
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 877, in save_base
>>
>> updated = self._save_table(
>>
>>   ^
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 1020, in _save_table
>>
>> results = self._do_insert(
>>
>>   
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 1061, in _do_insert
>>
>> return manager._insert(
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
>> line 87, in manager_method
>>
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>
>>^^^
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
>> line 1805, in _insert
>>
>> return query.get_compiler(using=using).execute_sql(returning_fields)
>>
>>

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
It looks like you are passing a null but null=False is not set

On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
django-users@googlegroups.com> wrote:

> I'm trying to test a django-admin command and don't understand why the
> tests give errors on the code while the code works as expected.
>
> I'm under the impression that the *raise CommandError* is ignored by the
> test, but don't understand why this would be.
>
> Please help.
>
> Running the code shows:
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 0
>
> *CommandError: Alleen hele getallen > 0 toegestaan*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *Teksten zijn gegenereerd voor tekstlengte 1*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 7
>
> *CommandError: Opgegeven sleutel 7 niet gevonden*
>
> Running the tests shows
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
> tests.test_sources_app_command_populate
>
> Found 3 test(s).
>
> Creating test database for alias 'default'...
>
> System check identified no issues (0 silenced).
>
> EEE
>
> ==
>
> ERROR: test_command_output_been_there
> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>
> Test for failure: in_use = True.
>
> --
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 89, in _execute
>
> return self.cursor.execute(sql, params)
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
> line 328, in execute
>
> return super().execute(query, params)
>
>^^
>
> sqlite3.IntegrityError: NOT NULL constraint failed:
> domain_sources_app_characternumber.number_of_combinations
>
>
> The above exception was the direct cause of the following exception:
>
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
> line 30, in test_command_output_been_there
>
> thingy.save()
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 814, in save
>
> self.save_base(
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 877, in save_base
>
> updated = self._save_table(
>
>   ^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1020, in _save_table
>
> results = self._do_insert(
>
>   
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1061, in _do_insert
>
> return manager._insert(
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
> line 87, in manager_method
>
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>
>^^^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
> line 1805, in _insert
>
> return query.get_compiler(using=using).execute_sql(returning_fields)
>
>^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
> line 1820, in execute_sql
>
> cursor.execute(sql, params)
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 67, in execute
>
> return self._execute_with_wrappers(
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 80, in _execute_with_wrappers
>
> return executor(sql, params, many, context)
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 84, in _execute
>
> with self.db.wrap_database_errors:
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/utils.py",
> line 91, in __exit__
>
> raise dj_exc_value.with_traceback(traceback) from exc_value
>
>   File
> 

Re: I have a problem with visual studio code

2023-05-02 Thread Vishesh Mangla
Also ask for help on web.libera.chat website.there is a python channel

On Tue, 2 May, 2023, 22:29 Vishesh Mangla, 
wrote:

> Oh looks like you are using visual studio python. Dont use that and remove
> the python path and download python from official website
>
> On Tue, 2 May, 2023, 22:27 Stan Hiebah,  wrote:
>
>> i tried so many different versions of python and still getting this error
>> please help cause i have project should be delivered
>>
>> On Tue, 2 May 2023, 7:55 pm Vishesh Mangla, 
>> wrote:
>>
>>> Looks like issue is with pillow
>>>
>>> On Tue, 2 May, 2023, 22:17 Byansi Samuel, 
>>> wrote:
>>>
>>>> Which version of python do you use?
>>>>
>>>> It's because of python.  Change the version of your python from anyone
>>>> you have been using and install
>>>>
>>>> Python 3.10, it will work fine and successful
>>>>
>>>> On Tue, May 2, 2023, 7:41 PM Stan Hiebah  wrote:
>>>>
>>>>> Can i have a solution for this?
>>>>>
>>>>> --
>>>>> 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/CAFYQPdJHma18zUctajwjfBRi6gYKQkz2MF%2BWSVsfifa9m%3DEzdA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAFYQPdJHma18zUctajwjfBRi6gYKQkz2MF%2BWSVsfifa9m%3DEzdA%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAGQoQ3xZBAKH2%2BrASDGQWQ0scfvHvOfS%3Do%3DTCMbzgHjXt4%2BNfg%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAGQoQ3xZBAKH2%2BrASDGQWQ0scfvHvOfS%3Do%3DTCMbzgHjXt4%2BNfg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CACaE8x6LCt9gTDtEfnipaeusnYdZR3aBVFwjXWV31rvjgSAPqg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CACaE8x6LCt9gTDtEfnipaeusnYdZR3aBVFwjXWV31rvjgSAPqg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFYQPdKrxri_OeaYq6Vh0h%3Dm_Ca%3DQmYvQwZHTDieVbHEb9_uog%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFYQPdKrxri_OeaYq6Vh0h%3Dm_Ca%3DQmYvQwZHTDieVbHEb9_uog%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x5MsYJ1qLeH_jOdje%2BTcNeownMn1mGAfK5sbgQbq45c_w%40mail.gmail.com.


Re: I have a problem with visual studio code

2023-05-02 Thread Vishesh Mangla
Oh looks like you are using visual studio python. Dont use that and remove
the python path and download python from official website

On Tue, 2 May, 2023, 22:27 Stan Hiebah,  wrote:

> i tried so many different versions of python and still getting this error
> please help cause i have project should be delivered
>
> On Tue, 2 May 2023, 7:55 pm Vishesh Mangla, 
> wrote:
>
>> Looks like issue is with pillow
>>
>> On Tue, 2 May, 2023, 22:17 Byansi Samuel, 
>> wrote:
>>
>>> Which version of python do you use?
>>>
>>> It's because of python.  Change the version of your python from anyone
>>> you have been using and install
>>>
>>> Python 3.10, it will work fine and successful
>>>
>>> On Tue, May 2, 2023, 7:41 PM Stan Hiebah  wrote:
>>>
>>>> Can i have a solution for this?
>>>>
>>>> --
>>>> 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/CAFYQPdJHma18zUctajwjfBRi6gYKQkz2MF%2BWSVsfifa9m%3DEzdA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAFYQPdJHma18zUctajwjfBRi6gYKQkz2MF%2BWSVsfifa9m%3DEzdA%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGQoQ3xZBAKH2%2BrASDGQWQ0scfvHvOfS%3Do%3DTCMbzgHjXt4%2BNfg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAGQoQ3xZBAKH2%2BrASDGQWQ0scfvHvOfS%3Do%3DTCMbzgHjXt4%2BNfg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x6LCt9gTDtEfnipaeusnYdZR3aBVFwjXWV31rvjgSAPqg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x6LCt9gTDtEfnipaeusnYdZR3aBVFwjXWV31rvjgSAPqg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFYQPdKrxri_OeaYq6Vh0h%3Dm_Ca%3DQmYvQwZHTDieVbHEb9_uog%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFYQPdKrxri_OeaYq6Vh0h%3Dm_Ca%3DQmYvQwZHTDieVbHEb9_uog%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x5FMSTh_B4CBz5XdjLmWNSQSpMdz5ifWb7xASuCsp6QmQ%40mail.gmail.com.


Re: I have a problem with visual studio code

2023-05-02 Thread Vishesh Mangla
Looks like issue is with pillow

On Tue, 2 May, 2023, 22:17 Byansi Samuel,  wrote:

> Which version of python do you use?
>
> It's because of python.  Change the version of your python from anyone you
> have been using and install
>
> Python 3.10, it will work fine and successful
>
> On Tue, May 2, 2023, 7:41 PM Stan Hiebah  wrote:
>
>> Can i have a solution for this?
>>
>> --
>> 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/CAFYQPdJHma18zUctajwjfBRi6gYKQkz2MF%2BWSVsfifa9m%3DEzdA%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/CAGQoQ3xZBAKH2%2BrASDGQWQ0scfvHvOfS%3Do%3DTCMbzgHjXt4%2BNfg%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/CACaE8x6LCt9gTDtEfnipaeusnYdZR3aBVFwjXWV31rvjgSAPqg%40mail.gmail.com.


Re: How to link different apps into one main app

2023-03-24 Thread Vishesh Mangla
Add your app name in settings.py in INSTALLED_APPS

On Fri, 24 Mar, 2023, 18:58 Chandresh . T,  wrote:

> I'm a new learner of Django, and I want to do a project, In the main app a
> form will be given and if the person tells that he belongs to the frontend
> or backend developing group he will be moved to that room respectively.
>
> So I thought that I can create 2 different apps one frontend and another
> backend then once logged in to the main app the user will be sent to the
> respective apps room.
>
> I searched for how to do this on google, but there was no solution. So if
> you guys have any ideas please help me with this.
>
> Thank you in advance!
>
> --
> 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/1a056e9a-82c7-4267-a070-eb1119e3eceen%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/CACaE8x7mEP6Srk3vG61Oa%2BiTqw4knQvfgNCvCS7dy3qpxQbdsw%40mail.gmail.com.


Re: Invite to join WhatsApp group

2022-08-05 Thread Vishesh Mangla
This group is not for promoting your paid service. It's where volunteers
help each other.So stop advertising your classes here.

On Sat, 6 Aug, 2022, 02:38 Dylan Reinhold,  wrote:

> In the past 2 weeks, I have seen this same message sent over 4 times.
>
> We get it, you have a whatsapp group.
>
> Dylan
>
> On Fri, Aug 5, 2022, 10:32 Satyajit Barik 
> wrote:
>
>> Hey Dylan,
>>
>> We do not spam anything, We try our best to help others.
>>
>>
>> Thanks.
>>
>> On Fri, Aug 5, 2022 at 9:32 PM Dylan Reinhold 
>> wrote:
>>
>>> Please stop spaming this list.
>>>
>>> Thanks.
>>>
>>> On Fri, Aug 5, 2022, 08:47 Satyajit Barik 
>>> wrote:
>>>
 Hey,

 Join in Whatsapp python group using the below link to get solve your
 Python and Django related problems.

 https://chat.whatsapp.com/Bq2jcxLJVG50v9Wbkvz6Vy

 [Membership benefits] Here are some great perks you get for becoming a
 member:
 * Ask your python & django related problems: get quick possible answer.
 * Friendly environment: you can learn python & django from core.
 * Daily Python Assignment exercise.


 --
 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/CANd-%2BoCUxfPQCK2eUPM2_ioKZUoN4UV6ziLThxJYwHHARf%3D3pw%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/CAHtg44Ar6QoZ35wRGk%3DxMO4SqntfUqP5vjWL-yuKkk8Ca5vLNA%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/CANd-%2BoCjv9Wbc4rpecy%2BEvazsgE8h%2BFkt0wGG8Th9qVjxHe-mw%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/CAHtg44ChoL%3DiJ2fnLyn98MV3ON2ef4GsTzdn_2hfL1a9%2BAosGA%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/CACaE8x5EBf3yG1RYJvFHD_G2FL0FcULmERpZ%3DqVP_Xy6qdu8uw%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

https://stackoverflow.com/questions/56761409/how-to-make-a-login-view-for-django-custom-user

On Fri, May 27, 2022 at 1:07 AM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have this function based view which works perfectly but I would like to
> convert to a class based view but am stuck on how to do this:
> This is my fbv:
>
> def loginView(request):
> if request.method == 'POST':
> form = LoginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> user = authenticate(request,
>email=cd['email'],
>password=cd['password'])
>
> if user is not None:
> login(request, user)
> if user.is_authenticated and user.is_client:
> return redirect('clients:detail') # Go to client
> dashboard
> elif user.is_authenticated and user.is_account_manager:
> return redirect('accountmanagers:detail') #Go to
> account manager dashboard
> else:
>return HttpResponse('Invalid login')
> else:
> # Invalid email or password. Handle as you wish
> form = LoginForm()
>
> return render(request, 'registration/login.html', {'form': form})
>
> I would appreciate any help.
>
> --
> 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/ea6c54f2-ecc0-407d-a296-e168d509a299n%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/CACaE8x6gGXLJ_6kdBAbmjc0xYc%2BnQTgMpgNFn-YqkgmUFGz2PA%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
 Sorry, on looking again I realized that CBV already does this.
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

https://stackoverflow.com/questions/56761409/how-to-make-a-login-view-for-django-custom-user

On Fri, May 27, 2022 at 1:07 AM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have this function based view which works perfectly but I would like to
> convert to a class based view but am stuck on how to do this:
> This is my fbv:
>
> def loginView(request):
> if request.method == 'POST':
> form = LoginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> user = authenticate(request,
>email=cd['email'],
>password=cd['password'])
>
> if user is not None:
> login(request, user)
> if user.is_authenticated and user.is_client:
> return redirect('clients:detail') # Go to client
> dashboard
> elif user.is_authenticated and user.is_account_manager:
> return redirect('accountmanagers:detail') #Go to
> account manager dashboard
> else:
>return HttpResponse('Invalid login')
> else:
> # Invalid email or password. Handle as you wish
> form = LoginForm()
>
> return render(request, 'registration/login.html', {'form': form})
>
> I would appreciate any help.
>
> --
> 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/ea6c54f2-ecc0-407d-a296-e168d509a299n%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/CACaE8x7xCs634EU-QO%3D%2BhYNsU8z-3s3xyNExufAdkQpscJUgog%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
Sorry, on looking again I realized that CBV already does this.
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

Btw,

On Fri, May 27, 2022 at 2:26 AM Vishesh Mangla 
wrote:

> I think it's good, function based views offer you more flexibility. If you
> are not liking your code it's because your function should be split up into
> smaller functions, or use a class without it being a view.
>
> On Fri, 27 May 2022, 01:07 'dtdave' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> I have this function based view which works perfectly but I would like to
>> convert to a class based view but am stuck on how to do this:
>> This is my fbv:
>>
>> def loginView(request):
>> if request.method == 'POST':
>> form = LoginForm(request.POST)
>> if form.is_valid():
>> cd = form.cleaned_data
>> user = authenticate(request,
>>email=cd['email'],
>>password=cd['password'])
>>
>> if user is not None:
>> login(request, user)
>> if user.is_authenticated and user.is_client:
>> return redirect('clients:detail') # Go to client
>> dashboard
>> elif user.is_authenticated and user.is_account_manager:
>> return redirect('accountmanagers:detail') #Go to
>> account manager dashboard
>> else:
>>return HttpResponse('Invalid login')
>> else:
>> # Invalid email or password. Handle as you wish
>> form = LoginForm()
>>
>> return render(request, 'registration/login.html', {'form': form})
>>
>> I would appreciate any help.
>>
>> --
>> 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/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x4RTf0k3DKcKfxhiFcXckGFKp8tifQGVF_FpxXBQcAkdg%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
I think it's good, function based views offer you more flexibility. If you
are not liking your code it's because your function should be split up into
smaller functions, or use a class without it being a view.

On Fri, 27 May 2022, 01:07 'dtdave' via Django users, <
django-users@googlegroups.com> wrote:

> I have this function based view which works perfectly but I would like to
> convert to a class based view but am stuck on how to do this:
> This is my fbv:
>
> def loginView(request):
> if request.method == 'POST':
> form = LoginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> user = authenticate(request,
>email=cd['email'],
>password=cd['password'])
>
> if user is not None:
> login(request, user)
> if user.is_authenticated and user.is_client:
> return redirect('clients:detail') # Go to client
> dashboard
> elif user.is_authenticated and user.is_account_manager:
> return redirect('accountmanagers:detail') #Go to
> account manager dashboard
> else:
>return HttpResponse('Invalid login')
> else:
> # Invalid email or password. Handle as you wish
> form = LoginForm()
>
> return render(request, 'registration/login.html', {'form': form})
>
> I would appreciate any help.
>
> --
> 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/ea6c54f2-ecc0-407d-a296-e168d509a299n%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/CACaE8x5iCrx496xhUCw5wZ3hgXe2cmFRy2k2iPNub%3DxJdC4V5g%40mail.gmail.com.


Re: Class based views with forms

2022-04-28 Thread Vishesh Mangla
Iommi forms

On Thu, 28 Apr 2022, 23:00 Ryan Nowakowski,  wrote:

> You're right, it's not very clear how to have a single class-based view
> handle both displaying details and submitting a form.  This is a
> fantastic site that shows how each class based view is set up
> inheritance-wise: https://ccbv.co.uk/
>
> Take a look the ancestors for DetailView:
>
> https://ccbv.co.uk/projects/Django/4.0/django.views.generic.detail/DetailView/
>
> ... and the ancestors for FormView:
> https://ccbv.co.uk/projects/Django/4.0/django.views.generic.edit/FormView/
>
>
> Maybe you can just add the FormMixin as an ancestor to your DetailView.
>
>
> As another option, maybe you can create a separate FormView that you can
> POST to from your DetailView.
>
>
> - Ryan N
>
> On 4/26/22 5:25 AM, alex smolyakov wrote:
> > Can anyone explain me how to make send email form on page.
> >
> > So my forms.py
> >
> > class ContactForm(forms.Form):
> > name = forms.CharField(required=True)
> > last_name = forms.CharField()
> > adults = forms.IntegerField() children = forms.IntegerField()
> > email = forms.EmailField(required=True)
> > message = forms.CharField(widget=forms.Textarea)
> >
> > views.py
> >
> > class TourDetailView(DetailView):
> > model = models.Tour
> > template_name = 'tours/tour-detail.html'
> > form_class = forms.ContactForm
> > success_url = 'tours.html'
> >
> > As far as i understand i need to get data from request , but i dont
> > know how to do it. There are a lot of information in function based
> > views, but i didnt get how to do it in class based views.
> >
> > And it would be nice of you to explain where should i put send_mail
> > function. Any help will be appreciated.
> >
>
> --
> 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/235da153-a9d7-2582-ace4-3dbf147d17f8%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x55P%2BBLgpyoSfJtwmB%3DKp9YpQ-ndYyYTMb6BM8BboTv0Q%40mail.gmail.com.


Re: SMTP Authentification error

2022-04-27 Thread Vishesh Mangla
I meant Gmail api.I was also stuck with Gmail.Also may 31 onwards Gmail
will block all third party apps which simply login with email and password.

On Thu, 28 Apr 2022, 11:02 Vishesh Mangla, 
wrote:

>
> On Thu, 28 Apr 2022, 11:02 Vishesh Mangla, 
> wrote:
>
>> Use Google api.
>>
>> On Thu, 28 Apr 2022, 10:29 'Delvin Alexander' via Django users, <
>> django-users@googlegroups.com> wrote:
>>
>>> okay i did both but now i am getting this error. Any clue on why?
>>>
>>> *SMTPSenderRefused at /password-reset/*
>>>
>>>
>>> *(530, b'5.7.0 Authentication Required. Learn more at\n5.7.0
>>> https://support.google.com/mail/?p=WantAuthError
>>> <https://support.google.com/mail/?p=WantAuthError>
>>> w137-20020a62828f00b0050d2f9c3409sm14545822pfd.199 - gsmtp',
>>> 'webmaster@localhost')*
>>> On Wednesday, April 27, 2022 at 12:27:02 AM UTC-7 dashlaksh...@gmail.com
>>> wrote:
>>>
>>>> Check whether you have turned on less secure apps or not.
>>>>
>>>> On Wed, Apr 27, 2022, 11:07 'Delvin Alexander' via Django users <
>>>> django...@googlegroups.com> wrote:
>>>>
>>>>> Hello everyone,
>>>>>
>>>>> May you please assist in informing me on what i need to do to resolve
>>>>> this issue.
>>>>>
>>>>> - *SMTPAuthenticationError at /password-reset/*
>>>>> *- (535, b'5.7.8 Username and Password not accepted. Learn more
>>>>> at\n5.7.8 https://support.google.com/mail/?p=BadCredentials
>>>>> <https://support.google.com/mail/?p=BadCredentials>
>>>>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>>>>
>>>>>
>>>>> I included the 16 character code to my environment variable and called
>>>>> it in my settings.pymfile,  but still the error occurs. Also here is my
>>>>> settings.py file:
>>>>>
>>>>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>>>>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>>>>> *EMAIL_PORT = 587*
>>>>> *EMAIL_USE_TLS = True*
>>>>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>>>>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>>>>
>>>>> --
>>>>>
>>>> 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/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/a6f92133-32db-4f4a-ae46-bb1f7644b431n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/a6f92133-32db-4f4a-ae46-bb1f7644b431n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x6OC7Uquk%2BYMoAWvwcUTRAgQnHPG513Ao%3DgzE4V6RPnfw%40mail.gmail.com.


Re: SMTP Authentification error

2022-04-27 Thread Vishesh Mangla
On Thu, 28 Apr 2022, 11:02 Vishesh Mangla, 
wrote:

> Use Google api.
>
> On Thu, 28 Apr 2022, 10:29 'Delvin Alexander' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> okay i did both but now i am getting this error. Any clue on why?
>>
>> *SMTPSenderRefused at /password-reset/*
>>
>>
>> *(530, b'5.7.0 Authentication Required. Learn more at\n5.7.0
>> https://support.google.com/mail/?p=WantAuthError
>> <https://support.google.com/mail/?p=WantAuthError>
>> w137-20020a62828f00b0050d2f9c3409sm14545822pfd.199 - gsmtp',
>> 'webmaster@localhost')*
>> On Wednesday, April 27, 2022 at 12:27:02 AM UTC-7 dashlaksh...@gmail.com
>> wrote:
>>
>>> Check whether you have turned on less secure apps or not.
>>>
>>> On Wed, Apr 27, 2022, 11:07 'Delvin Alexander' via Django users <
>>> django...@googlegroups.com> wrote:
>>>
>>>> Hello everyone,
>>>>
>>>> May you please assist in informing me on what i need to do to resolve
>>>> this issue.
>>>>
>>>> - *SMTPAuthenticationError at /password-reset/*
>>>> *- (535, b'5.7.8 Username and Password not accepted. Learn more
>>>> at\n5.7.8 https://support.google.com/mail/?p=BadCredentials
>>>> <https://support.google.com/mail/?p=BadCredentials>
>>>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>>>
>>>>
>>>> I included the 16 character code to my environment variable and called
>>>> it in my settings.pymfile,  but still the error occurs. Also here is my
>>>> settings.py file:
>>>>
>>>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>>>> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
>>>> *EMAIL_PORT = 587*
>>>> *EMAIL_USE_TLS = True*
>>>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>>>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>>>
>>>> --
>>>>
>>> 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/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a6f92133-32db-4f4a-ae46-bb1f7644b431n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/a6f92133-32db-4f4a-ae46-bb1f7644b431n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x5%3DhYst21QVxiMuTX%2Bi2zGnURGgkzjQ0dafP_MpTRT1MA%40mail.gmail.com.


Re: SMTP Authentification error

2022-04-27 Thread Vishesh Mangla
Use Google api.

On Thu, 28 Apr 2022, 10:29 'Delvin Alexander' via Django users, <
django-users@googlegroups.com> wrote:

> okay i did both but now i am getting this error. Any clue on why?
>
> *SMTPSenderRefused at /password-reset/*
>
>
> *(530, b'5.7.0 Authentication Required. Learn more at\n5.7.0
> https://support.google.com/mail/?p=WantAuthError
> 
> w137-20020a62828f00b0050d2f9c3409sm14545822pfd.199 - gsmtp',
> 'webmaster@localhost')*
> On Wednesday, April 27, 2022 at 12:27:02 AM UTC-7 dashlaksh...@gmail.com
> wrote:
>
>> Check whether you have turned on less secure apps or not.
>>
>> On Wed, Apr 27, 2022, 11:07 'Delvin Alexander' via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> Hello everyone,
>>>
>>> May you please assist in informing me on what i need to do to resolve
>>> this issue.
>>>
>>> - *SMTPAuthenticationError at /password-reset/*
>>> *- (535, b'5.7.8 Username and Password not accepted. Learn more
>>> at\n5.7.8 https://support.google.com/mail/?p=BadCredentials
>>> 
>>> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>>>
>>>
>>> I included the 16 character code to my environment variable and called
>>> it in my settings.pymfile,  but still the error occurs. Also here is my
>>> settings.py file:
>>>
>>> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
>>> *EMAIL_HOST = 'smtp.gmail.com '*
>>> *EMAIL_PORT = 587*
>>> *EMAIL_USE_TLS = True*
>>> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
>>> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>>>
>>> --
>>>
>> 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/c18935a8-43bf-4a15-a5ba-95209009498dn%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/a6f92133-32db-4f4a-ae46-bb1f7644b431n%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/CACaE8x6hsZFb8%3DzReCcFyx0eKgjvfTgqLEUu_USBz5D1ppsxKQ%40mail.gmail.com.


Re: Download html pages as pdf using headless Chrome

2022-01-29 Thread Vishesh Mangla
If it's a pdf then u can download the bytes.
So search Google/stackoverflow for "requests download bytes".

On Sat, 29 Jan 2022, 21:44 Aadil Rashid,  wrote:

>
> from request.get("https://---;) i am getting instance
> of requests.models.Response, how can i convert it to pdf
>
> On Sat, Jan 29, 2022 at 9:31 PM Vishesh Mangla 
> wrote:
>
>> Get the link and cookies from the webdriver and put that in requests.get
>> using request library to download the html on the page.
>>
>> On Sat, 29 Jan 2022, 21:29 Vishesh Mangla, 
>> wrote:
>>
>>> Use requests for that .
>>>
>>> On Sat, 29 Jan 2022, 21:28 Aadil Rashid, 
>>> wrote:
>>>
>>>> Hello Django Family, I came across the problem of downloading HTML
>>>> pages as pdf using headless chrome, Can anybody here who could please let
>>>> me know how can I do it or any good resource to follow, it would be
>>>> appreciable. I am using Django python,
>>>> Thank you very much.
>>>>
>>>> --
>>>> 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/CAAYXZx-Ar-PeKeOLA27TgTwQoct3e9Y1E%2BAPtWyPQMq78EaTNg%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAAYXZx-Ar-PeKeOLA27TgTwQoct3e9Y1E%2BAPtWyPQMq78EaTNg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACaE8x5C2dihUH4iapMvu8aqMZFWFfpF6VRPHA%2BEkF5PhDQDJA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACaE8x5C2dihUH4iapMvu8aqMZFWFfpF6VRPHA%2BEkF5PhDQDJA%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAYXZx-1w-U-LrNM2fG3WzMohXY-PayNCdw53rR2osKM7BNyhw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAYXZx-1w-U-LrNM2fG3WzMohXY-PayNCdw53rR2osKM7BNyhw%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x7u4-7eMbnJyy0etYywcaoWYCWo%3Dwu5h9QVLkW28VfGgg%40mail.gmail.com.


Re: Download html pages as pdf using headless Chrome

2022-01-29 Thread Vishesh Mangla
Get the link and cookies from the webdriver and put that in requests.get
using request library to download the html on the page.

On Sat, 29 Jan 2022, 21:29 Vishesh Mangla, 
wrote:

> Use requests for that .
>
> On Sat, 29 Jan 2022, 21:28 Aadil Rashid,  wrote:
>
>> Hello Django Family, I came across the problem of downloading HTML pages
>> as pdf using headless chrome, Can anybody here who could please let me know
>> how can I do it or any good resource to follow, it would be appreciable. I
>> am using Django python,
>> Thank you very much.
>>
>> --
>> 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/CAAYXZx-Ar-PeKeOLA27TgTwQoct3e9Y1E%2BAPtWyPQMq78EaTNg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAAYXZx-Ar-PeKeOLA27TgTwQoct3e9Y1E%2BAPtWyPQMq78EaTNg%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x5C2dihUH4iapMvu8aqMZFWFfpF6VRPHA%2BEkF5PhDQDJA%40mail.gmail.com.


Re: Download html pages as pdf using headless Chrome

2022-01-29 Thread Vishesh Mangla
Use requests for that .

On Sat, 29 Jan 2022, 21:28 Aadil Rashid,  wrote:

> Hello Django Family, I came across the problem of downloading HTML pages
> as pdf using headless chrome, Can anybody here who could please let me know
> how can I do it or any good resource to follow, it would be appreciable. I
> am using Django python,
> Thank you very much.
>
> --
> 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/CAAYXZx-Ar-PeKeOLA27TgTwQoct3e9Y1E%2BAPtWyPQMq78EaTNg%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/CACaE8x4R2oyqJGjDPM7t_%2Be4mF52bO%3DZB82AiQd11iYDzDTDQg%40mail.gmail.com.


Re: Django works with PDF

2022-01-20 Thread Vishesh Mangla
PyPDF2

On Thu, 20 Jan 2022, 19:46 Amor Zamora,  wrote:

> I have 2 problems working with pdf in django.
> 1. I need a tool, function or library that allows me to open a pdf and
> read the metadata, to get its 'creator and producer' there, but I have to
> do this, not with python, because to show it on the frontend.
> 2. How can I get the country from an Ip address (I use the ipaddress
> module in my project). But I don't know how I can get the country,
> because the IPs are assigned by ranges not by regions and the ipaddress
> module that I know of does not bring anything incorporated to be able to
> obtain the country.
> At this point, I can't use GeoIP, in any of its variants.
> please help
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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/CAKMTbHWtN%3D5Pzm2yj2kR3erDLkiArAhJZVmxE0X0hvbjFu6eTA%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/CACaE8x4kmUsBCD6JZ8rHo8wS0gsqx1CTX5%2BVV%3DGH%3DR3LW-e3AQ%40mail.gmail.com.


Re: I need orientation on what to do and how to do it (procedure)

2021-12-16 Thread Vishesh Mangla
https://stackoverflow.com/a/2218134/4213362

On Thu, Dec 16, 2021 at 9:56 PM addani Raghavender <
addaniraghaven...@gmail.com> wrote:

> No not that much
>
> On Thu, 16 Dec, 2021, 7:43 am Amor Zamora,  wrote:
>
>>
>> Can you help me?
>> I need to obtain the country of where the users access from the IP and
>> insert that information into the sqlite3 database.
>>
>> Little description.
>> I have an application that I have to do the statistics and insert into
>> the sqlite3 database, the IP information, the country from which it is
>> accessed, who generates the information and how many times has clicked on
>> the application.
>> Question 1 is that I cannot find any suitable module in DJango that
>> allows me to combine the information described above.
>> I am using. IP_address, os, daemonize and socket and I don't quite
>> realize how to get the country from where it is accessed.
>> 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/CAKMTbHVU%2BkJQw%2B8wnA7U__x7zCnrd%3DyvA%2BwmwFta2cPDwS6%2BMg%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/CANkif0SpKD87nqicdfpgG97jstgnefphDqLUA9L_vyBwcgb5aA%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/CACaE8x5VZG8tbVUD-qAoHQNfuBDwrxSvH8QPxhYOpGtuQbOuAw%40mail.gmail.com.


Re: using .annotate on a queryset and output field is a result of function

2021-06-28 Thread VISHESH MANGLA
this looks good, thanks

On Thu, Jun 17, 2021 at 6:08 PM Nikeet NA  wrote:

> Its not the perfect method you can optimize ot more if you want.
> You can prefer this Link
> <https://docs.djangoproject.com/en/3.2/topics/db/managers/#custom-managers>
>
> On Thu, 17 Jun 2021 at 18:06, Nikeet NA  wrote:
>
>> You can do it like this :
>>
>> class TransactionEntry(models.Manager):
>>def get_total_prices(self):
>>  return
>> self.queryset().defer("users").annotate.(total_price=F("num_shares")*F("price_per_share"))
>>
>> On Thu, 17 Jun 2021 at 15:31, VISHESH MANGLA <
>> f20170...@pilani.bits-pilani.ac.in> wrote:
>>
>>> what about overwriting the manager? How to make the manager auto-add
>>> those computed properties ?
>>>
>>> On Thursday, June 17, 2021 at 8:50:27 AM UTC+5:30 Nikeet NA wrote:
>>>
>>>> You cannot use properties in django orm , it does not allow that.
>>>>
>>>> TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price')
>>>> On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I wanted to know that how for the model below,  how can I get a
>>>>> queryset with  all the fields excluding the `user` and including the
>>>>> output of get_output_field? Please avoid hardcoding.
>>>>> One way is
>>>>>
>>>>> `TransactionEntry
>>>>> .objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`
>>>>>
>>>>> but that is undesirable. I just want to use that function on the model
>>>>> and not hard code the formula.
>>>>> Thanks,
>>>>>
>>>>>
>>>>>
>>>>> class TransactionEntry(models.Model):
>>>>> """Model to save data of users who want to buy/sell shares"""
>>>>>
>>>>> user = models.ForeignKey(
>>>>> to=Relative,
>>>>> on_delete=models.CASCADE,
>>>>> related_name="transaction_entry",
>>>>> )
>>>>>
>>>>> num_shares = models.PositiveIntegerField(null=False, blank=False)
>>>>> date_of_trade = models.DateField(null=False, blank=False)
>>>>> transaction_type = models.CharField(
>>>>> max_length=1,
>>>>> choices=TransactionType.choices,
>>>>> default=TransactionType.SELL,
>>>>> null=False,
>>>>> )
>>>>> price_per_share = models.FloatField(null=False, blank=False)
>>>>>
>>>>> def get_total_price(self):
>>>>> return self.num_shares * self.price_per_share
>>>>>
>>>>> --
>>> 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/35d917c8-e321-42eb-8050-f7849c0374e8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/35d917c8-e321-42eb-8050-f7849c0374e8n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFOOHnP8Y285E9HztCq8LUcTwZ3G%2BDT2T%2BgB35j_JfdK8va6ow%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFOOHnP8Y285E9HztCq8LUcTwZ3G%2BDT2T%2BgB35j_JfdK8va6ow%40mail.gmail.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALG_zn4xVxRhQPFD%2Bq%2BcC%3DAiFNfU3ZSxLgmPXhQu%3DQ-_hySbvQ%40mail.gmail.com.


Re: [URGENT] -  Scrape Youtube Channel Email | Bypass Captcha 

2021-06-21 Thread VISHESH MANGLA
Use selenium

On Sun, Jun 20, 2021, 06:29 Vrushang Desai  wrote:

> Hi guys,
> *I'm trying to bypass youtube captcha & download email of the channel
> owner.*
>
> I would really like to know how can one actually solve it?
>
> As I'm facing issues with youtube,
>
> *Where captcha disappears (Even if email can be scraped from different
> id).*
>
> *Any Help or API would be helpful!*
> Thanks.
> Vrushang - Junior Developer
>
> --
> 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/29c084bb-ecbd-4296-9307-dba55c2682efn%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/CALG_zn5Y5Fyr0jyCumMXyMR1osPzU%2BM1PCWUOrwazQgwP4upxg%40mail.gmail.com.


Re: using .annotate on a queryset and output field is a result of function

2021-06-17 Thread VISHESH MANGLA
what about overwriting the manager? How to make the manager auto-add those 
computed properties ? 

On Thursday, June 17, 2021 at 8:50:27 AM UTC+5:30 Nikeet NA wrote:

> You cannot use properties in django orm , it does not allow that.
>
> TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price')
> On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote:
>
>> Hello, 
>>
>> I wanted to know that how for the model below,  how can I get a queryset 
>> with  all the fields excluding the `user` and including the  output of 
>> get_output_field? Please avoid hardcoding.
>> One way is
>>
>> `TransactionEntry
>> .objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`
>>
>> but that is undesirable. I just want to use that function on the model 
>> and not hard code the formula.
>> Thanks,
>>
>>
>>
>> class TransactionEntry(models.Model):
>> """Model to save data of users who want to buy/sell shares"""
>>
>> user = models.ForeignKey(
>> to=Relative,
>> on_delete=models.CASCADE,
>> related_name="transaction_entry",
>> )
>>
>> num_shares = models.PositiveIntegerField(null=False, blank=False)
>> date_of_trade = models.DateField(null=False, blank=False)
>> transaction_type = models.CharField(
>> max_length=1,
>> choices=TransactionType.choices,
>> default=TransactionType.SELL,
>> null=False,
>> )
>> price_per_share = models.FloatField(null=False, blank=False)
>>
>> def get_total_price(self):
>> return self.num_shares * self.price_per_share
>>
>>

-- 
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/35d917c8-e321-42eb-8050-f7849c0374e8n%40googlegroups.com.


using .annotate on a queryset and output field is a result of function

2021-06-16 Thread VISHESH MANGLA
Hello, 

I wanted to know that how for the model below,  how can I get a queryset 
with  all the fields excluding the `user` and including the  output of 
get_output_field? Please avoid hardcoding.
One way is

`TransactionEntry
.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share"))`

but that is undesirable. I just want to use that function on the model and 
not hard code the formula.
Thanks,



class TransactionEntry(models.Model):
"""Model to save data of users who want to buy/sell shares"""

user = models.ForeignKey(
to=Relative,
on_delete=models.CASCADE,
related_name="transaction_entry",
)

num_shares = models.PositiveIntegerField(null=False, blank=False)
date_of_trade = models.DateField(null=False, blank=False)
transaction_type = models.CharField(
max_length=1,
choices=TransactionType.choices,
default=TransactionType.SELL,
null=False,
)
price_per_share = models.FloatField(null=False, blank=False)

def get_total_price(self):
return self.num_shares * self.price_per_share

-- 
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/20b0067b-cbfc-49c5-90ef-c302504cac7bn%40googlegroups.com.


no info on extra fields in the modelformset docs

2021-06-14 Thread VISHESH MANGLA
Hello, 

I 'm trying to use a modelformset with extra form fields but the docs say 
nothing about it.
The initial data corresponding to the  model fields gets loaded. 
 I 'm stuck on this view(posted at the end) from previous 4 days, please 
help someone.
The extra field is ` print_report_check`. 

form
```

class PrintReportModelForm(ModelForm):
print_report_check = forms.BooleanField(widget=forms.CheckboxInput(), 
required=False)
class Meta:
fields = ["PAN_ID", "print_report_check"]
model = User
widgets = {"PAN_ID": forms.HiddenInput()}

def save(self, commit=True):
logger.info(" Method not meant to save anything ")
pass
```


https://docs.djangoproject.com/en/3.2/topics/forms/modelforms/#id2

To my queryset  returned by get_queryset I added this field.

```

queryset  = queryset.annotate(print_report_check=Case(
When(PAN_ID__in=userids_for_checked_boxes, then=True),
default=False))
```






```view

class ListFormSetView(ListView):
context_formset_name = "formset"
PrintStatementData = {}

def get_formset(self):

return modelformset_factory(
self.model,
form=self.form_class,
extra=0,
)

def get_context_data(self, *, object_list=None, **kwargs):

context_formset_name = self.context_formset_name

context_data = super().get_context_data(**kwargs)

object_list = context_data["object_list"]

context_data[context_formset_name] = self.get_formset()(
queryset=self.add_fields_to_queryset(object_list)
)

return context_data

def add_fields_to_queryset(self, queryset):
try:
userids_for_checked_boxes = self.PrintStatementData[
"to_download"][
self.PrintStatementData[
"list-formset-view_previous-page"]
]
except KeyError:
pass
else:
queryset  = queryset.annotate(print_report_check=Case(
When(PAN_ID__in=userids_for_checked_boxes, then=True),
default=False))
for i in queryset:
print(i)
return queryset

def get_form_kwargs(self):

context_data = super().get_context_data()

object_list = context_data["object_list"]

kwargs = {
"queryset": self.add_fields_to_queryset(object_list),
}
if self.request.method in ("POST", "PUT"):
kwargs.update(
{
"data": self.request.POST,
"files": self.request.FILES,
}
)

return kwargs

# def get_initial(self, queryset=None):

# """Generate the initial data for the paginated queryset for the current 
page"""

# if queryset is None:
# queryset = []

# if self.request.method == "GET":
# try:

# userids_for_checked_boxes = 
self.PrintStatementData["to_download"][

# self.PrintStatementData["list-formset-view_previous-page"]
# ]
# except KeyError:
# pass
# else:
# for i in data:
# if i["PAN_ID"] in userids_for_checked_boxes:
# i["print_report_check"] = True

# return data

def get(self, request, *args, **kwargs):
self.PrintStatementData[
"list-formset-view_previous-page"] = int(self.request.GET.get(
self.page_kwarg))

return super().get(request, *args, **kwargs)

def post(self, request, *args, **kwargs):

self.object_list = self.get_queryset()

formset = self.get_formset_for_previous_page()
if formset.is_valid():
return self.formset_valid(formset)
else:
return self.formset_invalid(formset)

def get_formset_for_previous_page(self):

"""Set the `page_kwarg` 's  value to the previous page's value because
the formset's data needs to be compared to the previous page's data.
The `paginate_queryset` method uses self.kwargs["page_kwarg"]
to get the queryset corresponding to a page.So just to get the
initial data corresponding to the previous page through 
`self.get_form_kwargs` we first need to do this."""

self.PrintStatementData[
"list-formset-view_current-page"] = int(self.request.GET.get(
self.page_kwarg))

self.kwargs[self.page_kwarg] = self.PrintStatementData.get(
"list-formset-view_previous-page")

formset = self.get_formset()(**self.get_form_kwargs())

self.kwargs[self.page_kwarg] = self.PrintStatementData.get(
"list-formset-view_current-page")

return formset

def formset_valid(self, formset):
return 

Re: Initial data doesn't go complelely in the modelformset

2021-06-13 Thread VISHESH MANGLA
In line 58  you can see me adding  "print_report_check":True,   


my form

class PrintReportModelForm(ModelForm):
print_report_check = forms.BooleanField(widget=forms.CheckboxInput(), 
required=False)
class Meta:
fields = ["PAN_ID", "print_report_check"]
model = User
widgets = {"PAN_ID": forms.HiddenInput()}

def __init__(self,*args, **kwargs): 
super().__init__(*args, **kwargs)   
self.fields["PAN_ID"].disabled = True
 #   self.fields["print_report_check"].initial = True

def save(self, commit=True):
logger.info(" Method not meant to save anything ")
    pass

On Monday, June 14, 2021 at 12:09:49 AM UTC+5:30 VISHESH MANGLA wrote:

> in line 38 i have that print statement, it's output is at the top , I dont 
> know why that initial data is not going into that model formset.
> actually one data the PAN_ID actually went into the modelform, but the 
> checkbox's "checked" didnt. You can see the html of the formset and the 
> checkbox field doesnt has a checked. 
>
>
> Code in paste  
> https://bpa.st/FOUQ
>
> GET 
>   id="id_form-TOTAL_FORMS"> value="1" id="id_form-INITIAL_FORMS"> name="form-MIN_NUM_FORMS" value="0" id="id_form-MIN_NUM_FORMS"> type="hidden" name="form-MAX_NUM_FORMS" value="1000" 
> id="id_form-MAX_NUM_FORMS">
> Print report 
> check: name="form-0-print_report_check" id="id_form-0-print_report_check"> type="hidden" name="form-0-PAN_ID" value="10012000" disabled 
> id="id_form-0-PAN_ID"> 
>  [{'PAN_ID': '10012000', 'print_report_check': True}]
>
>
>
>
>
>
> class ListFormSetView(ListView):
> context_formset_name = "formset"
>
>
> def get_factory_object(self):
>
> return modelformset_factory(
> self.model,
> form=self.form_class,
> extra=0,
> )
> 
> def get_context_data(self, *, object_list=None, **kwargs):
>
> context_formset_name = getattr(
> self, "context_formset_name") 
>
> context_data = super().get_context_data(**kwargs)
> 
>
> object_list = context_data["object_list"]
>
> initial_data = self.get_initial(object_list)
> context_data[context_formset_name] = self.get_factory_object()(
> queryset=object_list, initial=initial_data
> )
> 
> print(self.request.method , "\n", 
> context_data[context_formset_name], "\n" ,initial_data )
>
> return context_data
>
> def get_initial(self, queryset=None):
> """Generate the initial data for the paginated queryset for the 
> current page"""
>
> if queryset is None:
> queryset = []
>
> try:
> return self.initial
> except AttributeError:
>
> data = [
> {**{
> field_name: getattr(item, field_name)
> for field_name in self.form_class._meta.fields
> if hasattr(item, field_name)
> }, "print_report_check":True}
> for item in queryset
> ]
>
> if self.request.method == "GET":
> try:
> userids_for_checked_boxes = 
> PrintStatementData["to_download"][
> 
> PrintStatementData["list-formset-view_previous-page"]
> ]
> except KeyError:
> pass
> else:
> for i in data:
> if i["PAN_ID"] in userids_for_checked_boxes:
> i["print_report_check"] = True
>
> return data
>
> def get_formset_for_previous_page(self):
> """Set the `page_kwarg` 's  value to the previous page's value 
> because
> the formset's data needs to be compared to the previous page's 
> data.
> The `paginate_queryset` method uses self.kwargs["page_kwarg"]
> to get the queryset corresponding to a page.So just to get the
> initial data corresponding to the previous page through 
> `self.get_form_kwargs` we first need to do this."""
>
> PrintStatementData[
> "list-formset-view_current-page"] = int(self.request.GET.get(
> self.page_kwarg))
>
> self.kwargs[self.page_kwarg] = PrintStatementData.get(
> "list-formset-view_previous-page")
>
> formset = self.get_factory_object()(**self.get_form_kwargs())
>
> self.kwargs[self.page_kwarg] = PrintStatementData.get(
> "list-formset-view_current-page")
>
> return formset
>
>
>

-- 
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/5e95b909-3b25-4e28-a9aa-292dc09c2d59n%40googlegroups.com.


Initial data doesn't go complelely in the modelformset

2021-06-13 Thread VISHESH MANGLA
 in line 38 i have that print statement, it's output is at the top , I dont 
know why that initial data is not going into that model formset.
actually one data the PAN_ID actually went into the modelform, but the 
checkbox's "checked" didnt. You can see the html of the formset and the 
checkbox field doesnt has a checked. 


Code in paste  
https://bpa.st/FOUQ

GET 
 
Print report 
check: 
 [{'PAN_ID': '10012000', 'print_report_check': True}]






class ListFormSetView(ListView):
context_formset_name = "formset"


def get_factory_object(self):

return modelformset_factory(
self.model,
form=self.form_class,
extra=0,
)

def get_context_data(self, *, object_list=None, **kwargs):

context_formset_name = getattr(
self, "context_formset_name") 

context_data = super().get_context_data(**kwargs)


object_list = context_data["object_list"]

initial_data = self.get_initial(object_list)
context_data[context_formset_name] = self.get_factory_object()(
queryset=object_list, initial=initial_data
)

print(self.request.method , "\n", 
context_data[context_formset_name], "\n" ,initial_data )

return context_data

def get_initial(self, queryset=None):
"""Generate the initial data for the paginated queryset for the 
current page"""

if queryset is None:
queryset = []

try:
return self.initial
except AttributeError:

data = [
{**{
field_name: getattr(item, field_name)
for field_name in self.form_class._meta.fields
if hasattr(item, field_name)
}, "print_report_check":True}
for item in queryset
]

if self.request.method == "GET":
try:
userids_for_checked_boxes = 
PrintStatementData["to_download"][

PrintStatementData["list-formset-view_previous-page"]
]
except KeyError:
pass
else:
for i in data:
if i["PAN_ID"] in userids_for_checked_boxes:
i["print_report_check"] = True

return data

def get_formset_for_previous_page(self):
"""Set the `page_kwarg` 's  value to the previous page's value 
because
the formset's data needs to be compared to the previous page's data.
The `paginate_queryset` method uses self.kwargs["page_kwarg"]
to get the queryset corresponding to a page.So just to get the
initial data corresponding to the previous page through 
`self.get_form_kwargs` we first need to do this."""

PrintStatementData[
"list-formset-view_current-page"] = int(self.request.GET.get(
self.page_kwarg))

self.kwargs[self.page_kwarg] = PrintStatementData.get(
"list-formset-view_previous-page")

formset = self.get_factory_object()(**self.get_form_kwargs())

self.kwargs[self.page_kwarg] = PrintStatementData.get(
"list-formset-view_current-page")

return formset


-- 
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/f38a5d27-34bb-4346-ad0c-6ad564a55002n%40googlegroups.com.


Re: Module "django.core.cache.backends.memcached" does not define a "PyMemcacheCache" attribute/class

2021-06-11 Thread VISHESH MANGLA
Thanks for the help. That was the problem, I had django 3.0. I just 
upgraded it.

On Saturday, June 12, 2021 at 3:09:45 AM UTC+5:30 jacobgr...@gmail.com 
wrote:

> Looks like only django 3.2 uses PyMemcacheCache.
> Try:
> "django.core.cache.backends.memcached.MemcachedCache"
>
> Also, make sure you are using the docs for the correct version of django:
> For example: 
> https://docs.djangoproject.com/en/3.0/topics/cache/
>
> instead of: 
>
> https://docs.djangoproject.com/en/3.2/topics/cache/
>
> On Fri, Jun 11, 2021 at 4:20 PM VISHESH MANGLA <
> f201...@pilani.bits-pilani.ac.in> wrote:
>
>> Hello, 
>> Please help with the following error
>>
>> settings.py 
>>
>> CACHES = {
>> "default": {
>>  'BACKEND': 
>> 'django.core.cache.backends.memcached.PyMemcacheCache',
>> 'LOCATION': '127.0.0.1:11211'
>> }
>> }
>>
>>
>> #CACHE_MIDDLEWARE_ALIAS = "teut_cache"
>> #CACHE_MIDDLEWARE_SECONDS = 500
>> #CACHE_MIDDLEWARE_KEY_PREFIX  = ...
>>
>>
>> # Set the cache backend to select2
>> SELECT2_CACHE_BACKEND = "default"
>>
>>
>>
>> Error logs:
>>
>> (venv) PS C:\Users\Dell\OneDrive\Desktop\office\djangodev\massservices> 
>> python manage.py runserver
>> Watching for file changes with StatReloader
>> Performing system checks...
>>
>> Exception in thread django-main-thread:
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
>>  
>> line 20, in import_string
>> return getattr(module, class_name)
>> AttributeError: module 'django.core.cache.backends.memcached' has no 
>> attribute 'PyMemcacheCache'
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\cache\__init__.py",
>>  
>> line 50, in _create_cache
>> backend_cls = import_string(backend)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
>>  
>> line 22, in import_string
>> raise ImportError('Module "%s" does not define a "%s" 
>> attribute/class' % (
>> ImportError: Module "django.core.cache.backends.memcached" does not 
>> define a "PyMemcacheCache" attribute/class
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "c:\python38\lib\threading.py", line 932, in _bootstrap_inner
>> self.run()
>>   File "c:\python38\lib\threading.py", line 870, in run
>> self._target(*self._args, **self._kwargs)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\autoreload.py",
>>  
>> line 53, in wrapper  
>> fn(*args, **kwargs)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>  
>> line 118, in inner_run
>> self.check(display_num_errors=True)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\base.py",
>>  
>> line 392, in check   
>> all_issues = checks.run_checks(
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\registry.py",
>>  
>> line 70, in run_checks
>> new_errors = check(app_configs=app_configs, databases=databases)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 13, in check_url_config
>> return check_resolver(resolver)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 23, in check_resolver
>> return check_method()
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 408, in check
>> for pattern in self.url_patterns:
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\functional.py",
>>  
>> line 48, in

Module "django.core.cache.backends.memcached" does not define a "PyMemcacheCache" attribute/class

2021-06-11 Thread VISHESH MANGLA
Hello, 
Please help with the following error

settings.py 

CACHES = {
"default": {
 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'LOCATION': '127.0.0.1:11211'
}
}


#CACHE_MIDDLEWARE_ALIAS = "teut_cache"
#CACHE_MIDDLEWARE_SECONDS = 500
#CACHE_MIDDLEWARE_KEY_PREFIX  = ...


# Set the cache backend to select2
SELECT2_CACHE_BACKEND = "default"



Error logs:

(venv) PS C:\Users\Dell\OneDrive\Desktop\office\djangodev\massservices> 
python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
 
line 20, in import_string
return getattr(module, class_name)
AttributeError: module 'django.core.cache.backends.memcached' has no 
attribute 'PyMemcacheCache'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\cache\__init__.py",
 
line 50, in _create_cache
backend_cls = import_string(backend)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
 
line 22, in import_string
raise ImportError('Module "%s" does not define a "%s" attribute/class' 
% (
ImportError: Module "django.core.cache.backends.memcached" does not define 
a "PyMemcacheCache" attribute/class

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
  File "c:\python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\autoreload.py",
 
line 53, in wrapper  
fn(*args, **kwargs)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\commands\runserver.py",
 
line 118, in inner_run
self.check(display_num_errors=True)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\base.py",
 
line 392, in check   
all_issues = checks.run_checks(
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\registry.py",
 
line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
 
line 13, in check_url_config
return check_resolver(resolver)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
 
line 23, in check_resolver
return check_method()
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
 
line 408, in check
for pattern in self.url_patterns:
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\functional.py",
 
line 48, in __get__  
res = instance.__dict__[self.name] = self.func(instance)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
 
line 589, in url_patterns  
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\functional.py",
 
line 48, in __get__  
res = instance.__dict__[self.name] = self.func(instance)
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
 
line 582, in urlconf_modulereturn import_module(self.urlconf_name)
  File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1014, in _gcd_import
  File "", line 991, in _find_and_load
  File "", line 975, in _find_and_load_unlocked
  File "", line 671, in _load_unlocked
  File "", line 783, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\massservices\massservices\urls.py",
 
line 7, in 
path("select2/", include("django_select2.urls")),
  File 
"C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\conf.py",
 
line 34, in include
urlconf_module = import_module(urlconf_module)
  File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1014, in _gcd_import
  File "", line 991, in _find_and_load
  File "", line 975, in _find_and_load_unlocked
  File "", line 671, in _load_unlocked
  File "", line 783, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 

Re: Form errors in ListFormsetView created by adding methods to a ListView.

2021-06-11 Thread VISHESH MANGLA
 Sorry , I should have posted the template
well, the error is,  hmm, 
suppose you are at  page 1  , now you clicked next and you got to page 2 
and the `post` method is hit. It will get page number as 2. But for  
formset , the initial data will have to be compared with  page "1" s data 
not "2". In the current scenario ,the initial_data  was the page2's but the 
data that was posted was for page 1. So you see the problem? It took me 
quite long to understand this.

  
 


{% extends 'adminuser/portal.html' %} 
{% block main-content %}
{% load my_extra_filters %}
 {% if messages %}
{% for message in messages %}

{{ message }}
{% endfor %}
 {% endif %}



  {% csrf_token %}
  {{ formset.management_form }}

  

  
Name
Pan ID
Print Report?
  



  {% for user_form in formset %}
{% for user_data in object_list %}
  {% if forloop.counter0 == forloop.parentloop.counter0 %}
  
{{user_data.get_full_name.}}
{{user_data.PAN_ID}}
{{user_form.PAN_ID}}

{{user_form.print_report_check}}
  
  
  {% endif %}
{% endfor %}

  {% endfor %}


 
  


{% if page_obj.has_previous %}
 first

previous
{% endif %}


Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
.


{% if page_obj.has_next %}
next
last 
{% endif %}



  Print



{% endblock main-content%}




On Friday, June 11, 2021 at 8:34:36 PM UTC+5:30 sutharl...@gmail.com wrote:

> possibly you are requesting with the same pan id again
>>
>>

-- 
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/a36ad778-fe78-4f26-b0d1-fb7563bd8081n%40googlegroups.com.


Form errors in ListFormsetView created by adding methods to a ListView.

2021-06-11 Thread VISHESH MANGLA
Hello, 

I am consistently getting this bizarre error and formset_invalid is getting 
triggered.
I just tried to make a generic ListFormSetView.

[11/Jun/2021 12:48:24] "GET /adminuser/print-report/?page=1 HTTP/1.1" 200 
5244
[{'PAN_ID': ['User with this Pan ID already exists.']}]
[11/Jun/2021 12:59:29] "POST /adminuser/print-report/?page=2 HTTP/1.1" 200 
5250

In my model the USERNAME_FIELD  is PAN_ID.

Webpage looks like this

https://ibb.co/CHT4nKB

Code:

class PrintStatementView(ListFormSetView):
paginate_by = 1
model = User
form_class = PrintReportModelForm
template_name = "adminuser/printstatement.html"
context_formset_name = "formset"
ordering = ("PAN_ID",)

def get_factory_object(self):
return modelformset_factory(
self.model,
form=self.form_class,
extra=0,
)

def formset_valid(self, formset):
self.request.session.setdefault("to_download", [])
self.request.session["to_download"][self.kwargs["page"]] = [
x["PAN_ID"]
for x in formset.cleaned_data
if x["print_report_check"]
]
return HttpResponseRedirect(
f"{reverse('print-report')}?page={self.kwargs['page']}"
)

def get_success_url(self):
return reverse("adminuser:trading-window-list")





class ListFormSetView(ListView):
def get_factory_object(self):
return NotImplementedError(" Implement yourself ")

def get_context_data(self, *, object_list=None, **kwargs):

context_formset_name = (
getattr(self, "context_formset_name", None) or "formset"
)

context_data = super().get_context_data(**kwargs)

object_list = context_data["object_list"]
context_data[context_formset_name] = self.get_factory_object()(
queryset=object_list, initial=self.get_initial(object_list)
)

return context_data

def get_form_kwargs(self):

context_data = super().get_context_data()

object_list = context_data["object_list"]

kwargs = {
"initial": self.get_initial(object_list),
"queryset": object_list,
}
if self.request.method in ("POST", "PUT"):
kwargs.update(
{
"data": self.request.POST,
"files": self.request.FILES,
}
)
return kwargs

def get_initial(self, queryset=[]):

""" Generate the initial data for the paginated queryset for the current page"""
try:
return self.initial
except AttributeError:
data = serializers.serialize("json", queryset)
data = json.loads(data)
return data

def post(self, request, *args, **kwargs):
self.object_list = self.get_queryset()
formset = self.get_factory_object()(**self.get_form_kwargs())

if formset.is_valid():
return self.formset_valid(formset)
else:
return self.formset_invalid(formset)

def formset_valid(self, formset):
return HttpResponseRedirect(self.get_success_url())

def formset_invalid(self, formset):
print(formset.errors)
return self.render_to_response(self.get_context_data(formset
=formset))



-- 
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/3e032b7e-2999-4d62-a1d9-e8365e7a037dn%40googlegroups.com.


django admin site password changed every time user's attributes are changed

2021-01-10 Thread Vishesh Mangla

https://dpaste.org/bN7d

Please see code at dpaste.

I 'm trying to modify my admin site so that the admin can create new 
accounts there. After clicking save , to whatever email address which the 
admin has entered an email would bbe sent with a random password. It works 
perfectly but when I try to change the users permission in the admin site, 
first of all the password's hash code is visible and the password gets 
substituted with that hash. 

Also why is the password string visible, shouldn't it be dots here?
https://ibb.co/zXjx0BW

Please help me out.

-- 
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/aadaac81-a608-48f0-9780-bdd217c1fdebn%40googlegroups.com.


Re: UserManager creation for AbstractUserModel extended MyUser

2021-01-09 Thread Vishesh Mangla
Oops I guess, my bad messaging style made you miss the last few pieces of 
my messages. Thanks, but that problem is resolved as written in my previous 
message with the working code. Now I require help with the Migrations 
problem.

On Saturday, January 9, 2021 at 8:00:55 PM UTC+5:30 Amitesh Sahay wrote:

> Hello Vishesh, 
>
> Below is from my models.py:
>
> models.py
> -
>
> from django.contrib.auth.base_user import BaseUserManager
> from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
> from django.utils.translation import gettext_lazy as _
>
>
> class AccountManager(BaseUserManager):
> def create_superuser(self, email, password, **extra_fields):
>
>
> extra_fields.setdefault('is_staff', True)
> extra_fields.setdefault('is_superuser', True)
>
> extra_fields.setdefault('is_active', True)
>
>
>
> if extra_fields.get('is_staff') is not True:
>
> raise ValueError(_('Superuser must have is_staff=True.'))
>
>
> if extra_fields.get('is_superuser') is not True:
>
> raise ValueError(_('Superuser must have is_superuser=True.'))
> return self.create_user(email, password, **extra_fields)
>
> def create_user(self, email, password, **extra_fields):
> if not email:
> raise ValueError(_('Enter the email before proceeding'))
>
> email = self.normalize_email(email)
> user = self.model(email=email, password=password, **extra_fields)
> user.set_password(password)
> user.save()
> return user
>
>
> class Shop(AbstractBaseUser, PermissionsMixin):
> email = models.EmailField(unique=True)
> shop_name = models.CharField(max_length=150)
> contact = models.CharField(max_length=10)
> State = models.CharField(max_length=100)
> district = models.CharField(max_length=100)
> location = models.CharField(max_length=100)
> is_staff = models.BooleanField(default=False)
> is_active = models.BooleanField(default=True)
> date_joined = models.DateTimeField(auto_now_add=True)
> last_login = models.DateTimeField(null=True)
>
> objects = AccountManager()
>
> USERNAME_FIELD = 'email'
> REQUIRED_FIELDS = ['shop_name', 'contact', 'is_staff']
>
> def __str__(self):
> return str(self.shop_name)
>
>
> See if that helps you out.
>
> Regards,
> Amitesh
>
>
> On Saturday, 9 January, 2021, 07:39:18 pm IST, Vishesh Mangla <
> manglav...@gmail.com> wrote: 
>
>
> I did paste my `models.py` with the help the help of a dpaste link. 
> ```
> class UserManager( BaseUserManager):
> 
> def _create_user(self, PAN_ID, password=None, **extra_fields):
> """
> Creates and saves a User with the given email, date of
> birth and password.
> """
> if not PAN_ID:
> raise ValueError('Users must have an email address')
> extra_fields['email'] = self.normalize_email(extra_fields["email"
> ])
> user = self.model(PAN_ID=PAN_ID, **extra_fields)
>
> user.set_password(password)
> user.save(using=self._db)
> return user
> 
> def create_user(self, PAN_ID, password=None, **extra_fields):
>
> extra_fields.setdefault('is_staff', False)
> extra_fields.setdefault('is_superuser', False)
> return self._create_user(PAN_ID, password, **extra_fields)
> 
> def create_superuser(self, PAN_ID, password=None, **extra_fields):
> extra_fields.setdefault('is_staff', True)
> extra_fields.setdefault('is_superuser', True)
>
> if extra_fields.get('is_staff') is not True:
> raise ValueError('Superuser must have is_staff=True.')
> if extra_fields.get('is_superuser') is not True:
> raise ValueError('Superuser must have is_superuser=True.')
>
> return self._create_user(PAN_ID, password, **extra_fields)
>
>
> ```   The following code worked. I used 
> https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
>  
> and the source code from 
> https://github.com/django/django/blob/master/django/contrib/auth/models.py.   
> Can I get help in the migrations and creating groups? Code is in the dpaste 
> s.
> On Saturday, January 9, 2021 at 7:11:23 PM UTC+5:30 Amitesh Sahay wrote:
>
> Could you please paste your models.py
>
> Sent from Yahoo Mail on Android 
> <https://go.onelink.me/107872968?pid=InProduct=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers_wl=ym_sub1=Internal_sub2=Global_YGrowth_sub3=EmailSignature>
>

Re: UserManager creation for AbstractUserModel extended MyUser

2021-01-09 Thread Vishesh Mangla
I did paste my `models.py` with the help the help of a dpaste link. 
```
class UserManager( BaseUserManager):

def _create_user(self, PAN_ID, password=None, **extra_fields):
"""
Creates and saves a User with the given email, date of
birth and password.
"""
if not PAN_ID:
raise ValueError('Users must have an email address')
extra_fields['email'] = self.normalize_email(extra_fields["email"])
user = self.model(PAN_ID=PAN_ID, **extra_fields)

user.set_password(password)
user.save(using=self._db)
return user

def create_user(self, PAN_ID, password=None, **extra_fields):

extra_fields.setdefault('is_staff', False)
extra_fields.setdefault('is_superuser', False)
return self._create_user(PAN_ID, password, **extra_fields)

def create_superuser(self, PAN_ID, password=None, **extra_fields):
extra_fields.setdefault('is_staff', True)
extra_fields.setdefault('is_superuser', True)

if extra_fields.get('is_staff') is not True:
raise ValueError('Superuser must have is_staff=True.')
if extra_fields.get('is_superuser') is not True:
raise ValueError('Superuser must have is_superuser=True.')

return self._create_user(PAN_ID, password, **extra_fields)


```   The following code worked. I used 
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
 
and the source code from 
https://github.com/django/django/blob/master/django/contrib/auth/models.py.   
Can I get help in the migrations and creating groups? Code is in the dpaste 
s.
On Saturday, January 9, 2021 at 7:11:23 PM UTC+5:30 Amitesh Sahay wrote:

> Could you please paste your models.py
>
> Sent from Yahoo Mail on Android 
> <https://go.onelink.me/107872968?pid=InProduct=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers_wl=ym_sub1=Internal_sub2=Global_YGrowth_sub3=EmailSignature>
>
> On Sat, 9 Jan 2021 at 18:36, Vishesh Mangla
>  wrote:
>
> https://dpaste.org/Zz5Z
>
>
> (venv) PS C:\Users\Dell\OneDrive\Desktop\djangodev\mass> python manage.py 
> createsuperuser
> PAN ID: 6785
> Email: s@g
> Error: Enter a valid email address.
> Email: s...@gmail.com
> Name: fjghg
> Type: fg
> Error: Value 'fg' is not a valid choice.
> Type: ADM
> Holding: 568
> Password: 
> Password (again):
> This password is too short. It must contain at least 8 characters.
> Bypass password validation and create user anyway? [y/N]: y
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> main()
>   File "manage.py", line 18, in main
> execute_from_command_line(sys.argv)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 401, in execute_from_command_line
> utility.execute()
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>  
> line 330, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>  
> line 79, in execute
> return super().execute(*args, **options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>  
> line 371, in execute
> output = self.handle(*args, **options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>  
> line 189, in handle
> 
> self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
>   File "C:\Users\Dell\OneDrive\Desktop\djangodev\mass\base\models.py", 
> line 25, in create_superuser
> return super()._create_user(PAN_ID,  password, **extra_fields)
> AttributeError: 'super' object has no attribute '_create_user'
>
> -- 
> 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/b4ff8445-8ed7-4d29-8ae6-73f3b1f8295fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/b4ff8445-8ed7-4d29-8ae6-73f3b1f829

Re: UserManager creation for AbstractUserModel extended MyUser

2021-01-09 Thread Vishesh Mangla
Another thing is that my "employees" group has an additional CharField 
requirement. Only the employees group.How can I add specifically a field to 
that group? Something this 
this:https://stackoverflow.com/questions/16407217/add-extra-fields-to-django-to-django-auth-groups

On Saturday, January 9, 2021 at 6:38:56 PM UTC+5:30 Vishesh Mangla wrote:

> Hi, please help me create this UserManager child class. I 'm stuck up on 
> this. I also need to divide my users into three groups.  
> For this I extended the migrations file.   https://dpaste.org/9VSd. But 
> running `makemigrations` gives no changes detected.
>  Please help with this issue too.
> Thanks in advance.
> On Saturday, January 9, 2021 at 6:35:34 PM UTC+5:30 Vishesh Mangla wrote:
>
>> https://dpaste.org/Zz5Z
>>
>>
>> (venv) PS C:\Users\Dell\OneDrive\Desktop\djangodev\mass> python manage.py 
>> createsuperuser
>> PAN ID: 6785
>> Email: s@g
>> Error: Enter a valid email address.
>> Email: s...@gmail.com
>> Name: fjghg
>> Type: fg
>> Error: Value 'fg' is not a valid choice.
>> Type: ADM
>> Holding: 568
>> Password: 
>> Password (again):
>> This password is too short. It must contain at least 8 characters.
>> Bypass password validation and create user anyway? [y/N]: y
>> Traceback (most recent call last):
>>   File "manage.py", line 22, in 
>> main()
>>   File "manage.py", line 18, in main
>> execute_from_command_line(sys.argv)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>>  
>> line 401, in execute_from_command_line
>> utility.execute()
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>>  
>> line 395, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>>  
>> line 330, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>>  
>> line 79, in execute
>> return super().execute(*args, **options)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>>  
>> line 371, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>>  
>> line 189, in handle
>> 
>> self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
>>   File "C:\Users\Dell\OneDrive\Desktop\djangodev\mass\base\models.py", 
>> line 25, in create_superuser
>> return super()._create_user(PAN_ID,  password, **extra_fields)
>> AttributeError: 'super' object has no attribute '_create_user'
>>
>

-- 
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/6ff80f40-30e1-4c09-9dab-7eae9461d6b2n%40googlegroups.com.


Re: UserManager creation for AbstractUserModel extended MyUser

2021-01-09 Thread Vishesh Mangla
Hi, please help me create this UserManager child class. I 'm stuck up on 
this. I also need to divide my users into three groups.  
For this I extended the migrations file.   https://dpaste.org/9VSd. But 
running `makemigrations` gives no changes detected.
 Please help with this issue too.
Thanks in advance.
On Saturday, January 9, 2021 at 6:35:34 PM UTC+5:30 Vishesh Mangla wrote:

> https://dpaste.org/Zz5Z
>
>
> (venv) PS C:\Users\Dell\OneDrive\Desktop\djangodev\mass> python manage.py 
> createsuperuser
> PAN ID: 6785
> Email: s@g
> Error: Enter a valid email address.
> Email: s...@gmail.com
> Name: fjghg
> Type: fg
> Error: Value 'fg' is not a valid choice.
> Type: ADM
> Holding: 568
> Password: 
> Password (again):
> This password is too short. It must contain at least 8 characters.
> Bypass password validation and create user anyway? [y/N]: y
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> main()
>   File "manage.py", line 18, in main
> execute_from_command_line(sys.argv)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 401, in execute_from_command_line
> utility.execute()
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>  
> line 330, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>  
> line 79, in execute
> return super().execute(*args, **options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
>  
> line 371, in execute
> output = self.handle(*args, **options)
>   File 
> "C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
>  
> line 189, in handle
> 
> self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
>   File "C:\Users\Dell\OneDrive\Desktop\djangodev\mass\base\models.py", 
> line 25, in create_superuser
> return super()._create_user(PAN_ID,  password, **extra_fields)
> AttributeError: 'super' object has no attribute '_create_user'
>

-- 
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/2aaa49cd-78bf-4168-b925-7f4c35320c8cn%40googlegroups.com.


UserManager creation for AbstractUserModel extended MyUser

2021-01-09 Thread Vishesh Mangla
https://dpaste.org/Zz5Z


(venv) PS C:\Users\Dell\OneDrive\Desktop\djangodev\mass> python manage.py 
createsuperuser
PAN ID: 6785
Email: s@g
Error: Enter a valid email address.
Email: s...@gmail.com
Name: fjghg
Type: fg
Error: Value 'fg' is not a valid choice.
Type: ADM
Holding: 568
Password: 
Password (again):
This password is too short. It must contain at least 8 characters.
Bypass password validation and create user anyway? [y/N]: y
Traceback (most recent call last):
  File "manage.py", line 22, in 
main()
  File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
 
line 401, in execute_from_command_line
utility.execute()
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\__init__.py",
 
line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
 
line 330, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
 
line 79, in execute
return super().execute(*args, **options)
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\core\management\base.py",
 
line 371, in execute
output = self.handle(*args, **options)
  File 
"C:\Users\Dell\OneDrive\Desktop\djangodev\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py",
 
line 189, in handle

self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
  File "C:\Users\Dell\OneDrive\Desktop\djangodev\mass\base\models.py", line 
25, in create_superuser
return super()._create_user(PAN_ID,  password, **extra_fields)
AttributeError: 'super' object has no attribute '_create_user'

-- 
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/b4ff8445-8ed7-4d29-8ae6-73f3b1f8295fn%40googlegroups.com.


Re: Exception Type: SuspiciousOperation

2021-01-01 Thread Vishesh Mangla
The error was related to data. The key wasn't in the data.

On Fri, Jan 1, 2021 at 2:07 AM Vishesh Mangla 
wrote:

> I deleted the db and ran the migrations again.
> the actual error is this.   https://dpaste.org/7vb3
>
> On Friday, January 1, 2021 at 1:58:17 AM UTC+5:30 Vishesh Mangla wrote:
>
>> Hi, I am facing this error and 'm stuck on it from quite a lot of time.
>> The error logs: https://dpaste.com/AVG628T9N
>> My code: https://dpaste.org/dSMc
>>
>> I have used  :  https://pypi.org/project/django-postgres-extra/
>> Any help is appreciated,
>> 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/43a427ec-dff7-4e0e-b207-42941edbfa63n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/43a427ec-dff7-4e0e-b207-42941edbfa63n%40googlegroups.com?utm_medium=email_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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACaE8x4isqZ_1g_kmrmsg4ZqM_ZSFLpt-%2ByHtMkLnSopiKnYGA%40mail.gmail.com.


Re: Exception Type: SuspiciousOperation

2020-12-31 Thread Vishesh Mangla
I deleted the db and ran the migrations again. 
the actual error is this.   https://dpaste.org/7vb3

On Friday, January 1, 2021 at 1:58:17 AM UTC+5:30 Vishesh Mangla wrote:

> Hi, I am facing this error and 'm stuck on it from quite a lot of time.
> The error logs: https://dpaste.com/AVG628T9N
> My code: https://dpaste.org/dSMc
>
> I have used  :  https://pypi.org/project/django-postgres-extra/
> Any help is appreciated,
> 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/43a427ec-dff7-4e0e-b207-42941edbfa63n%40googlegroups.com.


Exception Type: SuspiciousOperation

2020-12-31 Thread Vishesh Mangla
Hi, I am facing this error and 'm stuck on it from quite a lot of time.
The error logs: https://dpaste.com/AVG628T9N
My code: https://dpaste.org/dSMc

I have used  :  https://pypi.org/project/django-postgres-extra/
Any help is appreciated,
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/1cd3674d-6f00-4456-a24a-1a1cac3edf66n%40googlegroups.com.


RE: Data Science Guide

2020-08-28 Thread Vishesh Mangla
https://www.youtube.com/watch?v=yzIMircGU5I=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y Sent from Mail for Windows 10 From: Emmanuel Oppong NtiamoahSent: 28 August 2020 21:05To: django-users@googlegroups.comSubject: Data Science Guide Hello friends i have learnt Python for a while now and i want to start with data science. Please can you guide me as to the path, resources and tools to used and advice.  -- 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/E02ED175-CF51-4D50-A66C-64CED59734E8%40gmail.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/1E1CEFF1-6DF6-406D-B871-EF7FDAB99152%40hxcore.ol.


RE: material

2020-08-28 Thread Vishesh Mangla
https://www.youtube.com/watch?v=UmljXZIypDc Sent from Mail for Windows 10 From: sakshi jainSent: 28 August 2020 21:04To: django-users@googlegroups.comSubject: Re: material youtube vedios online On Fri, Aug 28, 2020, 19:23 السعيد حاجي سعيد  wrote:Hello and good morning, I want to start learning dejango. Is there a material in writing to study it? -- 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/5b128545-69b3-4305-8aaf-03ec393c41b8n%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/CAJhs3iOZjZVa8-xz3SwdbtJohFKxqVPp93EO_Jrzs97%3DC7_ruA%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/8874679F-532D-4A23-9124-AB0E8CA93DE9%40hxcore.ol.


RE: HTML Snippets instead of JSON-API

2020-08-28 Thread Vishesh Mangla
You can use Django and react with the help of webpack. Sent from Mail for Windows 10 From: guettliSent: 28 August 2020 14:02To: Django usersSubject: HTML Snippets instead of JSON-API If you read the current articles about software development,you get the impression that you must createa backend API returning JSON (maybe via Django RestFramework)and then create a GUI with React/Vue/Angular I am a backend geek. I like Python, Django, Linux, SQL, and try to avoid _javascript_. Nevertheless I want to develop a modern GUI. By chance I found a nice library: https://htmx.org/ This does exactly what I was looking for. It helps you to update parts of your html page.This way the server sends HTML to the client and htmxinserts the snippets into the page. At the moment I think I found the perfect library. But maybe I am wrong. Which alternatives exist, if you want to avoid JSand render HTML and HTML forms with Django? Regards,  Thomas Güttler -- 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/f737d8cb-6d11-4722-8351-459b903297bbn%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/A08741FF-3F06-475C-8AAE-EAC6698260B2%40hxcore.ol.


RE:

2020-08-14 Thread Vishesh Mangla
https://www.youtube.com/watch?v=UmljXZIypDc Follow this good tutorial. Sent from Mail for Windows 10 From: Suraj KumarSent: 14 August 2020 19:31To: django-users@googlegroups.comSubject:  Hi guys, I am to new django. I am making blog website project. During the making blog website I am stuck one point for last 5 hrs, I don't know how to resolve this. I also searched in google, stackoverflow but I am not satisfied with their answer. So, anyone can help me to resolve this issue. Please find attached screenshot which given below -- 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/CACCwaoVzB1disO9ZtZbPz%3DxrtBgm1gGuTkxx6--%2Bef7ODEjXDQ%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/CD11304B-A4DF-49BA-BD00-E00200BD18BA%40hxcore.ol.


RE: How to get data from django model to excel sheet using openpyxl including images.

2020-07-10 Thread Vishesh Mangla
Api’s are better suited for Django rest framework. Sent from Mail for Windows 10 From: Ashutosh MishraSent: 10 July 2020 18:30To: Django usersSubject: Re: How to get data from django model to excel sheet using openpyxl including images. i have created an api through which i can download the excel file with all fields except images.I am posting my models and views models.py class Task(models.Model): Id=models.IntegerField()Name=models.CharField(max_length=50,null=False,blank=True)Image1=models.FileField(blank=True, default="",upload_to="media/images",null=True)Image2=models.FileField(blank=True, default="",upload_to="media/images",null=True)Date=models.DateField(null=True,blank=True)def __str__(self):return str(self.Name) views.pyclass TaskViewSet(viewsets.ViewSet): def list(self,request):try:queryset=Task.objects.all()response = HttpResponse(content_type='application/ms-excel')#response=HttpResponse(content_type='application/ms-excel') #response['Content-Disposition'] = 'attachment; filename="users.xls'response['Content-Disposition']='attachment; filename="users.xls"' wb=openpyxl.Workbook()ws=wb.active row_num=0columns=['Id','Name','Image1','Image2','Date'] for col_num in range(len(columns)):c = ws.cell(row=row_num + 1, column=col_num + 1)c.value = columns[col_num]for obj in queryset:row_num+=1row = [obj.Id,obj.Name,obj.Image1.url,obj.Image2.url,str(obj.Date),]print(type(row)) for col_num in range(len(row)):c = ws.cell(row=row_num + 1, column=col_num + 1)c.value = row[col_num] wb.save(response)return responseexcept Exception as error:traceback.print_exc()return Response({"message": str(error), "success": False}, status=status.HTTP_200_OK)  On Friday, July 10, 2020 at 5:48:36 PM UTC+5:30 ajoeiam wrote:On Thu, Jul 9, 2020 at 10:02 PM Ashutosh Mishra  wrote:I am creating an api to get data and images from django model to excel sheet ,how can i do that,someone please help me.   What have you tried so far? 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/c1092b58-9d91-4d9c-8654-54df883c5172n%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/80F9CD37-925E-4CB1-A03D-743C8F10EDB4%40hxcore.ol.


RE: Static not working on unix while working on windows

2020-07-06 Thread Vishesh Mangla
Href = "" static appname/something.css %}” Sent from Mail for Windows 10 From: ashish goyalSent: 06 July 2020 23:50To: django-users@googlegroups.comSubject: Static not working on unix while working on windows Hi All, I have created a django app on windows and have used bootstrap navbar n other functions which are working good on windows. Same files I have imported on unix server then i am able to get all details but getting issue with css and js files saying below error Refused to apply style from  because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled angular I am using below script in windows which is working in windows but not on unix { % load static %} Any suggestions, static and static url js defined i. Settings.py already. Since all working fine on windows dont know same code is not working for css and js while data is fetching correctlyThanksAshish-- 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/D45C33B1-949B-4BBE-8338-8982F2A246BF%40gmail.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/2A992212-ECB5-4FBA-BE2A-6775FE777304%40hxcore.ol.


RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_sql.html Sent from Mail for Windows 10 From: Ashutosh MishraSent: 06 July 2020 13:56To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. But It is for js,react,angular, how can I place that in django projectOn Jul 6, 2020 1:54 PM, "Damanjeet Singh"  wrote:Please see handsontable.com. I have been using it for my project. On Mon, Jul 6, 2020 at 9:06 AM Ashutosh Mishra  wrote:What if I have an image field too,how to do that-- 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/9bf3cc78-00bd-4a8f-a6b7-90344f0bded7o%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/CAGLHGi5_9zX%2BLkywRH9GB_hKLJTBRRjmGBw1aCrYSW5WGOj-6Q%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/CAGDmY671qKxoEUL%3DjEWQ7Xso4Opn74W3jh3dtD2Zy9jgvEpjtw%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/1B445B42-39E1-477E-8CAB-7786C3BB5EB3%40hxcore.ol.


RE: How to get data from django model to the excel sheet.

2020-07-06 Thread Vishesh Mangla
@Ashutosh Mishra I think reading your sql table with pandas and using to_excel/to_csv would be great in this case. If you are worried about the images. First of all I don’t know how you are storing your images. One method to store an image is to convert it to a very long base64 string and store it in the database. Then whenever you want to show it use can use that base64 string. Web browsers can understand base64 strings. But using base64 allows anyone to just copy your image so be careful. You can otherwise always decode back from base64 to normal image always. Sent from Mail for Windows 10 From: sum abiutSent: 06 July 2020 13:29To: django-users@googlegroups.comSubject: Re: How to get data from django model to the excel sheet. You can try this export data to excel fileSum, On Mon, Jul 6, 2020 at 7:00 PM Ashutosh Mishra  wrote:I want to get the data from the django model contans(name,age,photo) on a excel sheet.How can i do that.-- 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/b9ad3b60-2c0a-43dc-bdc6-6a67f8a88826n%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/CAPCf-y6tSDOTUDfWWQV652E6yY7M2FRgJuKA4vnc4nPme_j1Bw%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/064866A5-4C93-444A-B415-47D01CDFAF54%40hxcore.ol.


Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Vishesh Mangla
I think learning some sql commands would be good. Lots of youtube tuts
available online.
https://docs.djangoproject.com/en/3.0/topics/db/sql/#executing-custom-sql-directly

On Sun, Jul 5, 2020 at 1:59 AM Akinfolarin Stephen <
akinfolarinsteph...@gmail.com> wrote:

> you can filter out the column you want by using
> [name of model].objects.get(filter=[name of the column you want])
>
> On Sun, Jul 5, 2020 at 10:12 AM Eugene Kulak 
> wrote:
>
>> How to get names of columns from QuerySet without executing it?
>> If it is not possible what would be the most easier way to execute a
>> lighter version of the query.
>> The query itself is unknown, it could be anything.
>>
>> --
>> 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/60c63ddd-80fa-44c5-9a8e-10091e307099o%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/CAFujGLyz6U%3D4t3RSiiAzOo5jkXiCc7bcvzYYyD4do3R-fgbdoQ%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/CACaE8x7k9WTwn4yCaCwdfBWbCBD68exhzetVt1Mp_%3DF1buhgrg%40mail.gmail.com.


RE: Django Uploaded images not displayed in production

2020-06-21 Thread Vishesh Mangla
If the issue is managing static files on the server simply installing Django-heroku saved me from all that trouble. Sent from Mail for Windows 10 From: Rob RiedlingerSent: 21 June 2020 23:40To: Django usersSubject: Re: Django Uploaded images not displayed in production Check out this video  https://youtu.be/kBwhtEIXGII  Denis talks about why this happensOn Sunday, June 21, 2020 at 7:15:43 PM UTC+2, Anton Nyagolov wrote:Thanks I will check out the group too for future reference and etc. Those images are uploaded to a database and are part of a model. I iterate through all the object and for each object I print some information including the images, therefore I cannot specify only one specific image. I use admin so I can add my (new future) projects and only by admin they should be able to display automatically on my website with all the information and structure required. Do you sugest changing the value of the imageField (upload_to="static//my_desired_path) ? -- 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/33d4c599-135d-45d9-abbc-978e404e4f87o%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/A68703DE-32D6-417B-AF0F-64EACA533FE0%40hxcore.ol.


RE: Django Uploaded images not displayed in production

2020-06-21 Thread Vishesh Mangla
Sorry, I misunderstood your problem. But can you also show your views.py. Also your path to MEDIA_ROOT is obfuscated. I used MEDIA_ROOT = os.path.join(BASE_DIR, 'media'). I thing this shall be sufficient to do for a try.  Sent from Mail for Windows 10 From: Anton NyagolovSent: 21 June 2020 22:46To: Django usersSubject: Re: Django Uploaded images not displayed in production Thanks I will check out the group too for future reference and etc. Those images are uploaded to a database and are part of a model. I iterate through all the object and for each object I print some information including the images, therefore I cannot specify only one specific image. I use admin so I can add my (new future) projects and only by admin they should be able to display automatically on my website with all the information and structure required. Do you sugest changing the value of the imageField (upload_to="static//my_desired_path) ? -- 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/d4758123-f506-401b-b488-c3f17385d9fco%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/C64216E4-101F-4398-8264-9499B18F82C2%40hxcore.ol.


RE: Django Uploaded images not displayed in production

2020-06-21 Thread Vishesh Mangla
Hi, first of all welcome on this group. Secondly you can also try https://webchat.freenode.net/  on the #django channel but you first need to register there by asking on #freenode channel. Regarding your problem, images are static files and you should put them in static//your_desired_path to be detectable not media if they are part of your templates. Use src="" url “your_desired_path %} and don’t forget to put {% load static %} at the top of your template. Sent from Mail for Windows 10 From: Anton NyagolovSent: 21 June 2020 22:29To: Django usersSubject: Django Uploaded images not displayed in production Hello everyone, I just discovered this group through Google.I couldn't get any help on stack overflow and hopefully someone here can help. I have deployed a Django App on a Ubuntu server for the first time using Nginx and gunicorn. Before deployment, I used port 8000 to test if everything runs as it is supposed to and all was fine. Since I allowed 'Nginx Full' my database images are not showing up. This is my django project structure:My virtual environment folder and my main project folder are both in the same directory. I have separated them. ```python# Create your models here.class Project(models.Model):    project_name = models.CharField(max_length=120)    project_description = models.CharField(max_length=400)    project_link = models.CharField(max_length=500)    project_image = models.ImageField(upload_to='')    def __str__(self):    return self.project_name``` I have set up my settings.py to :```python# Build paths inside the project like this: os.path.join(BASE_DIR, ...)BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))STATIC_URL = '/static/'STATIC_ROOT = os.path.join(BASE_DIR, 'static')MEDIA_URL = '/media/'MEDIA_ROOT = os.path.join(os.path.dirname(__file__), '..', 'media').replace('\\','/')```My view gets all the project object from a database and passes those to the template. The template renders successfully all other information related to project model except the image field . In my template I do: ```html  {% for project in projects %}    {% if forloop.counter|mod:2 == 0 %}      {% else %}      {% endif %}      alt="Image could not be found :(" style="height:120px; width:166px !important;" />      {{ project.project_name }}  {{ project.project_description}}  Link        {% if forloop.counter|mod:2 == 0 %}    {% endif %}  {% endfor%}      ```Uploading the images works, it sends them in the project's media directory, the problem is that they are not showing up, the alt="" is activated. My main urls.py: ```pythonurlpatterns = [ path('', include('project.urls')),    path('admin/', admin.site.urls),]  + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)```The gunicorn system file:```[Unit]Description=gunicorn daemonAfter=network.target[Service]User=myusernameGroup=www-dataWorkingDirectory=/home/myusername/myprojectExecStart=/home/myusername/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/myusername/myproject/myproject.sock myproject.wsgi:application[Install]WantedBy=multi-user.target```Nginx setup:```  server {    listen 80;    server_name  ;    location = /favicon.ico { access_log off; log_not_found off; }    location /static/ {    root /home/myusername/myproject;    }    location / {    include proxy_params;    proxy_pass http://unix:/home/myusername/myproject/myproject.sock;    }    }```EDIT: When inspecting the image element of the webpage the source of the image it is "/media/imageNmae.png". Any help would be appreciated!-- 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/635fcf7e-6e53-425d-aad1-8638fef425c1o%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/CCDBA280-8772-4A69-9698-430CB19A687A%40hxcore.ol.


RE: Manage.py not working

2020-06-20 Thread Vishesh Mangla
I meant INSTALLED APPS= [], a correction. Sent from Mail for Windows 10 From: Vishesh ManglaSent: 20 June 2020 22:31To: django-users@googlegroups.comSubject: RE: Manage.py not working Isn’t test1 the ‘name’ that you had put in ‘django-admin startproject  ’? Then after this you are supposed to change directory and get into  where you find a folder with  again. Then you make an app with “python manage.py startapp ” I can’t see any apps there. Also you need to put your ‘appname’ under INSTALLED APPS =[  ,] in settings.py in  folder where manage.py is.   Sent from Mail for Windows 10 From: Tanisha JainSent: 20 June 2020 21:53To: django-users@googlegroups.comSubject: Re: Manage.py not working I am already in test1 folder... Please check the terminal section in the attached screenshot.  On Sat, 20 Jun, 2020, 9:34 PM ankit baliyan,  wrote:First of all go to test1 folder then run this command. On Sat, 20 Jun, 2020, 9:11 pm Tanisha Jain,  wrote:Hi everyone,I am new to Django platform. Whenever I am trying to create a new app using  ( python manage.py startapp app1) then I am not able to create app. Neither I get any error message in logs. Can someone plz suggest me what to do now?-- 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/6b4c856f-0849-409a-b77a-b31038572aado%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/CAH0koywoY3YnV2NH7uf3_JXamooJuE2a3Ri27eseurvJ2o7MOA%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/CAF1kx9nAtUe_ox%2BVe5ccyRiC68%2BCThJA-iL6cMFTO52EgFm0QQ%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/02371E28-228E-4CDF-B317-AB995DD52446%40hxcore.ol. 



-- 
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/41344884-654A-4A2A-9469-B59DA35D1F4D%40hxcore.ol.


RE: Manage.py not working

2020-06-20 Thread Vishesh Mangla
Isn’t test1 the ‘name’ that you had put in ‘django-admin startproject  ’? Then after this you are supposed to change directory and get into  where you find a folder with  again. Then you make an app with “python manage.py startapp ” I can’t see any apps there. Also you need to put your ‘appname’ under INSTALLED APPS =[  ,] in settings.py in  folder where manage.py is.   Sent from Mail for Windows 10 From: Tanisha JainSent: 20 June 2020 21:53To: django-users@googlegroups.comSubject: Re: Manage.py not working I am already in test1 folder... Please check the terminal section in the attached screenshot.  On Sat, 20 Jun, 2020, 9:34 PM ankit baliyan,  wrote:First of all go to test1 folder then run this command. On Sat, 20 Jun, 2020, 9:11 pm Tanisha Jain,  wrote:Hi everyone,I am new to Django platform. Whenever I am trying to create a new app using  ( python manage.py startapp app1) then I am not able to create app. Neither I get any error message in logs. Can someone plz suggest me what to do now?-- 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/6b4c856f-0849-409a-b77a-b31038572aado%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/CAH0koywoY3YnV2NH7uf3_JXamooJuE2a3Ri27eseurvJ2o7MOA%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/CAF1kx9nAtUe_ox%2BVe5ccyRiC68%2BCThJA-iL6cMFTO52EgFm0QQ%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/02371E28-228E-4CDF-B317-AB995DD52446%40hxcore.ol.


Re: Manage.py not working

2020-06-20 Thread Vishesh Mangla
https://docs.djangoproject.com/en/3.0/intro/tutorial01/Please follow
this.

On Sat, Jun 20, 2020 at 9:34 PM ankit baliyan 
wrote:

> First of all go to test1 folder then run this command.
>
> On Sat, 20 Jun, 2020, 9:11 pm Tanisha Jain, 
> wrote:
>
>> Hi everyone,
>> I am new to Django platform. Whenever I am trying to create a new app
>> using  ( python manage.py startapp app1) then I am not able to create app.
>> Neither I get any error message in logs. Can someone plz suggest me what to
>> do now?
>>
>> --
>> 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/6b4c856f-0849-409a-b77a-b31038572aado%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/CAH0koywoY3YnV2NH7uf3_JXamooJuE2a3Ri27eseurvJ2o7MOA%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/CACaE8x7rTaLjDMkY7i9-qTBCzYzFWZBzzwbcS5mvjZ1_owXndw%40mail.gmail.com.


RE: Help me out please

2020-06-20 Thread Vishesh Mangla
Easiest solutionhttps://www.w3schools.com/html/html5_geolocation.asp  Otherwise GeoDjango might have something Sent from Mail for Windows 10 From: meera ganganiSent: 20 June 2020 14:03To: django-users@googlegroups.comSubject: Help me out please Hello ,     I am working on attendance module in HR Project, So I implement something new, so as employee enter in the office and login to his system and click on to the check-in button his/her attendance will be marked,     So that's why we need Map APi, First of all we want to find Longitude and latitude of our building, so we can mark his/her attendance,  so please can you help me out in troubled situation      At least you can give some sort of idea of what I will use to implement this  Thanking you in advance -Meera Gangani-- 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/CANaPPPJkTDyd%3DPdW5SoaVCwaKB%2BJKv0kqnid4EXFwYrrPF1X7g%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/805D1B9A-9026-46DB-B917-22F7357D325C%40hxcore.ol.


RE: GSoD 2020

2020-06-20 Thread Vishesh Mangla
Although it has been just a few months for me learning Django, and although a lot of people on #django and #python on IRC say that Django docs are easier but I really felt it difficult to understand the required stuff in the docs without having good knowledge of Django. For example I was interested in using class based views and didn’t know where you get started, the polls app provided almost no information and the best resource I could find after the very basic example was http://ccbv.co.uk/projects/Django/3.0/django.views.generic.edit/FormView/#get_context_data .I really feel the docs aren’t easy for a beginner and even now when I know Django a bit. I also remember when I wanted to use Formset and I wasted time on understanding management form which was put like at the end of the docs page. Well, it would be good to add “accordian” element in the docs so that a user can choose a title of whatever they want and explore that topic, it w’d also make it easier for writers to extend a section. Sent from Mail for Windows 10 From: Spring-dotSent: 19 June 2020 18:36To: Django usersSubject: Re: GSoD 2020 Please!!! Someone help!!! I know the basics but cannot find project ideas for GSoD 2020. Do we have to write our own idea for improving the documentation?On Wednesday, June 17, 2020 at 11:01:09 PM UTC+5:30, Spring-dot wrote:What are the project ideas for contributing to Django for GSoD, 2020? Anyone who can guide me in this? Please Help!!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/31a08f56-e75d-437b-b07f-9e86d2630414o%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/AED23B45-6C1C-4321-A047-1B3B6B8970CB%40hxcore.ol.


RE: Please help me out!

2020-06-19 Thread Vishesh Mangla
See Django messages Sent from Mail for Windows 10 From: meera ganganiSent: 19 June 2020 12:01To: django-users@googlegroups.comSubject: Please help me out! Hello ,              I want to implement a Notification module in my Project could you please help me out!  Thank you-Meera Gangani-- 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/CANaPPPJJq_r9AZqeQACGqMpGjPzzx1sJA%3DLQr-K3FJ6s4%3DQkbA%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/0DD42743-FD68-417A-9AB2-C78FD56B2FDB%40hxcore.ol.


RE: why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views

2020-06-18 Thread Vishesh Mangla
If your wish whatever you want to use, all you have to use is the “request” variable that Django gives you. Btw see “generic views”.  Sent from Mail for Windows 10 From: yashwanth balanaguSent: 18 June 2020 12:23To: Django usersSubject: why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views-- 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/4e4b1e4b-1a59-43d9-8835-4992e986f943o%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/42275F4A-510E-4C3B-B5CA-14C4D4156228%40hxcore.ol.


RE: Django Saving a form with Imagefield on shared host

2020-06-17 Thread Vishesh Mangla
One thing that can be done is to save the image as a base64 string in the database. https://stackoverflow.com/questions/3715493/encoding-an-image-file-with-base64 Sent from Mail for Windows 10 From: MUGOYA DIHFAHSIHSent: 14 June 2020 19:15To: Django usersSubject: Django Saving a form with Imagefield on shared host I am working on django project and now i have deployed it with NamecheapWhen i submit a form that does not have an ImageField, the form submits successfully on the shared hostbut when i submit a form with one of the fields ImageField, it raises 404 error.but on the localhost, the forms work perfectly.what can i do to submit such forms on a shared host.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/b79bb9b5-46b4-43eb-9ea5-3eaab14336ddo%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/3F4C1D42-FB11-49A2-8A6E-BF990EE847AD%40hxcore.ol.


RE: Need your help!!

2020-06-15 Thread Vishesh Mangla
What kind of security? Sent from Mail for Windows 10 From: meera ganganiSent: 15 June 2020 22:28To: django-users@googlegroups.comSubject: Need your help!! Hello ,                  How to apply security in django application and  how to secure django applications Thanks in advance -Meera Gangani-- 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/CANaPPPLr9DJstjDvYOOrddtY4fcfNLs7xgudWfJ1aFhkROL0GA%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/6B653CD7-68CB-4C56-9FB3-034FF4902547%40hxcore.ol.


RE: Required Python Django developers

2020-06-06 Thread Vishesh Mangla
Hi, I m interested but I started Django a few months ago only but know about models, forms, html, css, _javascript_. I don’t have any full projects but do know tensorflow and OpenCV too.I know GitHub.  Try considering me. I might not be an expert but am good enough. Sent from Mail for Windows 10 From: SHUBHAM .SINGH. RATHORESent: 06 June 2020 22:21To: django-users@googlegroups.comSubject: Re: Required Python Django developers I am interested  On Sat, 6 Jun 2020, 8:45 pm Appu Yadav,  wrote:hii i am interested On Sat, 6 Jun 2020, 20:39 maninder singh Kumar,  wrote:Dear all, We require python django developers for a HR project.  Please answer to maninder.s.ku...@gmail.com if interested. regardsWilly-- 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/CABOHK3R1pdwbzavYP48KA_g_pLm_5kkqNSxwhGdcRf4mfetw6w%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/CAF_eevdaFN2s3XugAyH4ZSkOzv1KWUc1ZmHLQG%3DQmROhH5Wa6Q%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/CALkhXJWegzFr4jx2gXM3c2NuYbWy%2B2vYLhReJC5oLoNy54SCAA%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/65EDBF18-1C3D-44B7-996B-0E2C28EBFAB9%40hxcore.ol.


RE: How to convert the static image files of a readymade template to dynamic

2020-06-05 Thread Vishesh Mangla
First of all, if you will use .css file, it would be better. In that you can include image the usual way.But still if you would like it as inline element thenn use “...{% url ‘’ %}...”. Mind the single commas and double commas.Sent from Mail for Windows 10 From: Rabbi RabbiSent: 05 June 2020 20:57To: Django usersSubject: How to convert the static image files of a readymade template to dynamic Please help me to fix this. Do I need to use a double quotation before and after the .jpg link? -- 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/9abe66f6-06d2-4851-a41c-b45ab129033bo%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/CD689EDE-504B-44D6-B043-685D0F7F50D4%40hxcore.ol.


RE: Any free MAP API available

2020-06-04 Thread Vishesh Mangla
There’s map-box too if you w’d like to use it.  https://www.mapbox.com/ Sent from Mail for Windows 10 From: meera ganganiSent: 04 June 2020 09:22To: django-users@googlegroups.comSubject: Re: Any free MAP API available you can use Geo-Django Library available in django  On Thu, Jun 4, 2020 at 3:15 AM Ram  wrote:Hi, We need to add location map based on the zip code in our DJango web application. Is there any free API available out there? if you have used it already could you suggest one? Thanks,~Ram-- 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/CA%2BOi5F02G9gW64FAPfKYHjEGf28hp34ePmg%3Dd%2BtVtHNSEs%2BqQg%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/CANaPPPKaoD3WGBis436dRPzyc96UsKq6SUg8RfyFV%2BkvPC1gsA%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/5C45CF8F-5DA7-4933-A87F-BC3CAA3CDCC5%40hxcore.ol.


RE: Please help me out!!!!!

2020-06-03 Thread Vishesh Mangla
Href="" url ‘ name’%}Where name is the name parameter of the view in urls.py. Urlpatterns=[path(“/myview”, views.myview, name=”myview”)] In this caseHref="" url ‘ App_name/myview’%}Write your app name in App name Sent from Mail for Windows 10 From: meera ganganiSent: 03 June 2020 12:49To: django-users@googlegroups.comSubject: Please help me out! Hello Django-users href is not workinghere is my views.py file and my urls.py file Please Help me out!! Thank you in advance-Meera-- 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/CANaPPPLbk6JV8tQjxkKUiN-H%3D_JLHjztMQfGLK6oUx9ootEojg%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/B95F9502-B7D0-49C6-8E4E-0C3B2F80EF21%40hxcore.ol.


RE: RES: Please help me pip install mysqlclient time screenshot image this error

2020-05-26 Thread Vishesh Mangla
Sorry for duplicate answer. I posted late. Sent from Mail for Windows 10 From: Samuel NogueiraSent: 26 May 2020 22:49To: django-users@googlegroups.comSubject: RES: Please help me pip install mysqlclient time screenshot image this error In the error shows that you don’t have visual C++ 14.0 installed in your machine, have you already verified if you have it or not? Try to install the especified version and them try the pip command again. Enviado do Email para Windows 10 De: R D SainiEnviado:terça-feira, 26 de maio de 2020 14:10Para: Django usersAssunto: Please help me pip install mysqlclient time screenshot image this error  -- 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/a204a4ea-a42d-472e-a9e3-08d339bd8486%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/5ecd4f73.1c69fb81.6a4d9.1d07%40mx.google.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/5ecd5f31.1c69fb81.c9f40.0bee%40mx.google.com.


RE: Please help me pip install mysqlclient time screenshot image this error

2020-05-26 Thread Vishesh Mangla
See the last photo, it says Microsoft Visual C++ 14 required. You are surely using win 7. Please try install Visual studio community version  https://visualstudio.microsoft.com/vs/. Sent from Mail for Windows 10 From: R D SainiSent: 26 May 2020 22:40To: Django usersSubject: Please help me pip install mysqlclient time screenshot image this error  -- 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/a204a4ea-a42d-472e-a9e3-08d339bd8486%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/5ecd5ecc.1c69fb81.3fb32.0f71%40mx.google.com.


RE: Error while trying to send email for password reset

2020-05-24 Thread Vishesh Mangla
\u...    represents a Unicode character and you are using an ascii-decoder to decode it.Consider using encoding=”utf-8”. Sent from Mail for Windows 10 From: sunday honestySent: 24 May 2020 21:09To: Django usersSubject: Error while trying to send email for password reset I got the following error while trying to send email with send grid smtp UnicodeEncodeError: 'ascii' codec can't encode character '\u2020' in position 168: ordinal not in range(128) -- 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/e3baf159-4247-413a-89cf-7c1993aee2b1%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/5ecb3208.1c69fb81.b1a28.755f%40mx.google.com.


RE: how to use .py file function via html or css button from django template

2020-05-23 Thread Vishesh Mangla
You can create a .py file in the same location where your views.py file is.Then to import any function from there in the views.py you can use,from  import I rather prefer to make a folder structure like templates/ and static/ And name it backend/my_appThen inside there I store all the .py filesThen in views I usefrom .backend.my_app import module_nameSent from Mail for Windows 10 From: THIRUMALAIVASAN KSent: 23 May 2020 17:03To: Django usersSubject: how to use .py file function via html or css button from django template Hi,  i have created a site for local use and i need to run some some python script  when i click the button , how to do that   i am using on raspberry  to contoll something via dashboard , so i am used django to create a site but i can't ontroll the GPIO pin's via website button-- 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/0f01c9a8-60fb-4597-9170-c896e18058c5%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/5ec91644.1c69fb81.c2d43.4742%40mx.google.com.


  1   2   >