Re: Django FastCGI and static files

2019-09-28 Thread Sipum
Block or mark as spam.
I think it will work. Give it a try

On Sat, 28 Sep, 2019, 7:30 PM Anike Sadia,  wrote:

> Hi pls how to leave this group
>
>
> On Tue, 17 Sep 2019 at 17:16, Martin Jaan Leesment 
> wrote:
>
>> Hey
>>
>> I'm new to serving Django website on a shared server as well as using
>> fastcgi and .htaccess so this might be a basic question. Namely I'm having
>> difficulties serving static content. I've tried playing with htaccess
>> rules, but no luck yet. My project structure:
>>
>> myproject/
>> ├── myapp
>> │   ├── admin.py
>> │   ├── apps.py
>> │   ├── models.py
>> │   ├── static
>> │   │   └── myapp
>> │   │   ├── css
>> │   │   │   ├── bootstrap.min.css
>> │   │   │   ├── bootstrap.min.min_myproject.css
>> │   │   │   └── proj.css
>> │   │   ├── fonts
>> │   │   ├── images
>> │   │   │   ├── logo.png
>> │   │   └── scripts
>> │   │   ├── bootstrap.bundle.min.js
>> │   │   └── bootstrap.min.js
>> │   ├── templates
>> │   │   └── myapp
>> │   │   ├── base.html
>> │   │   ├── footer.html
>> │   │   ├── header.html
>> │   │   ├── index.html
>> │   ├── tests.py
>> │   ├── urls.py
>> │   └── views.py
>> ├── manage.py
>> ├── myproject
>> │   ├── __init__.py
>> │   ├── locale
>> │   ├── media
>> │   ├── settings
>> │   │   ├── base.py
>> │   │   ├── dev.py
>> │   │   ├── __init__.py
>> │   │   ├── prod.py
>> │   ├── static
>> │   ├── templates
>> │   │   └── base.html
>> │   ├── urls.py
>> │   └── wsgi.py
>> ├── requirements
>> └── test.py
>>
>> My htaccess
>>
>> Options +ExecCGI
>> AddHandler fcgid-script .fcgi
>> RewriteEngine On
>> RewriteRule ^(/static.*)$ /static//$1 [L]
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteRule ^(.*)$ cgi-bin/mydjangapp.fcgi/$1 [QSA,L]
>>
>>
>> If anybody can help me figure out how to solve it, would really
>> appreciate.
>>
>> Thanks!
>>
>> Best
>> MJ
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/80c1e98b-8a0a-482c-a20f-29b4c7afdcab%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/CADi3MtsqOtuN%2BEuArMCZSJBuW-AYgvqDkDU4RsP3Y%2BF62SC_bQ%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/CAGHZBzzeObUv0vLdoU4arPb8iYz1pGYSKEUSopC7nX7Fz_YAcw%40mail.gmail.com.


Re: convert python 3 to python2

2019-09-21 Thread Sipum
Hi Ankita,

In coming January, python 2 is going to retire. So better to use python 3.

Thanks

On Sat, 21 Sep, 2019, 11:02 PM Ankita Gupta, 
wrote:

> Not related to Django, I have a project made in python3 but due to some
> package installation, i need to convert my project to python2. Is there any
> method or package to solve 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/875549f9-5bca-4280-88fd-db197ca577dc%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/CAGHZBzxUd6Bnx-YdpZ3PV6NVd1HtsDJU327eO2RsyNUX4pTBCQ%40mail.gmail.com.


Re: Raju | ITC Infotech - Looking for Backend Developers (Python/Django ORM - New York City )

2019-09-18 Thread Sipum
Hi Preetham,

I know we are in s/w industry and we are well known of copy and paste. But
u did it here also. 
Thanks.


On Wed, 18 Sep, 2019, 11:47 AM Preetham Varanasi, <
varanasipreetham...@gmail.com> wrote:

> Hi Raju,
> I m interested but can remote possible as currently, I m in India?
>
>
> Thank you
> Regards
> Preetham
>
> On Wed, Sep 18, 2019 at 8:05 AM Sipum  wrote:
>
>> Hi Raju,
>>
>> I m interested but can remote possible as currently I m in India?
>>
>> Thank you
>> Regards
>> Sipum
>>
>> On Wed, 18 Sep, 2019, 2:06 AM Raju N Somanna, 
>> wrote:
>>
>>> Hi All
>>>
>>> I've an immediate need for Backend Developers (*Python/Django ORM* -
>>> New York City) with my client in NYC. As the title suggests my team is
>>> looking for Python/Django specialist, someone who is good experience on
>>> ORM.
>>>
>>> Please do let me know if you have any from your contacts/references who
>>> might be interested in this opportunity.
>>>
>>> *PS: ABOUT US*
>>> ITC Infotech is a Global IT Consulting Organization with $200 mil+ in
>>> revenues, 8000+ resources footprint across Americas, Europe, South Africa,
>>> Asia Pacific and India.
>>> Presence in the US from the past 17 years, with resources working in
>>> over 24 states. Our US innovation labs are in San Jose, CA and we also have
>>> offices in NJ, MI, AR.
>>> We have plenty of successful use cases across diversified verticals
>>> including: Banking & Financial Services, Healthcare, Mfg, CPG-Retail,
>>> Hi-Tech.
>>> Our technology footprint encompasses: IoT, ML, AI, AR, RPA, Blockchain,
>>> Big Data, Product Engineering (we own a technology agnostic DevOps
>>> product), App Dev, Infra, PTC - PLM, ERP, BI, DW, Data Science…
>>> We are backed by a parent company with over $50 billion market cap and
>>> over 26,000 employees world-wide.
>>>
>>> Regards
>>> Raju NS
>>>  raju...@itcinfotech.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/4a35e21e-fef7-46b9-bdc5-72767c3e3196%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4a35e21e-fef7-46b9-bdc5-72767c3e3196%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/CAGHZBzzY-Rx86JdSQouF%2B6y__rnFkiFDVJrP%3DDvQOsp4kNYpvQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAGHZBzzY-Rx86JdSQouF%2B6y__rnFkiFDVJrP%3DDvQOsp4kNYpvQ%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/CANFgYc4_VH%2BLLNtpxH4o7ZNOkd8Q_s_40mC1r7nHWKBPNa3LoQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANFgYc4_VH%2BLLNtpxH4o7ZNOkd8Q_s_40mC1r7nHWKBPNa3LoQ%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/CAGHZBzwrWfNwX1nqD9FFyCzwwJv%2BB6KguXgceWWs-OUNLgQeEQ%40mail.gmail.com.


Re: Raju | ITC Infotech - Looking for Backend Developers (Python/Django ORM - New York City )

2019-09-17 Thread Sipum
Hi Raju,

I m interested but can remote possible as currently I m in India?

Thank you
Regards
Sipum

On Wed, 18 Sep, 2019, 2:06 AM Raju N Somanna,  wrote:

> Hi All
>
> I've an immediate need for Backend Developers (*Python/Django ORM* - New
> York City) with my client in NYC. As the title suggests my team is looking
> for Python/Django specialist, someone who is good experience on ORM.
>
> Please do let me know if you have any from your contacts/references who
> might be interested in this opportunity.
>
> *PS: ABOUT US*
> ITC Infotech is a Global IT Consulting Organization with $200 mil+ in
> revenues, 8000+ resources footprint across Americas, Europe, South Africa,
> Asia Pacific and India.
> Presence in the US from the past 17 years, with resources working in over
> 24 states. Our US innovation labs are in San Jose, CA and we also have
> offices in NJ, MI, AR.
> We have plenty of successful use cases across diversified verticals
> including: Banking & Financial Services, Healthcare, Mfg, CPG-Retail,
> Hi-Tech.
> Our technology footprint encompasses: IoT, ML, AI, AR, RPA, Blockchain,
> Big Data, Product Engineering (we own a technology agnostic DevOps
> product), App Dev, Infra, PTC - PLM, ERP, BI, DW, Data Science…
> We are backed by a parent company with over $50 billion market cap and
> over 26,000 employees world-wide.
>
> Regards
> Raju NS
>  raju...@itcinfotech.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/4a35e21e-fef7-46b9-bdc5-72767c3e3196%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4a35e21e-fef7-46b9-bdc5-72767c3e3196%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/CAGHZBzzY-Rx86JdSQouF%2B6y__rnFkiFDVJrP%3DDvQOsp4kNYpvQ%40mail.gmail.com.


Re: President of India: Save Nallamala Forest from Uranium Mining @rashtrapatibhvn @TelanganaCMO

2019-09-14 Thread Sipum
What the fuck is going on.. Here it is not the place to sign petition. It
is to django doubt clearing group where one helps other to help.

Shame on you guys. U arw fucking kids spamming it.

On Sat, 14 Sep, 2019, 1:25 PM ,  wrote:

> Bonjour,
> Je viens de signer la pétition "President of India: Save Nallamala Forest
> from Uranium Mining @rashtrapatibhvn @TelanganaCMO" et je souhaitais savoir
> si vous voudriez nous aider en ajoutant votre signature.
>
> Notre objectif est d'atteindre 150 000 signatures et nous avons besoin de
> plus de soutiens. Pour en savoir plus et pour signer, c'est ici:
>
> http://chng.it/ktbBSnYLrv
>
> Merci!
> Franck
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANRJ%3D3nomv0Xocynogqxzx7BHzTb4ZsPQNn-h-f1Q5fYtkQM8A%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/CAGHZBzxkiLUP4-9_jaJ5-Jd8Ss3t%3DabGSwwF6eUeN%2BHok0GtgQ%40mail.gmail.com.


Re: migrate error

2019-09-09 Thread Sipum
Show the code where u have used datetime.datetime.

Whenever u are asking something, its better to show code where the error is
arised. So it will be easy for others to find the error otherwise no one
will answer ur question bro.

On Tue, 10 Sep, 2019, 8:14 AM Pradeep Singh,  wrote:

>  I didnot get why i am getting this error .please help to fix 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/CANwgZcYfHyD1UGoG_faXv%3DBDnRVcHOBQoQ%3DovUhtV_14VVXmTw%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/CAGHZBzzkphdgsfhkk95vdTd0ZpW0%3Dx0STd4S9x7_LgxgYFk%2BWg%40mail.gmail.com.


Re: page not found but url exists

2019-08-26 Thread Sipum
Hey,

Try by giving forward slashes(/) at the end of the each urls instead of
using backward slashes like...

Do as -
register/
login/customer/

I think It will work

On Tue, 27 Aug, 2019, 3:16 AM James Schneider, 
wrote:

>
>
>
>> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
>> in this order:
>>
>>1. admin/
>>2. [name='home']
>>3. /login [name='clogin']
>>4. /login/customer [name='cpage']
>>5. /register [name='cregister']
>>6. /register/customer [name='cpage']
>>
>> The current path, register, didn't match any of these.
>>
>
>
> I'm assuming your template has a typo in the {% url %} tag referencing
> 'register' instead of 'cregister'.
>
> The rest of the error page should indicate the line that is making the URL
> name resolution call.
>
> -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/CA%2Be%2BciWdirAoL_xMRJEdD%3DRY6omVH4UC6xsFFb4RfH747LaSNA%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/CAGHZBzxyHHvFjaKKiwesxgO3K%3DLk9BLNEnUgwuH%3Dd%3Dc8xFSJPg%40mail.gmail.com.


Re: Get queryset outside models.py

2019-08-23 Thread Sipum
What error you are getting cannu post it here with your code for model
manager.

On Sat, 24 Aug, 2019, 2:20 AM Ezequias Rocha, 
wrote:

