Re: Modal Form reusable.

2019-07-01 Thread Volodymyr Sergeyev
Buenos Dias, May be this will help. Modal has an event, fired when it is about to show https://getbootstrap.com/docs/4.0/components/modal/#events Event - 'show.bs.modal' So you may bind handler to it and render modal with fields you wish: $('#dynamic_modal').on('show.bs.modal', function (e) {

Re: anonymous user in django app

2019-07-01 Thread Volodymyr Sergeyev
Hi, You may add a checkbox into your form with comment, "Post anonymously". And then in view check this value and if so - leave Post's user field blank. Regards, V. On Thursday, June 27, 2019 at 4:22:01 PM UTC+3, Gaurav Sahu wrote: > > Hy, I have a Django blog app. I want to add a feature in wh

Django security releases issued: 2.2.3, 2.1.10 and 1.11.22

2019-07-01 Thread Mariusz Felisiak
Today the Django team issued 2.2.3, 2.1.10, and 1.11.22 as part of our security process. These releases address security issues, and we encourage all users to upgrade as soon as possible: https://www.djangoproject.com/weblog/2019/jul/01/security-releases/ -- You received this message because y

Django security releases issued: 2.2.3, 2.1.10 and 1.11.22

2019-07-01 Thread Mariusz Felisiak
Today the Django team issued 2.2.3, 2.1.10, and 1.11.22 as part of our security process. These releases address security issues, and we encourage all users to upgrade as soon as possible: https://www.djangoproject.com/weblog/2019/jul/01/security-releases/ -- You received this message because y

404 not found

2019-07-01 Thread Soumen Khatua
Hi Folks, i'm using Django 1.11 and is et up everything properly but at the wrong url django redirecting to 500 page instead of 404 page.Please help me,How i can solve this problem? Here is my code: *views.py* *def error_404(request):return render(request,'shop/product/404.html',status =

Accessing data from a 30 GB file in json format

2019-07-01 Thread Nibil Ashraf
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 some error. I tried to load the json file like this json_parsed = json.loads(json_data)

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 >> have to access the data and write that to

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

Unauthenticated onetime url to edit a form.

2019-07-01 Thread Brian Mcnabola
*Context: * I have a booking app that is managed over the phone by an admin. the callers/client's details are stored in a Client model and then related to a Booking model when a booking is made. *Problem*: I want the client to have access to edit their booking without having to be a user in th

How to use model property(FK) instead of pk in prepopulated_fields

2019-07-01 Thread Jayendrasinh Solanki
Hello all, I want to create a unique property slug for all my category. Categories are: HTML & Wordpress. I want to create property slug as {property_name}-{ category*} *(e.g. files-html, files-worpdress, is-documented-html, is-documented-wordpres..) Now problem is when I use below code snippe

Django Model form not saving items to database

2019-07-01 Thread brian
Model class Products(models.Model): UNIT = ( ('whole', 'whole unit'), ('item', 'per single item'), ) # category = models.ForeignKey(Category, related_name='products', on_delete=models.CASCADE) ProductName = models.CharField(max_length=255) user = models.Fore

django form not saving items to database

2019-07-01 Thread brian
model class Products(models.Model): UNIT = ( ('whole', 'whole unit'), ('item', 'per single item'), ) # category = models.ForeignKey(Category, related_name='products', on_delete=models.CASCADE) ProductName = models.CharField(max_length=255) user = models.Fore

Unauthenticated one time edit form/url

2019-07-01 Thread Brian Mcnabola
Context: I have a booking system which is in a call centre. Clients call in and give their details (name address phone email) these details are stored in a Client Model When they make a booking over the phone it is associated to the entry in the Booking Model. Problem: I'd like to add a form on

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

2019-07-01 Thread Brian Mcnabola
https://stackoverflow.com/questions/2396238/memory-error-due-to-the-huge-input-file-size Just iterate the file do whatever operations you want on the file. https://towardsdatascience.com/python-basics-iteration-and-looping-6ca63b30835c On Monday, July 1, 2019 at 11:07:39 AM UTC+1, Nibil Ashraf wr

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.

Help

2019-07-01 Thread Pragesh Yadav
When creat virtual environment. I got an error message - '"virtualenv"' is not recognized as an internal or external command, operable program or batch file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Help

