Re: Django3 runserver error

2020-07-30 Thread RANGA BHARATH JINKA
Send your models.py file On Fri, 31 Jul 2020, 8:09 am RANGA BHARATH JINKA, wrote: > Hi convert it into string while displaying it in models __str__. > Or use f-strings. It is easy. All the best  > > On Thu, 30 Jul 2020, 8:29 pm ROHINI PUNDE, wrote: > >> I have error while updating the

Re: Django3 runserver error

2020-07-30 Thread RANGA BHARATH JINKA
Hi convert it into string while displaying it in models __str__. Or use f-strings. It is easy. All the best  On Thu, 30 Jul 2020, 8:29 pm ROHINI PUNDE, wrote: > I have error while updating the information,so many trials I cant solve > this problem,so please help me for this > > > On Thu, Jul

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread 'Amitesh Sahay' via Django users
Hi,  I am glad that I could help you. Cheerz Regards, Amitesh On Friday, 31 July, 2020, 01:16:14 am IST, Isha Thakur wrote: #yiv1468174970 P {margin-top:0;margin-bottom:0;}Hi,  I think, it can help you. You should never compare the complete HTML content. Just check the

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Isha Thakur
Hi, I think, it can help you. You should never compare the complete HTML content. Just check the functionalities. In case you need disabling the csrf at any cost, following logic should help I guess. In your views.py file, add the following package from django.views.decorators.csrf import

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
irst in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
first in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: Django key/value JSON widget

2020-07-30 Thread Kovy Jacob
Are you not able to use the regular python module for interacting with json files? > On Jul 22, 2020, at 2:34 PM, Federico Capoano > wrote: > > https://django-hstore.readthedocs.io/en/latest/#django-admin-widget > -- You

Re: static folder does not work

2020-07-30 Thread coolguy
Does it work to change the background of your page? or its not working with regards to bootstrap.css... Also check if you've accidentally commented out The 'django.contrib.staticfiles' in settings.py under INSTALLED_APP On Thursday, July 30, 2020 at 9:37:23 AM UTC-4, waqar khan wrote: > >

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
I don't have forms.py since I'm creating only the endpoints using rest framework. I've done it earlier and it has worked but earlier the foreign key was to refer the default User model but now I have customized User model by extending AbstractBaseUser. uploads/views.py *class

Re: Django automatic Logout and and after login it stays on same page

2020-07-30 Thread Isha Thakur
Please help me if someone facing the same issue. Regards Isha From: django-users@googlegroups.com on behalf of Isha Thakur Sent: July 29, 2020 1:28 PM To: django-users@googlegroups.com Subject: Re: Django automatic Logout and and after login it stays on same

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Christian Seberino
coolguy Remember to include the csrf_token tag in all forms that are submitted via > POST. > Yes! It must be INSIDE the form element *not* outside! I'm so grateful for your help. All the Best, Chris -- You received this message because you are subscribed to the Google Groups "Django

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Christian Seberino
Amitesh Indeed your suggestion below fixed everything. I can't thank you enough! cs On Wednesday, July 29, 2020 at 8:59:52 PM UTC-5, Amitesh Sahay wrote: > > Generally, {% csrf_token %} is written just below the opening tag. > I mean, not sure if this has anything to do with your issue.

Need Urgent Solution File explorer in django web app

2020-07-30 Thread Vishnu Bhandari
Need to create a functionality(Preferred lang- python with Django) in web application to access file system of any server(that might be any of this- AWS, GCP, Azure) Keypoints:- - Whenever user logged in, there will be multiple group of servers shown on UI section - In group of server, there will

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
You can create an upload form with an Image field, then when saving the for set the User field to request.user. Do you have an UploadForm already in your forms.py? if yes, show me with the view that handles. On Thu, Jul 30, 2020 at 11:59 AM Dinolin yp job wrote: > > > It worked but user_id

static folder does not work

2020-07-30 Thread waqar khan
*I have created Django Project.* *Project Name :- NoteBlog* *Application-Name :- BlogApp* *Problem:- I have created inside application static folder and i am give perfect path But does not work style.css file , How can achieve this problem.* *My Project Structure* [image: p.jpg]

Re: load static in css file

2020-07-30 Thread Irfan Khan
{% static 'imag.jpg' %} instead of this try {% static “images/imag.png” %} On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar wrote: > I am unable to fetch images from css file . > I have used {% load static %} > {% static 'imag.jpg' %} > buti can't fetch.console is saying image not found. > >

load static in css file

2020-07-30 Thread Chander shekhar
I am unable to fetch images from css file . I have used {% load static %} {% static 'imag.jpg' %} buti can't fetch.console is saying image not found. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Django3 runserver error

2020-07-30 Thread Mira
Thanks Thierray I made change in Line 142 by removing removing default Parameter and its working fine for me but the question is is Django 3.0.8 compatible with Python 3.6? If yes we wouldn't have to make a change in Django package like i made below? 140 try: 141

