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

2019-04-20 Thread John Bagiliko
Drop the html codes here please. Let one try it actually. It's difficult to debug like this. On Sat, Apr 20, 2019, 5:35 PM Sipum Mishra wrote: > 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

How to ask questions on Django

2019-04-28 Thread John Bagiliko
ion to most of of the questions asked here about forms, queries, CRUD activities etc. See it here <https://medium.com/@john.bagiliko/django-crud-web-application-77ef05af1f00?source=friends_link&sk=2f306ca42251f44828bf0ee27405dca0> Best, John -- *Regards* *JOHN BAGILIKO* *MSc. Mathematical

Re: How to pass context value from views.py to getElementById in JavaScript?

2019-05-03 Thread John Bagiliko
Dump this result into json and render it on a page. Use AJAX to get this json data in JavaScript. On Fri, May 3, 2019, 2:41 PM sachinbg sachin wrote: > If u want to use that context in html means for I context ,I.user > name,i.products like that u can use > > On Fri, May 3, 2019, 8:09 PM sachinb

Re: How to pass context value from views.py to getElementById in JavaScript?

2019-05-03 Thread John Bagiliko
import serializers from django.core You can simply use the serializers.serialize method to do this. No need to use Restframework. On Fri, May 3, 2019, 3:25 PM John Bagiliko wrote: > Dump this result into json and render it on a page. Use AJAX to get this > json data in JavaScript. >

Re: Django issue with NoModuleError

2019-05-13 Thread John Bagiliko
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

Re: Novice questions about Pagination syntax and classes in general

2019-06-01 Thread John Bagiliko
I will answer question two. I'm not sure I understand your question 1. The "objects" is query method of every Django model. You use it to query. Contacts should be in your models.py and you should import Contacts in your views.py before you can use it. On Sun, Jun 2, 2019, 1:08 AM drone4four wro

Re: Accessing data from a 30 GB file in json format

2019-07-01 Thread John Bagiliko
What is the error message? On Mon, Jul 1, 2019, 10:07 AM Nibil Ashraf wrote: > Hey, > > I have a file with a size of around 30GB. The file is in json format. I > have to access the data and write that to a csv file. When I tried to do > that with my laptop which has a a RAM of 4GB, I am getting

Re: Accessing data from a 30 GB file in json format

2019-07-01 Thread John Bagiliko
A screenshot may be better On Mon, Jul 1, 2019, 10:10 AM John Bagiliko wrote: > What is the error message? > > On Mon, Jul 1, 2019, 10:07 AM Nibil Ashraf > wrote: > >> Hey, >> >> I have a file with a size of around 30GB. The file is in json format. I >>

Re: Help me fix this chat feature

2019-07-01 Thread John Bagiliko
Yes, use different incognito tabs for different users. On Sun, Jun 30, 2019, 10:51 PM Aldian Fazrihady wrote: > I think if you run multiple users on the same PC, you should use > different browsers, or at least private/incognito mode. > > It is because Django gave one browser session to one use

Re: Django 2.2 Media files

2019-07-05 Thread John Bagiliko
Remove the upload_to in the model. On Fri, Jul 5, 2019, 12:55 PM MichaƂ Ratajczak wrote: > Hi, i'm new in Django, I'm trying to configure media files correctly. > > That's in my model.py: > > class Question(models.Model): > description = models.CharField(max_length=200) > image = models.

Re: Django 2.2 Media files

2019-07-05 Thread John Bagiliko
Since you already configured static folder called media in settings.py, if you specifify upload_to='/media', Django will create a folder 'media' inside the media folder. On Fri, Jul 5, 2019, 2:21 PM John Bagiliko wrote: > Remove the upload_to in the model. > >

Re: Django 2.2 Media files

2019-07-06 Thread John Bagiliko
gid/django-users/5613b376-575f-4ab0-bdff-368f0fe8f1cf%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google

Re: select records from a model in another django app

2019-07-30 Thread John Bagiliko
Import the model from the app of choice and use it as usual. On Tue, Jul 30, 2019, 11:32 AM Nitin Kumar wrote: > Import another app model. > > On Tue, 30 Jul, 2019, 4:28 PM Perceval Maturure, > wrote: > >> i want to display model data using a class based view from another model >> in a differe

Re: select records from a model in another django app

2019-07-30 Thread John Bagiliko
I stand to be corrected On Tue, Jul 30, 2019, 11:53 AM John Bagiliko wrote: > Import the model from the app of choice and use it as usual. > > On Tue, Jul 30, 2019, 11:32 AM Nitin Kumar > wrote: > >> Import another app model. >> >> On Tue, 30 Jul, 2019, 4:2

Re: Recreating SQL query in ORM

2019-07-30 Thread John Bagiliko
Do you want to make this exact query in Django? Then use Your_model.objects.raw("the query here except the last semi colon") On Tue, Jul 30, 2019, 4:56 PM Jonathan Spicer wrote: > Hello, > > I have an sql query that I would like to recreate using the ORM. Would it > be possible for someone to gi

Re: [Django] How to retrieve the saved password in raw format

2019-10-21 Thread John Bagiliko
It is so wrong to want to read the users 's password. I think this should not be done. On Mon, Oct 21, 2019, 7:20 PM Alex Heyden wrote: > Password tables should never be human-readable. Never ever. No exceptions. > > If the intent is to power automation, store that password where the test > agen

Re: Django path, Learn Django, Django document

2019-12-21 Thread John Bagiliko
This is one of the best Django CRUD tutorials you can find: https://medium.com/@john.bagiliko/django-crud-web-application-77ef05af1f00 On Sat, Dec 21, 2019, 6:44 PM ramadhan ngallen wrote: > Okay you can visit JoinCfe via > https://www.codingforentrepreneurs.com > > Or you can visit their youtub