2019-07-01 Thread Desh Deepak
pip install virtualenv On Mon, 1 Jul 2019, 19:18 Pragesh Yadav, wrote: > When creat virtual environment. I got an error message - '"virtualenv"' is > not recognized as an internal or external command, > operable program or batch file. > > -- > You received this message because you are subscribed

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

2019-07-01 Thread PASCUAL Eric
Hi, To be able to traverse the JSON structure you'd normally need the entire structure in memory. Not mandatory, depending whats is to be done with the data. The same problem exists with XML, and this is the reason why SAX parsers have been created in addition to DOM ones. If the data process c

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

2019-07-01 Thread PASCUAL Eric
Hi again, My bad, UltraJSON is not really suited for event based parsing. I confused it with something else. Yajl C library (http://lloyd.github.io/yajl/) should match better, and has a Python binding focusing on stream based processing (http://pykler.github.io/yajl-py/), both for parsing and

Re: django form not saving items to database

2019-07-01 Thread Joe Reitman
Try this: def sell(request): if request.method == 'POST': form = ProductsForm(request.POST) if form.is_valid(): print('form is valid') form.save() return redirect('home') else: form = ProductsForm() retur

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

2019-07-01 Thread Nibil Ashraf
Thanks Cornelis! On Mon, Jul 1, 2019 at 7:09 PM Cornelis Poppema wrote: > 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

Django ORM Left Join query

2019-07-01 Thread Razib Hossain Shuvo
HI all, I have the follow models . I want to find all the categories from the UserCategory table along with the budget for each category from the UserBudget model. I tried with select_related and prefetch and filtered with user_id but then it only returns budget that has matched with user_id.

Django ORM Left join

2019-07-01 Thread Razib Hossain Shuvo
I have the following models. class UserBudget(models.Model): cat = models.ForeignKey('preference.Category', on_delete=models.CASCADE) user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) budget = models.DecimalField(default=0.00, decimal_places=2, max_digits=2

Re: The view todo.views.homepage didn't return an HttpResponse object. It returned None instead.

2019-07-01 Thread Kasper Laudrup
Hi Shubham, On 01/07/2019 18.52, Shubham Chauhan wrote: hi folks, i'm beginner in django and i try to make a to-do list app and this error comes please help me out In Python, if a function doesn't return anything, it will implicitly return "None". If you look at your "homepage" function,

Re: The view todo.views.homepage didn't return an HttpResponse object. It returned None instead.

2019-07-01 Thread Shubham Chauhan
Thank you so much On Mon, 1 Jul 2019, 22:57 Kasper Laudrup, wrote: > Hi Shubham, > > On 01/07/2019 18.52, Shubham Chauhan wrote: > > hi folks, i'm beginner in django and i try to make a to-do list app and > > this error comes please help me out > > > > In Python, if a function doesn't return any

Notification system using django channels

2019-07-01 Thread mintu
hello guys, i want to know if is there any way where we can add notifications to our app using channels when ever a user clicks on a like button the post author should kind of get a message saying so and so person liked your post i can completely understand how channels work and all but i canno

Re: Notification system using django channels

2019-07-01 Thread Aldian Fazrihady
I am currently using https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications for notifications as it allows notifications to be received while my app browser tabs are being closed. I use channels/websocket in my website for chatting feature. Unfortunately, I haven't written an

OTP Verification

2019-07-01 Thread ravikumar dingari
Actually generated OTP but , Don't know how to verify, can any one help -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com

Re: OTP Verification

2019-07-01 Thread Jani Tiainen
Hi. I wrote short blog post how to do simple OTP. http://blog.jani.tiainen.cc/django/2019/02/19/django-otp-simple-way.html HTH. ti 2. heinäk. 2019 klo 4.33 ravikumar dingari kirjoitti: > Actually generated OTP but , Don't know how to verify, can any one help > > -- > You received this message

Re: Nested dictionaries

2019-07-01 Thread Derek
I am not sure I understand what you mean by " write the models to work with the serializers". A model is there primarily for data storage and its possible to store JSON in a field of such a model. Any "business logic" for the model is just Python and can carry out, for example, processing ope