Re: help on extending user model using django rest_framework

2020-07-30 Thread ola neat
i have it defined in another app, but i've gotten it attached below On Thu, Jul 30, 2020 at 11:50 AM 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > Where is your "CustomUser" defined? D you think it could be > > user = models.OneToOneField(User, ..) > > Regards, >

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
It worked but user_id column in uploads_upload table is empty. How to solve this issue? On Thursday, July 30, 2020 at 3:31:21 PM UTC+5:30 obast...@gmail.com wrote: > From the error, it states that you are trying to add an upload object to > the database without a user. And from your model.py,

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
It worked but the user_id in uploads_upload is empty. How can I can make that work? On Thursday, July 30, 2020 at 3:31:21 PM UTC+5:30 obast...@gmail.com wrote: > From the error, it states that you are trying to add an upload object to > the database without a user. And from your model.py, the

Re: Django modelformset is_valid method retrieves entire model from database

2020-07-30 Thread Shaheed Haque
If you use the "empty_form " functionality, you may also wish to check that. In my case, I had added queryset filtering for the normal form case, but recently noticed to my horror that constructing the empty_form caused my

Re: help on extending user model using django rest_framework

2020-07-30 Thread 'Amitesh Sahay' via Django users
Where is your "CustomUser" defined? D you think it could be  user = models.OneToOneField(User, ..) Regards, Amitesh  On Thursday, 30 July, 2020, 03:59:59 pm IST, ola neat wrote: good day fellaz, i'm working on extending my user model to enable user create a profile but i'm getting

Re: Django3 runserver error

2020-07-30 Thread 'Amitesh Sahay' via Django users
It seems to me as if there is a mismatch of some in-built functionality. Can't say for exact though. Did you follow the migration rules from one version to another ? Regards, Amitesh  On Thursday, 30 July, 2020, 03:22:51 pm IST, Thierry DECKER wrote: The resolve() method dose not

Re: Django3 runserver error

2020-07-30 Thread oba stephen
Also try using a virtual environment. On Thu, Jul 30, 2020 at 10:52 AM Haris Ahmad wrote: > Hi there, > Resolved_path =pathlib.path.resolve(strict=True) > > Use this, might work.. > > On Thu, 30 Jul 2020, 2:25 PM Mira, wrote: > >> Hi All, >> I recently upgraded Django from 2.2 to 3 on my

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
>From the error, it states that you are trying to add an upload object to the database without a user. And from your model.py, the User foreign key does not have a null=True, and blank=True. So you can't save a null value for that user field. On Thu, Jul 30, 2020 at 10:52 AM Dinolin yp job

Re: Django3 runserver error

2020-07-30 Thread Thierry DECKER
The resolve() method dose not have the strict parameter anymore. Regards Le jeu. 30 juil. 2020 à 11:25, Mira a écrit : > Hi All, > I recently upgraded Django from 2.2 to 3 on my MacOS10.13. > I am using Python 3.6 and My Application was working fine with Django 2.2 > but now i am getting below

Re: Django3 runserver error

2020-07-30 Thread Haris Ahmad
Hi there, Resolved_path =pathlib.path.resolve(strict=True) Use this, might work.. On Thu, 30 Jul 2020, 2:25 PM Mira, wrote: > Hi All, > I recently upgraded Django from 2.2 to 3 on my MacOS10.13. > I am using Python 3.6 and My Application was working fine with Django 2.2 > but now i am getting

IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread Dinolin yp job
I'm trying to save image in postgres database. I have upload model which has a foreign key reference to the extended custom user model. But it shows the following error uploads/model.py from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class

Attribute 'field_classes' is ignored when using with Admin GenericInlineForms

2020-07-30 Thread Yuriy Tupychak
When I'm trying to change image field class withfield_classesand use it in GenericTabularInline- nothing happens and Django's default ImageFieldis used. /admin.py/ classImageAttachmentForm(ModelForm): classMeta: model = ImageAttachment fields = ['image'] *field_classes *= {

Django3 runserver error

2020-07-30 Thread Mira
Hi All, I recently upgraded Django from 2.2 to 3 on my MacOS10.13. I am using Python 3.6 and My Application was working fine with Django 2.2 but now i am getting below error. Any help related with this topic would be greatly appreciated. $>python3 manage.py runserver Watching for file changes

reg: error after I update my user profile page successfully

2020-07-30 Thread 'Amitesh Sahay' via Django users
Hello All,  I have been facing a very notorious issue. I say notorious because, I do not see any issue with my back-end functionality. I have developed a method to update the default User model field(email), and other extended User model(custom fields like country, state, phone etc). Below is

Admin list sorting problem

2020-07-30 Thread Mike Dewhirst
I have looked closely at the Admin docs and the page source and I think I'm at the blank wall. I have a collection of 14,000+ chemical names which just naturally sort weirdly. This is because scientists insist on incuding "locants" in chemical names. Locants indicate where sub-molecules sit in