> Hi everyone
>
> I would like to know if it is possible to retrieve *models*.mymodel
> instance from outside the models.py to retrieve a queryset.
>
> I want to make a selection in a specific model but I am not inside the
> model.
>
> I need to perform some update in my action  model but the information is
> in another entity.
>
> I tryed to use Manager (mymodel = models.Manager() but I havn't found any
> function to get an specific queryset from Manager.
>
> Could someone help me with this issue?
>
> Best regards
> Ezequias
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2aa7bdd8-3f4e-4949-beed-292468e8edaf%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/CAGHZBzzPsP6iv2xp6f-1iVe%2BmEJWHhz%2BWJN4V0BrxCGdkOk8eA%40mail.gmail.com.


Re: Django sql raw query to queryset

2019-08-23 Thread Sipum
You can use Queryset like -

course_review_report.objects.select_related('courses')

On Fri, 23 Aug, 2019, 11:07 AM Suraj Thapa FC, 
wrote:

> SELECT *
> FROM course_review_report LEFT JOIN courses ON course_review_report.cid =
> courses.cid
>
>
> Can anyone pls write the querryset for the above sql query
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPjsHcFbqD%2BgX1NA8QLYFsJUkb9VydzzcBRrNO2FpCyAgS0nqw%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/CAGHZBzyCMzkdjvjdAg4MbF0tQgotCZkorunJQbi4v1xEqsFsBw%40mail.gmail.com.


Re: Regarding to suggestion for registration page

2019-08-21 Thread Sipum
Can u plz tell what you have done so we can learn also.

On Thu, 22 Aug, 2019, 11:16 AM RONAK JAIN,  wrote:

> Thank you so much all of you for your kind of help.
>
>
> I have done this Task.
>
>
> Thanks
>
>
>
>
>
> On Thu, Aug 22, 2019 at 10:21 AM Sipum  wrote:
>
>> Hey Ronak,
>>
>> At first u did wrong in import.
>>
>> Do as below and compare what u have done.
>>
>> From django.contrib.auth.models import User
>> From django.contrib import auth
>>
>> Then when u are creating user do as-
>>  user = User.objects.create_user(uanme,pwd,email)
>>
>> THEN for login after sign up use as below -
>> auth.login(request, user)
>>
>> On Thu, 22 Aug, 2019, 10:02 AM 'Gaurav Ravindra Bole' via Django users, <
>> django-users@googlegroups.com> wrote:
>>
>>> in register method
>>> add user.set_password = request.POST.get('password') before user.save()
>>>
>>> On Wed, Aug 21, 2019 at 10:56 PM 'Amitesh Sahay' via Django users <
>>> django-users@googlegroups.com> wrote:
>>>
>>>> I guess you have forgotten to mention the APP name under which the
>>>> pages are created. Please cross-verify on my observation .
>>>>
>>>> Regards,
>>>> Amitesh Sahay
>>>> *91-750 797 8619*
>>>>
>>>>
>>>> On Wednesday, 21 August, 2019, 12:35:28 pm IST, RONAK JAIN <
>>>> jainronak...@gmail.com> wrote:
>>>>
>>>>
>>>> Hey
>>>> I tried but still getting like that...
>>>>
>>>> Attached screenshots take a look..
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> On Wed, Aug 21, 2019 at 12:23 PM Tosin Ayoola 
>>>> wrote:
>>>>
>>>> Using httpRedirect to d view 4 the URL u want user to b redirected to
>>>>
>>>> On Aug 21, 2019 06:21, "RONAK JAIN"  wrote:
>>>>
>>>> I am trying to redirect my registration page but, I am not getting *please
>>>> check my attached screenshot* and please let me know where I am doing
>>>> wrong...
>>>>
>>>>
>>>>
>>>> On Tue, Aug 20, 2019 at 10:26 AM Sipum  wrote:
>>>>
>>>> Hey Ronit,
>>>>
>>>> It is very simple.
>>>> Just do return redirect ('/name used in url')
>>>>
>>>> If ur url for home page be like,  path('home', views.index, name='home')
>>>>
>>>> Then u hv to write as redirect('/home').
>>>>
>>>>
>>>> On Tue, 20 Aug, 2019, 9:43 AM Ronit Mishra, 
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> If I've understood your issue correctly, you probably just need to add
>>>> this lil' snippet in your settings.py
>>>>
>>>> LOGIN_REDIRECT_URL = '/' (or wherever you wanna redirect after login)
>>>>
>>>> Let me know if it works out for you!
>>>>
>>>> Regards,
>>>> Ronnie
>>>>
>>>> On Tue, Aug 20, 2019 at 2:40 AM Smovie Makers Club 
>>>> wrote:
>>>>
>>>> return redirect('{{ request.scheme }}://{{ request.get_host }}')
>>>> This will redirect to home page
>>>>
>>>> On Mon, 19 Aug 2019, 3:52 pm RONAK JAIN, 
>>>> wrote:
>>>>
>>>> Hello Django developers,
>>>>
>>>> I am trying to redirect my registration page on the home page but, I am
>>>> not getting when I am trying with a registration page it will work for
>>>> registration but when I am doing with the home page so I am not getting.
>>>>
>>>> *Home Page : localhost:8000*
>>>>
>>>> *Could you help me out with this problem?*
>>>>
>>>> *Attached screenshots for Better Understanding please check it 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/CA%2BAqMUeYs7CALaGOmfFfJ%2BHp%3DWoKMyrjvYcOc8Za3JkTLFY_CQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CA%2BAqMUeYs7CALa

Re: Regarding to suggestion for registration page

2019-08-21 Thread Sipum
Hey Ronak,

At first u did wrong in import.

Do as below and compare what u have done.

>From django.contrib.auth.models import User
>From django.contrib import auth

Then when u are creating user do as-
 user = User.objects.create_user(uanme,pwd,email)

THEN for login after sign up use as below -
auth.login(request, user)

On Thu, 22 Aug, 2019, 10:02 AM 'Gaurav Ravindra Bole' via Django users, <
django-users@googlegroups.com> wrote:

> in register method
> add user.set_password = request.POST.get('password') before user.save()
>
> On Wed, Aug 21, 2019 at 10:56 PM 'Amitesh Sahay' via Django users <
> django-users@googlegroups.com> wrote:
>
>> I guess you have forgotten to mention the APP name under which the pages
>> are created. Please cross-verify on my observation .
>>
>> Regards,
>> Amitesh Sahay
>> *91-750 797 8619*
>>
>>
>> On Wednesday, 21 August, 2019, 12:35:28 pm IST, RONAK JAIN <
>> jainronak...@gmail.com> wrote:
>>
>>
>> Hey
>> I tried but still getting like that...
>>
>> Attached screenshots take a look..
>>
>>
>>
>> Thanks
>>
>> On Wed, Aug 21, 2019 at 12:23 PM Tosin Ayoola 
>> wrote:
>>
>> Using httpRedirect to d view 4 the URL u want user to b redirected to
>>
>> On Aug 21, 2019 06:21, "RONAK JAIN"  wrote:
>>
>> I am trying to redirect my registration page but, I am not getting *please
>> check my attached screenshot* and please let me know where I am doing
>> wrong...
>>
>>
>>
>> On Tue, Aug 20, 2019 at 10:26 AM Sipum  wrote:
>>
>> Hey Ronit,
>>
>> It is very simple.
>> Just do return redirect ('/name used in url')
>>
>> If ur url for home page be like,  path('home', views.index, name='home')
>>
>> Then u hv to write as redirect('/home').
>>
>>
>> On Tue, 20 Aug, 2019, 9:43 AM Ronit Mishra, 
>> wrote:
>>
>> Hi,
>>
>> If I've understood your issue correctly, you probably just need to add
>> this lil' snippet in your settings.py
>>
>> LOGIN_REDIRECT_URL = '/' (or wherever you wanna redirect after login)
>>
>> Let me know if it works out for you!
>>
>> Regards,
>> Ronnie
>>
>> On Tue, Aug 20, 2019 at 2:40 AM Smovie Makers Club 
>> wrote:
>>
>> return redirect('{{ request.scheme }}://{{ request.get_host }}')
>> This will redirect to home page
>>
>> On Mon, 19 Aug 2019, 3:52 pm RONAK JAIN,  wrote:
>>
>> Hello Django developers,
>>
>> I am trying to redirect my registration page on the home page but, I am
>> not getting when I am trying with a registration page it will work for
>> registration but when I am doing with the home page so I am not getting.
>>
>> *Home Page : localhost:8000*
>>
>> *Could you help me out with this problem?*
>>
>> *Attached screenshots for Better Understanding please check it 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/CA%2BAqMUeYs7CALaGOmfFfJ%2BHp%3DWoKMyrjvYcOc8Za3JkTLFY_CQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CA%2BAqMUeYs7CALaGOmfFfJ%2BHp%3DWoKMyrjvYcOc8Za3JkTLFY_CQ%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/CAKqY%3DSTmdtAMa9N_zfcjgai_3XP7iGuXQgNsyPT2h5EuGCE7KQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKqY%3DSTmdtAMa9N_zfcjgai_3XP7iGuXQgNsyPT2h5EuGCE7KQ%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/CACh0Ehx0QcsmJaU2NoV47WpJDgkSM-dpX9gkvvffgvD57uqoQA%40mail.gmail.com
>> <https://grou

Re: Regarding to suggestion for registration page

2019-08-19 Thread Sipum
Hey Ronit,

It is very simple.
Just do return redirect ('/name used in url')

If ur url for home page be like,  path('home', views.index, name='home')

Then u hv to write as redirect('/home').


On Tue, 20 Aug, 2019, 9:43 AM Ronit Mishra, 
wrote:

> Hi,
>
> If I've understood your issue correctly, you probably just need to add
> this lil' snippet in your settings.py
>
> LOGIN_REDIRECT_URL = '/' (or wherever you wanna redirect after login)
>
> Let me know if it works out for you!
>
> Regards,
> Ronnie
>
> On Tue, Aug 20, 2019 at 2:40 AM Smovie Makers Club 
> wrote:
>
>> return redirect('{{ request.scheme }}://{{ request.get_host }}')
>> This will redirect to home page
>>
>> On Mon, 19 Aug 2019, 3:52 pm RONAK JAIN,  wrote:
>>
>>> Hello Django developers,
>>>
>>> I am trying to redirect my registration page on the home page but, I am
>>> not getting when I am trying with a registration page it will work for
>>> registration but when I am doing with the home page so I am not getting.
>>>
>>> *Home Page : localhost:8000*
>>>
>>> *Could you help me out with this problem?*
>>>
>>> *Attached screenshots for Better Understanding please check it 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/CA%2BAqMUeYs7CALaGOmfFfJ%2BHp%3DWoKMyrjvYcOc8Za3JkTLFY_CQ%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/CAKqY%3DSTmdtAMa9N_zfcjgai_3XP7iGuXQgNsyPT2h5EuGCE7KQ%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/CACh0Ehx0QcsmJaU2NoV47WpJDgkSM-dpX9gkvvffgvD57uqoQA%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/CAGHZBzxwT7a_hPPSQ5XwE%3DaiDZv7nszXZZzcviKskyCHxSQGiQ%40mail.gmail.com.


Re: dlango MultiValueDictKeyError

2019-08-05 Thread Sipum Mishra
Hey Ajit,

This error comes when You are trying to get username, passwords from the
form.
It is due to the below reason -

In Login,
You are using -> request.POST['username'] which will raise a KeyError
exception if 'username' is not in request.POST.

Instead use -> request.POST.get('username') which will return None if '
username' is not in request.POST.

Additionally, .get allows you to provide an additional parameter of a
default value which is returned if the key is not in the dictionary.

For example, request.POST.get('username', 'mydefaultvalue')

Hope this helps. If any concern then let us know.

On Mon, 5 Aug 2019 at 15:47, Ajeet Kumar Gupt 
wrote:

> Dear Team,
>
> I am developing custom registration and login page for end-user but
> getting the below error. Please find the views.py code also in the trail.
>
>
> *MultiValueDictKeyError at /login/*
>
> 'username'
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/login/
> Django Version: 2.2.3
> Exception Type: MultiValueDictKeyError
> Exception Value:
>
> 'username'
>
> Exception Location: 
> C:\Python\Python37\lib\site-packages\django\utils\datastructures.py
> in __getitem__, line 80
> Python Executable: C:\Python\Python37\python.exe
> Python Version: 3.7.3
>
> --
> *Views.py*
> **
>
> rom django.shortcuts import render
> from django.contrib.auth.models import User
> from django.http import HttpResponseRedirect
> from .forms import RegisterForm
> from django.conf import settings
> from django.shortcuts import redirect
> from django.contrib.auth.decorators import login_required
> from django.contrib import messages
> from django.contrib.auth import authenticate,login
> from django.contrib import auth
> from django.core.exceptions import ObjectDoesNotExist
>
>
> def user_register(request):
> # if this is a POST request we need to process the form data
> template = 'mymodule/register.html'
># template = 'index.html'
> if request.method == 'POST':
> # create a form instance and populate it with data from the request:
> form = RegisterForm(request.POST)
> # check whether it's valid:
> if form.is_valid():
> if 
> User.objects.filter(username=form.cleaned_data['username']).exists():
> return render(request, template, {
> 'form': form,
> 'error_message': 'Username already exists.'
> })
> elif 
> User.objects.filter(email=form.cleaned_data['email']).exists():
> return render(request, template, {
> 'form': form,
> 'error_message': 'Email already exists.'
> })
> elif form.cleaned_data['password'] != 
> form.cleaned_data['password_repeat']:
> return render(request, template, {
> 'form': form,
> 'error_message': 'Passwords do not match.'
> })
> else:
> # Create the user:
> user = User.objects.create_user(
> form.cleaned_data['username'],
> form.cleaned_data['email'],
> form.cleaned_data['password']
> )
> user.first_name = form.cleaned_data['first_name']
> user.last_name = form.cleaned_data['last_name']
> user.phone_number = form.cleaned_data['phone_number']
> user.save()
> return redirect('index.html')
> # Login the user
> #login(request, user)
> #def user_login(request):
> # redirect to accounts page:
> #return render(request, '/login.html')
># return HttpResponseRedirect(return, '/login.html')
># No post data availabe, let's just show the page.
> else:
> form = RegisterForm()
> return render(request, template, {'form': form})
>
>
>
>
>
> def login_view(request):
> username = request.POST['username']
> password = request.POST['pass']
> users = authenticate(request, username=username, password=password)
> if users is not None:
> login(request, users)
> return redirect('welcome.html')
> else:
> return redirect('index.html')
>
>
>
> def logout(request):
> auth.logout(request)
> return render(request, 'login.html')
>
>
>
>
> *Thanks & Regards*
> Ajeet Kumar Gupt
> +91-9311232332
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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%2BTqRsvD7P8Mk4RCUUg-5%3DYTE7PjBnHyJA%3DVZowGgGoYQnyNKw%40mail.gmail.com
> 

Re: trying to use a variable inside a static content tag

2019-07-27 Thread Sipum Mishra
Hi Lyman,

PFB.

Configure the following setting in your setting.py

STATIC_ROOT = os.path.join(BASE_DIR,"static_files")
STATIC_URL = '/static/'

STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),)

load *staticfiles* tag to template

{% load staticfiles %}

and then use in *src* attribute of *img HTML tag as you did. *


On Sun, 28 Jul, 2019, 4:37 AM Sithembewena L. Dube, 
wrote:

> Interesting.
>
> Kind regards,
> Lloyd
>
>
> *Sent with Shift
> *
>
> On Sat, Jul 27, 2019 at 11:25 PM Lyman Hurd  wrote:
>
>> A helpful user in the Python #django slack channel showed me this answer:
>>
>>
>> https://stackoverflow.com/questions/16655851/django-1-5-how-to-use-variables-inside-static-tag
>>
>>
>> On Saturday, July 20, 2019 at 4:31:52 AM UTC-7, Lyman Hurd wrote:
>>>
>>> Greetings.  I am writing a card game and I can load an image when I give
>>> a fixed value such as:
>>>
>>> >> style="width:69px;height:106px;">
>>>
>>> but I would actually like part o fthis to be determined by a tag (there
>>> is a for loop setting values) but when I write:
>>>
>>> >> style="width:69px;height:106px;">
>>>
>>> however when this is rendered into HTML the tag {{ card }} ha sbeen
>>> URL-escaped:
>>>
>>> 
>>>
>>> How can I render a static image based on the contents of a tag?
>>>
>>>
>>> Cheers,
>>>
>>> Lyman Hurd
>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/6706118e-f64a-4c6d-8bc6-c558d48640f5%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/CAH-SnCCtH6%3DP6rzezAk1ErTaFnhYyVmBNj82wGN4osw%3DPeEdFA%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/CAGHZBzwSf04Cao6xzYumTZWOoDqqEUF7J4moHGHx3tkU0SQVSQ%40mail.gmail.com.


Re: Get Value of Drop Down

2019-06-26 Thread Sipum Mishra
Hello csn u plz share ur codes as well as errors.

On Thu, 27 Jun, 2019, 12:09 AM Aayush Bhattarai, <
bhattaraiaayus...@gmail.com> wrote:

> Hi,
> I have encountered a problem. How can I get the value of dropdown,
> Boolean Field and send it to the database. Note: I am not using forms.py
> files and using a function-based view. I have created own form in HTML.
> I am not able to match the value of database and value in html dropdown.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dcde52cb-b6c6-4271-8d0a-8931fcbbf547%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzozhAP-_XUVOp9hW%3DSbTbgrtNR_mS-em0%3D96ksomQboQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid literal for int() with base 10: 'admin'

2019-06-26 Thread Sipum Mishra
Your problem is, in url you are passing id to detailview, but in views.py
you have done anything with that...

Check this again.

On Wed, 26 Jun, 2019, 4:01 AM onyilimba martins mclaren tochukwu, <
tochimcla...@gmail.com> wrote:

> I guess it's Django 2.2?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bb10db99-0411-468b-aace-e40509c34b51%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzi7Lt9u299aGQOhd0e6rYsFeWyDgX%3DM1yB%2BpgWP_v_iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid literal for int() with base 10: 'admin'

2019-06-25 Thread Sipum Mishra
Plz share views.py as well.. I hvae mentioned two. Kindly share.

On Tue, 25 Jun, 2019, 8:47 PM Harshit,  wrote:

> Here is urls.py of my app
>
> from django.urls import path
> from . import views
> from django.conf import settings
> from django.conf.urls.static import static
>
> app_name="music"
>
> urlpatterns=[
> #/music/
> path('',views.IndexView.as_view(),name='index'),
>
> path('register/',views.UserFormView.as_view(),name='register'),
>
> path('/',views.DetailView.as_view(),name='detail'),
>
> path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
> ]
> urlpatterns += static(settings.MEDIA_URL, document_root
> =settings.MEDIA_ROOT)
>
> Here is my main urls.py
> from django.contrib import admin
> from django.urls import path,include
> from . import settings
> from django.contrib.staticfiles.urls import static
> from django.contrib.staticfiles.urls import staticfiles_urlpatterns
>
> urlpatterns = [
> path('',include('music.urls')),
> path('music/',include('music.urls')),
> path('admin/', admin.site.urls),
> ]
> urlpatterns += staticfiles_urlpatterns()
> urlpatterns += static(settings.MEDIA_URL, document_root
> =settings.MEDIA_ROOT)
>
> On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
>>
>> Can u plz attach your urls.py as functions associated in views.py
>>
>> Thanks.
>>
>> On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, 
>> wrote:
>>
>>>  Hi guys,
>>> I am currently working on a working on a project. Everything is working
>>> fine but i am not able to access my admin. How can i solve this?
>>> Here is my Stack Trace
>>> Traceback:
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py"
>>> in inner
>>>   34. response = get_response(request)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py"
>>> in _get_response
>>>   126. response =
>>> self.process_exception_by_middleware(e, request)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py"
>>> in _get_response
>>>   124. response = wrapped_callback(request,
>>> *callback_args, **callback_kwargs)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py"
>>> in view
>>>   68. return self.dispatch(request, *args, **kwargs)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py"
>>> in dispatch
>>>   88. return handler(request, *args, **kwargs)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py"
>>> in get
>>>   106. self.object = self.get_object()
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py"
>>> in get_object
>>>   36. queryset = queryset.filter(pk=pk)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in
>>> filter
>>>   844. return self._filter_or_exclude(False, *args, **kwargs)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in
>>> _filter_or_exclude
>>>   862. clone.query.add_q(Q(*args, **kwargs))
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
>>> in add_q
>>>   1263. clause, _ = self._add_q(q_object, self.used_aliases)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
>>> in _add_q
>>>   1287. split_subq=split_subq,
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
>>> in build_filter
>>>   1225. condition = self.build_lookup(lookups, col, value)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
>>> in build_lookup
>>>   1096. lookup = lookup_class(lhs, rhs)
>>>
>>> File
>>> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in
>>> __init__
>>>   20.

Re: invalid literal for int() with base 10: 'admin'

2019-06-25 Thread Sipum Mishra
Can u plz attach your urls.py as functions associated in views.py

Thanks.

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, 
wrote:

>  Hi guys,
> I am currently working on a working on a project. Everything is working
> fine but i am not able to access my admin. How can i solve this?
> Here is my Stack Trace
> Traceback:
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py"
> in inner
>   34. response = get_response(request)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py"
> in _get_response
>   126. response = self.process_exception_by_middleware(e,
> request)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py"
> in _get_response
>   124. response = wrapped_callback(request,
> *callback_args, **callback_kwargs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py"
> in view
>   68. return self.dispatch(request, *args, **kwargs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py"
> in dispatch
>   88. return handler(request, *args, **kwargs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py"
> in get
>   106. self.object = self.get_object()
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py"
> in get_object
>   36. queryset = queryset.filter(pk=pk)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in
> filter
>   844. return self._filter_or_exclude(False, *args, **kwargs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in
> _filter_or_exclude
>   862. clone.query.add_q(Q(*args, **kwargs))
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
> in add_q
>   1263. clause, _ = self._add_q(q_object, self.used_aliases)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
> in _add_q
>   1287. split_subq=split_subq,
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
> in build_filter
>   1225. condition = self.build_lookup(lookups, col, value)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py"
> in build_lookup
>   1096. lookup = lookup_class(lhs, rhs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in
> __init__
>   20. self.rhs = self.get_prep_lookup()
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in
> get_prep_lookup
>   70. return self.lhs.output_field.get_prep_value(self.rhs)
>
> File
> "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py"
> in get_prep_value
>   965. return int(value)
>
> Exception Type: ValueError at /admin/
> Exception Value: invalid literal for int() with base 10: 'admin'
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: action in a form

2019-06-24 Thread Sipum Mishra
Hi bengoshi,

If i m not wrong, your concern is when you add action ='journal' then data
are not saved.
Right?

Thanks.


On Mon, 24 Jun, 2019, 2:07 AM bengoshi,  wrote:

> Thanks for your responses. I didn't describe it well.. if I write
>
> 
> it calls the url journal and this is the my requested result. All fine.
> Without the attribute "action" the form save the input in the database - the 
> requested result, great.
> With "action" it doesn't. That is the point which I don't understand becauce 
> in my understanding
> action should not have any effect for saving data.
>
> Greetings
> bengoshi
>
>
> Am Sonntag, 23. Juni 2019 19:31:05 UTC+2 schrieb Sipum:
>>
>> Hello,
>>
>> In action use the url associated with that view then it will work for
>> you.
>> If not then kindly tell what errors you are getting.
>>
>> Thanks.
>>
>> On Sun, 23 Jun, 2019, 10:17 PM Sebastian Jung, 
>> wrote:
>>
>>> Hello,
>>>
>>> You must Put in Action not a Name from a function. You must Put a url
>>> dir example action="/newurl/"
>>>
>>> And in your url a Link from /newurl/ to the function
>>>
>>> Regards
>>>
>>> bengoshi  schrieb am So., 23. Juni 2019, 17:57:
>>>
>>>> Hi,
>>>> I tried to write a form:
>>>>
>>>> ###
>>>>
>>>> {% extends 'base.html' %}
>>>> {% block content %}
>>>> Test
>>>> 
>>>> {% csrf_token %}
>>>> {{ form.as_p }}
>>>> 
>>>> 
>>>> {% endblock %}
>>>> ###
>>>>
>>>> and it works. But if I replace it with
>>>>
>>>> >>>
>>>> "journal" is a view for shown the saved data which work, too. If I click 
>>>> to "Save" it change to "journal" but won't save the data anymoren.
>>>>
>>>> Could anybody explain me please this behavior?
>>>>
>>>> Thanks and Greetings
>>>>
>>>> bengoshi
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/e153dd08-3678-4620-8f1d-dae1fa1b978f%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/e153dd08-3678-4620-8f1d-dae1fa1b978f%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAKGT9mxSq-ZKdQc_zUdHZmqZ5g%2Bfr8YVn0Upm%3DWru9SD6%3DwWkg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAKGT9mxSq-ZKdQc_zUdHZmqZ5g%2Bfr8YVn0Upm%3DWru9SD6%3DwWkg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3ffc7b93-4536-4c29-9998-1d4b10e380dc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3ffc7b93-4536-4c29-9998-1d4b10e380dc%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: action in a form

2019-06-23 Thread Sipum Mishra
Hello,

In action use the url associated with that view then it will work for you.
If not then kindly tell what errors you are getting.

Thanks.

On Sun, 23 Jun, 2019, 10:17 PM Sebastian Jung, 
wrote:

> Hello,
>
> You must Put in Action not a Name from a function. You must Put a url dir
> example action="/newurl/"
>
> And in your url a Link from /newurl/ to the function
>
> Regards
>
> bengoshi  schrieb am So., 23. Juni 2019,
> 17:57:
>
>> Hi,
>> I tried to write a form:
>>
>> ###
>>
>> {% extends 'base.html' %}
>> {% block content %}
>> Test
>> 
>> {% csrf_token %}
>> {{ form.as_p }}
>> 
>> 
>> {% endblock %}
>> ###
>>
>> and it works. But if I replace it with
>>
>> >
>> "journal" is a view for shown the saved data which work, too. If I click to 
>> "Save" it change to "journal" but won't save the data anymoren.
>>
>> Could anybody explain me please this behavior?
>>
>> Thanks and Greetings
>>
>> bengoshi
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e153dd08-3678-4620-8f1d-dae1fa1b978f%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKGT9mxSq-ZKdQc_zUdHZmqZ5g%2Bfr8YVn0Upm%3DWru9SD6%3DwWkg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Wrong Redirect

2019-06-20 Thread Sipum Mishra
Hi Ramadhan,

Instead of rendering to any page please use HttpResponseRedirect('put home
page url where u want to redirect' ).

And also import django.http import HttpResponseRedirect

Do the above & let me know. I hope it will work.

On Thu, 20 Jun, 2019, 2:41 PM ramadhan ngallen,  wrote:

> Hello Team
> I created an app(called users) for user registration
> If user enter two mismatched password an app should redirect to the same
> page. otherwise it should redirect to the homepage
> Unfortunately when user enter two mismatched password it redirect to the
> wrong url http://127.0.0.1:8000/users/register/register
> and also if user enter matched password it also redirect to the wrong url
> http://127.0.0.1:8000/users/register/register
>
>  its view.py
> from django.shortcuts import render, redirect
> from django.contrib.auth.models import User, auth
>
>
> # Create your views here.
>
>
> def register(request):
>
> if request.method == 'POST':
> first_name = request.POST['first_name']
> first_name = first_name.title
> last_name = request.POST['last_name']
> last_name = last_name.title
> username = request.POST['username']
> password1 = request.POST['password1']
> password2 = request.POST['password2']
> email = request.POST['email']
> if password1 == password2:
> user = User.objects.create_user(
> username=username, first_name=first_name, last_name=last_name, email=email,
> password=password1)
>
> user.save()
> print('user created')
> return redirect('/travello/')
>
> else:
> return render(request, 'users/register.html')
>
> else:
> return render(request, 'users/register.html')
> I have also created its urls.py as follows
> from . import views
> from django.urls import path
>
>
> app_name = 'users'
>
> *urlpatterns = [*
> * path('register/', views.register, name='register'),*
> ]
>
> Settings.py
> INSTALLED_APPS = [
> * 'users.apps.UsersConfig',*
> 'travello.apps.TravelloConfig',
> 'calc.apps.CalcConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> user app directory
>
> [image: image.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAhXuBF07Q72_mi1AfPJ5LHHmaEdd5PhvQ79ToqSvpEt0gCivg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzx-XO4S58msQB%3DJmV9UAgDJmfk7dDOco2JZr4uXQer%3DYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManyToMany no Model

2019-06-19 Thread Sipum Mishra
Ggt yano jika teme sulo faso tadan siku.
Lhggg

On Wed, 19 Jun, 2019, 5:55 PM Christian Oliveira, <
christianoliveir...@gmail.com> wrote:

> Bom dia, como posso fazer para acessar os dados de uma tabela derivada de
> um ManyToMany??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8ebadc27-79d9-46f8-89c0-19b9a875b9b5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzf%2BSR%3DSdyBzhwOp2DfawUJNfmAMiyFETh2CwmwDLN%3Dxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django App - Database connection

2019-06-14 Thread Sipum Mishra
Hi sapna,

Check your settings.py file and search for DATABASE there you can get a
link which is commented. Copy n paste that url and that will take you to
documentation page where you can get what needs to be imported in DATABASE.

On Fri, 14 Jun, 2019, 4:45 PM Sapna Dhage,  wrote:

>
> Hello,
>
> I'm implementing Django application using PostgreSQL. However, I'm not
> able to configure database connection string.
>
> Any idea how do I configure database connection and where should I mention
> database connection string?
>
> Thank you,
> Sapna
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/35a7d002-cf8a-4924-8b8b-9df35419b1f2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzyK69aoq02n6dLvYpvJLc5aTxH_RZOOCma3kgqY-ZCLBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django question.

2019-06-09 Thread Sipum Mishra
Hi Bhaskar,

You  can write your helper functions inside utils.py and can use it
wherever you want. And basically utils.py contains utility functions or
helper functions.

Thanks.

On Sun, 9 Jun, 2019, 2:29 AM Bhashkar Bisht, 
wrote:

> HI there is there any best way to create django helper class
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e0df3308-455f-4f4b-8870-9e7da90677cc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzQnUx5Ex1C9Ok2etOY1Sv5OT1K-PfdfWiPqeu%3Dfo0R9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Name error

2019-06-05 Thread Sipum Mishra
Plz show your code otherwise search your total error line in Google you can
find it.
Always try to paste error codes so that it will b easy to find out error.

Thanks.

On Wed, 5 Jun, 2019, 3:12 PM RAJA MISHRA, 
wrote:

> Name error : name 'django' is not defined in one of my app
> Plzz anyone explain how to fix this
>  also how to use django.setup()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4bbd7afe-ddd8-4c25-a620-7e6da5ddd5c5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzo8Ks05zFq7eVHjGFQV1aF5E5D%2B7zMe1cH%3D2PAUwN6Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re:

2019-06-04 Thread Sipum Mishra
Hi Pradeep,

You are using a non nullable field image. And for that you have to provide
a default value. Without default value it is  unable find.


On Tue, 4 Jun, 2019, 9:12 PM Pradeep Singh,  wrote:

> why i am getting these error ..please help me to fix it
>
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANwgZcYJBTbKeAwOh4gqc4nYu_J8DT%3DjF5CYgLRA2vW8Nu_16Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzyJzob25OHaL-fuGZ4U98QboUU7vX7jfKMfHKFS7PPqCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customising django user model

2019-05-20 Thread Sipum Mishra
Thanks a lot.. @Joe @Mahes
It will help me a lot.

On Tue, 21 May, 2019, 8:14 AM mahesh boini, 
wrote:

> Extend AbstractUser class and give that name in settings file like
> AUTH_USER_MODEL=‘appname.modelname’
>
> On Tue, 21 May 2019 at 05:51, Joe Reitman  wrote:
>
>> You can customize the user table by extending AbstractUser and add the
>> fields you want to add (gender, phone)
>>
>> I have a custom user example adding age field:
>>
>> from django.db import models
>> from django.contrib.auth.models import AbstractUser
>>
>> class CustomUser(AbstractUser):
>>age = models.PositiveIntegerField(null=True, blank=True)
>>
>>
>> On Sunday, May 19, 2019 at 12:13:08 PM UTC-5, Sipum wrote:
>>>
>>> Hello Friends,
>>>
>>> I want to customise django default user table and which should consist
>>> of name,phone, email and gender.
>>> And after that when every time a user logs in, he/she should able to log
>>> in through an OTP to phone or email.
>>>
>>> can anyone guide me  What to do here.??
>>>
>>> Thanks.
>>> Sipum
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/24afe883-98b9-4bfc-a9fe-284c7a6cb771%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/24afe883-98b9-4bfc-a9fe-284c7a6cb771%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANR2ZjviAk_hCz%2BVum2kUa7vo6SJP8ZCuOsg0cH9uLncL_mDBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANR2ZjviAk_hCz%2BVum2kUa7vo6SJP8ZCuOsg0cH9uLncL_mDBQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzzNHg4-Xkn5aGVRpttxBZooKy1DSS_SGNU5gbUdW7FCYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customising django user model

2019-05-20 Thread Sipum Mishra
Ok thanks for reply.

On Mon, 20 May, 2019, 5:36 PM Rafael E. Ferrero, 
wrote:

> Hello, you must to extend User model... search on google with this
> aproach!!
>
> Cheers!
>
> Rafael E. Ferrero
>
>
> El dom., 19 may. 2019 a las 14:13, Sipum () escribió:
>
>> Hello Friends,
>>
>> I want to customise django default user table and which should consist of
>> name,phone, email and gender.
>> And after that when every time a user logs in, he/she should able to log
>> in through an OTP to phone or email.
>>
>> can anyone guide me  What to do here.??
>>
>> Thanks.
>> Sipum
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/9b92fdc5-8f36-45e7-809e-b32d4ab41687%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9b92fdc5-8f36-45e7-809e-b32d4ab41687%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJJc_8XYD7zGAOmaezmS_sGoDr5R0gz1Y44y6ED-sn-dxzj02A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJJc_8XYD7zGAOmaezmS_sGoDr5R0gz1Y44y6ED-sn-dxzj02A%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Customising django user model

2019-05-19 Thread Sipum
Hello Friends,

I want to customise django default user table and which should consist of 
name,phone, email and gender.
And after that when every time a user logs in, he/she should able to log in 
through an OTP to phone or email.

can anyone guide me  What to do here.??

Thanks.
Sipum

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9b92fdc5-8f36-45e7-809e-b32d4ab41687%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting MultiValueDictKeyError

2019-05-16 Thread Sipum Mishra
Hi friends, still getting same error after using encrypt..

Bt if i am using request. POST. get('document') then error vanishes but
another error comes as job_title is an invalid keyword argument for this
function.

Kindly help on this issue. I m trying hard but unable to solve.

Thanks

On Thu, 16 May, 2019, 6:42 PM Test Bot,  wrote:

> Try putting encrypt="multipart/form-data" in your form tag
>
> On Thu, May 16, 2019, 6:05 PM Sipum  wrote:
>
>> Hi Friends,
>>
>> when retrieving file that is uploaded , I'm getting
>> multiValueDictKeyError.
>> Below are my codes. I have proided some codes where I m getting error.
>> could anyone help me here ?
>>
>> views.py
>> -
>>
>> def webform_submit(request):
>> if request.method =='POST':
>> name = request.POST['name']
>> email = request.POST['email']
>> phone = request.POST['phone']
>> job_title = request.POST['job_title']
>> resume = request.FILES['document']   -- getting
>> error here
>>
>> user_info = UserField(name = name, email = email, phone = phone,
>>   job_title = job_title, resume = resume)
>> user_info.save()
>> messages.success(request,"Congrats!! Form is successfully saved
>> in DB")
>> return render(request, 'html/form.html', {})
>>
>>
>> form.html
>> --
>>   
>> Job title
>> 
>>
>> 
>> Resume
>> > id="exampleFormControlFile1">
>>   
>> 
>> 
>>
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/37a3ca49-6410-420f-a6a6-23bcf8e3f983%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/37a3ca49-6410-420f-a6a6-23bcf8e3f983%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD%3DM5eQp8%3DBZVmDe7RFjdf0LOvoZcdGMqGgt0xSdEw_Nj%2BJaig%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD%3DM5eQp8%3DBZVmDe7RFjdf0LOvoZcdGMqGgt0xSdEw_Nj%2BJaig%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzyWYUF8JsBuAU3PeHp%2BnWGqadp%3DJz_vW7yHzYZUm-yXqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Getting MultiValueDictKeyError

2019-05-16 Thread Sipum
Hi Friends,

when retrieving file that is uploaded , I'm getting multiValueDictKeyError.
Below are my codes. I have proided some codes where I m getting error. 
could anyone help me here ?

views.py
-

def webform_submit(request):
if request.method =='POST':
name = request.POST['name']
email = request.POST['email']
phone = request.POST['phone']
job_title = request.POST['job_title']
resume = request.FILES['document']   -- getting 
error here 

user_info = UserField(name = name, email = email, phone = phone,
  job_title = job_title, resume = resume)
user_info.save()
messages.success(request,"Congrats!! Form is successfully saved in 
DB")
return render(request, 'html/form.html', {})


form.html
--
  
Job title



Resume

  



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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37a3ca49-6410-420f-a6a6-23bcf8e3f983%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django issue with NoModuleError

2019-05-13 Thread Sipum Mishra
Hi RLM,

Did you import samples in root urls.py
Like as below

>From samples import urls

Hope it will solve ur error.
Thanks.

On Mon, 13 May, 2019, 7:45 PM John Bagiliko, 
wrote:

> Try this in samples/urls.py
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
>  path(''",views.index, name='index'),
> ]
>
> By the way, what is the error you are getting?
> On Mon, May 13, 2019, 7:14 AM RLM  wrote:
>
>> Hi Everyone.
>> I have been away from Django for the past 18 months and am refreshing to
>> use it for a complex samples storage project.
>>
>> Python 3.7, Django 2.2 the LTS fails with too many errors.
>>
>> Unfortunately I have had this particular error every time I try Django
>> over the past 18 months which is why I had to resort to HuGo for a
>> particular web site build.
>>
>> I feel there is something I have forgotten to do and will appreciate
>> help understanding why it occurs.
>>
>> I have researched but no advice helps.
>> I have seen pages on PYTHONPATH and the like but problem is not solved
>> and it seems to have been an issue for at least a year.
>>
>> The project is called Storage, it's app is called samples.
>>
>> The problem I have is the ModuleNotFoundError: No module named 'samples'.
>>
>> Where samples is the only app.
>>
>> INSTALLED_APPS = [
>>  'django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'samples',
>>
>> root urls/py is:
>> urlpatterns = [
>>  path('admin/', admin.site.urls),
>>  path('samples/', include('samples.urls')),
>> ]
>>
>> samples/urls.py is:
>> from django.urls import path
>> from . import views
>>
>> urlpatterns = [
>>  path('',views.index, name='index'),
>> ]
>>
>> There are no models.
>>
>> samples/views.py is:
>> from django.shortcuts import render
>> from django.http import HttpResponse
>>
>> def index(request):
>>  return HttpResponse("Hello from the RMH App")
>>
>> Thanks for any help
>> Cheers
>> Roger
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/dee6f7a2-23e9-eaa7-052e-fb714dd7f3b4%40gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAC26BE02jK937V6XhQXv4MtEGyeo%2BV%2BWpDgB4S%3D%2BHWmv9RxFFA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Sipum Mishra
Joel, i know there is python code for yhat API but how to integrate it.. I
want to know that.. I tried to do but failed.

On Wed, 24 Apr, 2019, 6:55 PM Joel Mathew,  wrote:

> Just do it. The API has python sample code.
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:
>
>> Hello friends.
>>
>> I am going to integrate google calendar API in to my TODO List.
>> can anyone suggest how to integrate so that when I will add any event in
>> my TODO List app it will directly show in my google calendar.
>>
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-22 Thread Sipum
Hi somen,

Just Open xampp control panel and run apache and mySQL sever.
then go to localhost/phpmyadmin in browser and there create a database as u 
do for php.

then in search DATABASE in settings.py file (which would be created when u 
create a project in django) do the below changes -
 
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'webapp', --> name of db which u created b4
'USER': 'root',--> user is root 
'PASSWORD': '',   > it is pasword less
'HOST': '127.0.0.1',---> this is for local host
'PORT': '3306',   > this port number u will get 
from xampp control panel where u start MYSQL
}


Hope it will help... Njoy



On Saturday, 20 April 2019 09:52:05 UTC+5:30, Soumen Khatua wrote:
>
> Hi Folks,
> How can I configure xampp server provided mysql database in django.
>
> 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b941ec4c-d348-4ce6-80de-bd433893b0b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Integrating Google calendar API in TODO list

2019-04-22 Thread Sipum
Hello friends.

I am going to integrate google calendar API in to my TODO List.
can anyone suggest how to integrate so that when I will add any event in my 
TODO List app it will directly show in my google calendar.

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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing HTML in DB using DJANGO

2019-04-21 Thread Sipum Mishra
thank you all guys for suggesting.

can I plz get any tutorial for these so that I can learn that properly.

On Sun, 21 Apr 2019 at 21:34, Joel Mathew  wrote:

> I fail to see the purpose of that. Serialisation is sufficient. Big
> projects like wordpress store even big blog posts, which is html like this.
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Sun, 21 Apr 2019 at 20:20, Brian M  wrote:
>
>> What if you convert the html to an array of bytes before storing?
>>
>> Then you’d convert from bytes array back to string when you retrieve.
>> This way you’d store raw data.
>>
>>
>> On Apr 21, 2019, at 8:41 AM, Jani Tiainen  wrote:
>>
>> Well after all, HTML is just plain text... Though you probably want to
>> think to do some sanitization so you won't get nasty injections via html.
>>
>> On Sat, Apr 20, 2019 at 9:09 PM Sipum Mishra  wrote:
>>
>>> Hi friends,
>>>
>>> I want to store a html in database using python and need to retrieve
>>> that html and convert that in to PDF.
>>> can u plz suggest me how to store that HTML in DB ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f301b675-6587-434e-b25d-87de9d9fef10%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f301b675-6587-434e-b25d-87de9d9fef10%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Jani Tiainen
>> Software wizard
>>
>> https://blog.jani.tiainen.cc/
>>
>> Always open for short term jobs or contracts to work with Django.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHn91oe6hUWZtEYCx%3D8uNe%3DFEphZ4C_VRPv74oK2E-x9gvJjGw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHn91oe6hUWZtEYCx%3D8uNe%3DFEphZ4C_VRPv74oK2E-x9gvJjGw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/47B36FA2-099C-4AAB-B5DA-1D9662513398%40gmail.com
>> <https://groups.google.com/d/msgid/django-users/47B36FA2-099C-4AAB-B5DA-1D9662513398%40gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_-pMCYKd4_7CHbcU7jz7YFZmNw3BXd6Grgwa99x6WGALg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_-pMCYKd4_7CHbcU7jz7YFZmNw3BXd6Grgwa99x6WGALg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzz-%3Dca7eKzn-WD%3DVwhYG9J-OgAMXsWUm3gO3H52-JWxkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Hi Jani, the above solution is not working, still having the same problem.

and that completed field is used later for cross_off and uncross the item
in list.

On Sun, 21 Apr 2019 at 17:36, Jani Tiainen  wrote:

> Hi,
>
> required attribute works in forms, not in models. For models fields that
> are not required in forms you need to use blank=True.
>
> Though that's not the right solution.
>
> Why are you including "completed" field in a form (which you validate for
> user input) if you are not going to have such a input (checkbox) in a form?
>
>
> On Sun, Apr 21, 2019 at 3:02 PM Sipum Mishra  wrote:
>
>> if i do changes as above in model then it throws error like -
>>
>>  class List(models.Model):
>>   File "F:\django\to_do_list\todo\models.py", line 6, in List
>> completed = models.BooleanField(required=False)
>> TypeError: __init__() got an unexpected keyword argument 'required'
>>
>>
>> On Sun, 21 Apr 2019 at 17:27, Sipum Mishra  wrote:
>>
>>> Jani, Do you mean I need to change completed field in model like as
>>> below ?
>>>
>>> completed = models.BooleanField(default=False,required=False)
>>>
>>> On Sun, 21 Apr 2019 at 17:23, Sipum Mishra  wrote:
>>>
>>>> Hi Jani,
>>>> form.errors gives error as -
>>>>
>>>> itemThis field is
>>>> required.<
>>>> /li>
>>>>
>>>> can u plz tell me where i did wrong?
>>>>
>>>> On Sun, 21 Apr 2019 at 16:43, Jani Tiainen  wrote:
>>>>
>>>>> completed is a required field and you're not passing any value with
>>>>> it. If you print form.errors you would should see that it complains about
>>>>> "completed" "this field is required"
>>>>>
>>>>> Note that providing default value in a model is not same as making
>>>>> field optional.
>>>>>
>>>>> On Fri, Apr 19, 2019 at 2:05 PM Sipum Mishra 
>>>>> wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am always getting - form.is_valid returning False. kindly check
>>>>>> where I am doing wrong.
>>>>>> please find below code.
>>>>>>
>>>>>>
>>>>>> views.py
>>>>>> ---
>>>>>> def home(request):
>>>>>>
>>>>>> if request.method == 'POST':
>>>>>> form = ListForm(request.POST or None)
>>>>>> print(form.is_valid(), "-->",request.POST['Item'])
>>>>>> print(form.errors)
>>>>>> print(form)
>>>>>> if form.is_valid():
>>>>>> form.save()
>>>>>> all_items = List.objects.all
>>>>>> messages.success(request, ('Item has been Added to the List!'))
>>>>>> return render(request,'home.html', {'all_items' : all_items})
>>>>>> else:
>>>>>> print("deba-->",request.POST)
>>>>>> return HttpResponse("Form is invalid!")
>>>>>> else:
>>>>>> all_items = List.objects.all
>>>>>> return render(request,'home.html', {'all_items' : all_items})
>>>>>>
>>>>>> -
>>>>>> form.py
>>>>>> -
>>>>>>
>>>>>> class ListForm(forms.ModelForm):
>>>>>> class Meta:
>>>>>> model = List
>>>>>> fields = ["item", "completed"]
>>>>>>
>>>>>>
>>>>>> 
>>>>>> model.py
>>>>>> -
>>>>>>
>>>>>> class List(models.Model):
>>>>>> item = models.CharField(max_length=200)
>>>>>> completed = models.BooleanField(default=False)
>>>>>>
>>>>>>
>>>>>> def __str__(self):
>>>>>> return self.item + '|' + str(self.completed)
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to django-users+unsubscr...@googlegroups.com.
>>>>>> To post to this group

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
if i do changes as above in model then it throws error like -

 class List(models.Model):
  File "F:\django\to_do_list\todo\models.py", line 6, in List
completed = models.BooleanField(required=False)
TypeError: __init__() got an unexpected keyword argument 'required'


On Sun, 21 Apr 2019 at 17:27, Sipum Mishra  wrote:

> Jani, Do you mean I need to change completed field in model like as below ?
>
> completed = models.BooleanField(default=False,required=False)
>
> On Sun, 21 Apr 2019 at 17:23, Sipum Mishra  wrote:
>
>> Hi Jani,
>> form.errors gives error as -
>>
>> itemThis field is
>> required.<
>> /li>
>>
>> can u plz tell me where i did wrong?
>>
>> On Sun, 21 Apr 2019 at 16:43, Jani Tiainen  wrote:
>>
>>> completed is a required field and you're not passing any value with it.
>>> If you print form.errors you would should see that it complains about
>>> "completed" "this field is required"
>>>
>>> Note that providing default value in a model is not same as making field
>>> optional.
>>>
>>> On Fri, Apr 19, 2019 at 2:05 PM Sipum Mishra  wrote:
>>>
>>>> Hi All,
>>>>
>>>> I am always getting - form.is_valid returning False. kindly check where
>>>> I am doing wrong.
>>>> please find below code.
>>>>
>>>>
>>>> views.py
>>>> ---
>>>> def home(request):
>>>>
>>>> if request.method == 'POST':
>>>> form = ListForm(request.POST or None)
>>>> print(form.is_valid(), "-->",request.POST['Item'])
>>>> print(form.errors)
>>>> print(form)
>>>> if form.is_valid():
>>>> form.save()
>>>> all_items = List.objects.all
>>>> messages.success(request, ('Item has been Added to the List!'))
>>>> return render(request,'home.html', {'all_items' : all_items})
>>>> else:
>>>> print("deba-->",request.POST)
>>>> return HttpResponse("Form is invalid!")
>>>> else:
>>>> all_items = List.objects.all
>>>> return render(request,'home.html', {'all_items' : all_items})
>>>>
>>>> -
>>>> form.py
>>>> -
>>>>
>>>> class ListForm(forms.ModelForm):
>>>> class Meta:
>>>> model = List
>>>> fields = ["item", "completed"]
>>>>
>>>>
>>>> 
>>>> model.py
>>>> -
>>>>
>>>> class List(models.Model):
>>>> item = models.CharField(max_length=200)
>>>> completed = models.BooleanField(default=False)
>>>>
>>>>
>>>> def __str__(self):
>>>> return self.item + '|' + str(self.completed)
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> --
>>> Jani Tiainen
>>> Software wizard
>>>
>>> https://blog.jani.tiainen.cc/
>>>
>>> Always open for short term jobs or contracts to work with Django.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzx5TL%2BNZ--kbY2XpypCdOf5YP0AikdrFDQQ-rgg1026ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Jani, Do you mean I need to change completed field in model like as below ?

completed = models.BooleanField(default=False,required=False)

On Sun, 21 Apr 2019 at 17:23, Sipum Mishra  wrote:

> Hi Jani,
> form.errors gives error as -
>
> itemThis field is
> required.<
> /li>
>
> can u plz tell me where i did wrong?
>
> On Sun, 21 Apr 2019 at 16:43, Jani Tiainen  wrote:
>
>> completed is a required field and you're not passing any value with it.
>> If you print form.errors you would should see that it complains about
>> "completed" "this field is required"
>>
>> Note that providing default value in a model is not same as making field
>> optional.
>>
>> On Fri, Apr 19, 2019 at 2:05 PM Sipum Mishra  wrote:
>>
>>> Hi All,
>>>
>>> I am always getting - form.is_valid returning False. kindly check where
>>> I am doing wrong.
>>> please find below code.
>>>
>>>
>>> views.py
>>> ---
>>> def home(request):
>>>
>>> if request.method == 'POST':
>>> form = ListForm(request.POST or None)
>>> print(form.is_valid(), "-->",request.POST['Item'])
>>> print(form.errors)
>>> print(form)
>>> if form.is_valid():
>>> form.save()
>>> all_items = List.objects.all
>>> messages.success(request, ('Item has been Added to the List!'))
>>> return render(request,'home.html', {'all_items' : all_items})
>>> else:
>>> print("deba-->",request.POST)
>>> return HttpResponse("Form is invalid!")
>>> else:
>>> all_items = List.objects.all
>>> return render(request,'home.html', {'all_items' : all_items})
>>>
>>> -
>>> form.py
>>> -
>>>
>>> class ListForm(forms.ModelForm):
>>> class Meta:
>>> model = List
>>> fields = ["item", "completed"]
>>>
>>>
>>> 
>>> model.py
>>> -
>>>
>>> class List(models.Model):
>>> item = models.CharField(max_length=200)
>>> completed = models.BooleanField(default=False)
>>>
>>>
>>> def __str__(self):
>>> return self.item + '|' + str(self.completed)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Jani Tiainen
>> Software wizard
>>
>> https://blog.jani.tiainen.cc/
>>
>> Always open for short term jobs or contracts to work with Django.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzyF%3D5mNty%2BKW4xmg_GvKO_RMQrDxp5O7Pkpg%2BnTZXLOXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Hi Jani,
form.errors gives error as -

itemThis field is
required.<
/li>

can u plz tell me where i did wrong?

On Sun, 21 Apr 2019 at 16:43, Jani Tiainen  wrote:

> completed is a required field and you're not passing any value with it. If
> you print form.errors you would should see that it complains about
> "completed" "this field is required"
>
> Note that providing default value in a model is not same as making field
> optional.
>
> On Fri, Apr 19, 2019 at 2:05 PM Sipum Mishra  wrote:
>
>> Hi All,
>>
>> I am always getting - form.is_valid returning False. kindly check where I
>> am doing wrong.
>> please find below code.
>>
>>
>> views.py
>> ---
>> def home(request):
>>
>> if request.method == 'POST':
>> form = ListForm(request.POST or None)
>> print(form.is_valid(), "-->",request.POST['Item'])
>> print(form.errors)
>> print(form)
>> if form.is_valid():
>> form.save()
>> all_items = List.objects.all
>> messages.success(request, ('Item has been Added to the List!'))
>> return render(request,'home.html', {'all_items' : all_items})
>> else:
>> print("deba-->",request.POST)
>> return HttpResponse("Form is invalid!")
>> else:
>> all_items = List.objects.all
>> return render(request,'home.html', {'all_items' : all_items})
>>
>> -
>> form.py
>> -
>>
>> class ListForm(forms.ModelForm):
>> class Meta:
>> model = List
>> fields = ["item", "completed"]
>>
>>
>> 
>> model.py
>> -
>>
>> class List(models.Model):
>> item = models.CharField(max_length=200)
>> completed = models.BooleanField(default=False)
>>
>>
>> def __str__(self):
>> return self.item + '|' + str(self.completed)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Jani Tiainen
> Software wizard
>
> https://blog.jani.tiainen.cc/
>
> Always open for short term jobs or contracts to work with Django.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHn91of6O55rPh6fJFDHQ1Pc2v5Lk%3DT8JtN1wS_4NVuP9vi3MA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzxTPyWzT_5GJ3zPsvHmWPHQOka5uM2-yHq9tM4g8urQZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Storing HTML in DB using DJANGO

2019-04-20 Thread Sipum Mishra
Hi friends,

I want to store a html in database using python and need to retrieve that 
html and convert that in to PDF.
can u plz suggest me how to store that HTML in DB ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f301b675-6587-434e-b25d-87de9d9fef10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django - always getting False in form.is_valid()

2019-04-20 Thread Sipum Mishra
Hi Vineeth,

when I am trying to add 'add testing' through html form for todo list app
getting this above form.is_valid() always False.

On Sat, 20 Apr 2019 at 23:02, Sipum Mishra  wrote:

> Hi Vineeth,
>
> please find below is the output ->
>
>  ['8V0Or1mvx2gtOa5fuYsdmAJ1o7SpGOcbSYulW0WMACHbrBhn8tOI0SO1z65MzXGx'],
> 'Item': ['add tesing']}>
>
> On Fri, 19 Apr 2019 at 19:04, vineeth sagar 
> wrote:
>
>> can you please post, request.POST output?
>>
>> On Fri, 19 Apr 2019, 16:34 Sipum Mishra,  wrote:
>>
>>> Hi All,
>>>
>>> I am always getting - form.is_valid returning False. kindly check where
>>> I am doing wrong.
>>> please find below code.
>>>
>>>
>>> views.py
>>> ---
>>> def home(request):
>>>
>>> if request.method == 'POST':
>>> form = ListForm(request.POST or None)
>>> print(form.is_valid(), "-->",request.POST['Item'])
>>> print(form.errors)
>>> print(form)
>>> if form.is_valid():
>>> form.save()
>>> all_items = List.objects.all
>>> messages.success(request, ('Item has been Added to the List!'))
>>> return render(request,'home.html', {'all_items' : all_items})
>>> else:
>>> print("deba-->",request.POST)
>>> return HttpResponse("Form is invalid!")
>>> else:
>>> all_items = List.objects.all
>>> return render(request,'home.html', {'all_items' : all_items})
>>>
>>> -
>>> form.py
>>> -
>>>
>>> class ListForm(forms.ModelForm):
>>> class Meta:
>>> model = List
>>> fields = ["item", "completed"]
>>>
>>>
>>> 
>>> model.py
>>> -
>>>
>>> class List(models.Model):
>>> item = models.CharField(max_length=200)
>>> completed = models.BooleanField(default=False)
>>>
>>>
>>> def __str__(self):
>>> return self.item + '|' + str(self.completed)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMMZq8OxVOJ8cF%3DFTNriHjBXKvdv29in-gOB-M-ia86L_ntSQw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMMZq8OxVOJ8cF%3DFTNriHjBXKvdv29in-gOB-M-ia86L_ntSQw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Django - always getting False in form.is_valid()

2019-04-20 Thread Sipum Mishra
Hi Vineeth,

please find below is the output ->



On Fri, 19 Apr 2019 at 19:04, vineeth sagar 
wrote:

> can you please post, request.POST output?
>
> On Fri, 19 Apr 2019, 16:34 Sipum Mishra,  wrote:
>
>> Hi All,
>>
>> I am always getting - form.is_valid returning False. kindly check where I
>> am doing wrong.
>> please find below code.
>>
>>
>> views.py
>> ---
>> def home(request):
>>
>> if request.method == 'POST':
>> form = ListForm(request.POST or None)
>> print(form.is_valid(), "-->",request.POST['Item'])
>> print(form.errors)
>> print(form)
>> if form.is_valid():
>> form.save()
>> all_items = List.objects.all
>> messages.success(request, ('Item has been Added to the List!'))
>> return render(request,'home.html', {'all_items' : all_items})
>> else:
>> print("deba-->",request.POST)
>> return HttpResponse("Form is invalid!")
>> else:
>> all_items = List.objects.all
>> return render(request,'home.html', {'all_items' : all_items})
>>
>> -
>> form.py
>> -
>>
>> class ListForm(forms.ModelForm):
>> class Meta:
>> model = List
>> fields = ["item", "completed"]
>>
>>
>> 
>> model.py
>> -
>>
>> class List(models.Model):
>> item = models.CharField(max_length=200)
>> completed = models.BooleanField(default=False)
>>
>>
>> def __str__(self):
>> return self.item + '|' + str(self.completed)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMMZq8OxVOJ8cF%3DFTNriHjBXKvdv29in-gOB-M-ia86L_ntSQw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMMZq8OxVOJ8cF%3DFTNriHjBXKvdv29in-gOB-M-ia86L_ntSQw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Django - always getting False in form.is_valid()

2019-04-19 Thread Sipum Mishra
Hi All,

I am always getting - form.is_valid returning False. kindly check where I 
am doing wrong.
please find below code. 


views.py
---
def home(request):

if request.method == 'POST':
form = ListForm(request.POST or None)
print(form.is_valid(), "-->",request.POST['Item'])
print(form.errors)
print(form)
if form.is_valid():
form.save()
all_items = List.objects.all
messages.success(request, ('Item has been Added to the List!'))
return render(request,'home.html', {'all_items' : all_items})
else:
print("deba-->",request.POST)
return HttpResponse("Form is invalid!")
else:
all_items = List.objects.all
return render(request,'home.html', {'all_items' : all_items})

-
form.py
-

class ListForm(forms.ModelForm):
class Meta:
model = List
fields = ["item", "completed"]



model.py
-

class List(models.Model):
item = models.CharField(max_length=200)
completed = models.BooleanField(default=False)


def __str__(self):
return self.item + '|' + str(self.completed)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ca5e82d-f34b-4ab4-8f82-5be0dcdebecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.