Re: How to increase file upload size in twitter in django rest api

2019-10-10 Thread Cornelis Poppema
Are you perhaps looking for https://docs.djangoproject.com/en/2.2/ref/settings/#data-upload-max-memory-size ? On Thursday, 10 October 2019 07:04:31 UTC+2, ajitkumar wrote: > > Hi, > > can anyone help me how to increase media upload size in django rest api, > > > > > Thanks in advance. > > >

Re: list cycle in template

2019-10-09 Thread Cornelis Poppema
{{ mylist.a }} means: get attribute "a" from object "mylist". For the template it doesn't matter if you have defind a variable "a", it will get the literal "a". Also see https://stackoverflow.com/questions/4651172/reference-list-item-by-index-withdoesin-django-template

Re: regarding adding data into database using faker library

2019-09-26 Thread Cornelis Poppema
It seems you have an unfortunate typo in your environment variable name. Change DJANGO_SETTING_MODULE -> DJANGO_SETTINGS_MODULE and try again. On Thursday, 26 September 2019 16:26:18 UTC+2, Sahil Sharma wrote: > > [image: 2019-09-26-1569507899_screenshot_1920x1080.jpg] > I did the changes but it

Re: regarding adding data into database using faker library

2019-09-26 Thread Cornelis Poppema
The location of your first django.setup() on line 4 was actually what you need. Right now it does show the same error but from a different line: the line where you import your model. - you need to do django.setup() before importing any of your project code - you need to set

Re: regarding adding data into database using faker library

2019-09-25 Thread Cornelis Poppema
You almost had it! You're already setting DJANGO_SETTINGS_MODULE before you call django.setup() inside your main function. However, you also call django.setup() on line 4. You need to set DJANGO_SETTINGS_MODULE before the first django.setup(). On Wednesday, 25 September 2019 13:04:10 UTC+2,

Re: how to use sql select query with pyodbc and django ?

2019-09-18 Thread Cornelis Poppema
I am not using pyodbc, but I imagine you should %s instead of ? as parameter marker. mysql-python actually uses python interpolation to build the query instead of simply replacing the ? signs, so pyodbc might do the same. If that's the case, it makes sense the error says there are 0 parameter

Re: Django's str(queryset.query) returns invalid SQL if I compare datetimes

2019-08-22 Thread Cornelis Poppema
What makes sense to me is the query builder (ORM) in Django "escapes"/quotes the values at the very last moment: whenever the query is to be executed in a database. Different databases can have different escape characters. When you print queryset.query it simply isn't at a stage where the

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

2019-07-01 Thread Cornelis Poppema
To be able to traverse the JSON structure you'd normally need the entire structure in memory. For this reason you can't (easily) apply suggestions to iterate over a file efficiently to a JSON file: you can perhaps read the file efficiently, but the structure in memory will still grow in memory.

Possible bug in python manage.py migrate when changing the field type of a foreign key with a constraint

2019-06-11 Thread Cornelis Poppema
I have two models and a ForeignKey. In this project I'm still using django 1.11 (still busy migrating to python3) but I have reproduced this in django 2.2.2 Models are Call and Client. Call has a ForeignKey to a PositiveIntegerField on Client. I'm changing the type of this field to a