Anonymous
Puranjay
Can you post that error?
Traceback (most recent call last): File "/home/puranjay/Documents/FeasOpt/new/fo_ftl_puranjay/mysite/empanelment/views.py", line 10432, in update_client_type delete_client_type(user, client_type_id) File "/home/puranjay/Documents/FeasOpt/new/fo_ftl_puranjay/mysite/empanelment/views.py", line 105, in delete_client_type delete_indent_models(user, clients) File "/home/puranjay/Documents/FeasOpt/new/fo_ftl_puranjay/mysite/empanelment/utility.py", line 962, in delete_indent_models raise e File "/home/puranjay/Documents/FeasOpt/new/fo_ftl_puranjay/mysite/empanelment/utility.py", line 941, in delete_indent_models VDLContract.objects.filter(contractindent__cont__Client__in=clients).delete() File "/home/puranjay/Documents/FeasOpt/env/venv/lib/python3.6/site-packages/django/db/models/query.py", line 661, in delete collector.collect(del_query) File "/home/puranjay/Documents/FeasOpt/env/venv/lib/python3.6/site-packages/django/db/models/deletion.py", line 222, in collect field.remote_field.on_delete(self, field, sub_objs, self.using) TypeError: 'NoneType' object is not callable
Ghorz
Anyone here who can make landing page.
Remember the template must be modify in DTL, separate the static from templates, basify it and extend
Master
Puranjay Your error is happends on this line: vdl_market_object.delete(), not here VDLContract.objects.filter(contractindent__cont__Client__in=clients).delete(). So use pdb and trace value vdl_market_object in your utility function
Puranjay
Are you sure that your model exists?
Yes...otherwise it would have given ImportError on terminal
Master
Read your Traceback. Open utility.py, find 941 row and before it write import pdb, pdb.set_trace(). This set a breakpoint into django, and you will be able to check which values you receive in your VDLContract.objects.filter(contractindent__cont__Client__in=clients) expression
Master
Use debugger, you are programmer after all
Orack
yessss
Orack
💃💃💃💃💃💃
Orack
after so many days managed to register a user with email confirmation
cj
after so many days managed to register a user with email confirmation
👏🏻👏🏻👏🏻👏🏻🍻
cj
how can we see if a folder is project or app ?
all folders are packages 🤷🏻‍♂️
cj
to make them be an app you explicitly have to register them in INSTALLED_APPS
cj
the main folder should be the project folder
cj
unless... you're talking about something else I'm not getting
Orack
https://ibb.co/vB6Mv0r
Orack
https://ibb.co/vB6Mv0r
we cant determine only by looking at this?
Orack
the main folder should be the project folder
here there are 2 folders in main folder, but im not sure if both are apps
cj
https://ibb.co/vB6Mv0r
emailsignup is app, rest_email_signup the folder of settings, templates self-explained, and / should be the project,
cj
https://ibb.co/vB6Mv0r
https://i.c0x6a.dev/4b5541e3-765b-403e-9f26-d027e44aef5e.png this, for example is how I organize my Django projects
Rohan
uwsgi?
Rohan
gunicorn?
cj
gunicorn?
👆
Rohan
I see
Orack
apps is djangoapplication
Orack
what is top 3rd djangock ?
cj
apps is djangoapplication
inside apps I put all the applications created by django-admin startapp
Orack
project settings
so main url management starts here which includes all other urls
cj
let me show you another project... a little complex one https://i.c0x6a.dev/9ba7205e-59fa-4e2f-8f81-a9abcda74751.png
cj
so main url management starts here which includes all other urls
yes, that's how Django creates the base project
Асим
How to upload and read from json file in django?
cj
🤔 unless, you're talking about something else
Rohan
Upload exactly where?
cj
another answer could be: manage.py loaddata a_file.json 🤷🏻‍♂️
cj
question is too much vague to have an answer
Rajjix
the answer is to find the right solution for the problem imposed.
cj
the answer is to find the right solution for the problem imposed.
first you have to know the real problem 🤷🏻‍♂️
Асим
I want to upload json file with post method then read from it and send data to database
Master
FileField in form, then request.FILES in view
Master
Form should be multipart
Rajjix
i would do it with JS on the client side if it’s a json file, just parse and send parsed data to your endpoint.
cj
I want to upload json file with post method then read from it and send data to database
do you want to store the full JSON content in a single field? or do you want to store each JSON's attribute in each field of your model?
Shekhar
I have a problem in celery pls find the code below https://paste.fedoraproject.org/paste/guVpzPAk~D37VyjW6xTN2Q
Shekhar
thats ok but when I use delay method in add.delay(3,4) it was not responding .It should return the <async id >
Shekhar
ok
Shekhar
this is the task
Shekhar
https://paste.fedoraproject.org/paste/FEDIXIi3sA2FPmXHvteLtg
Pablo
Someone use swagger for documentation of views?
Felipe
Hey guys, I've a little problem here. I'm working with DRF and I created a custom serializer field that receive integer values and converts to Decimal value. Then, for send it back to frontend it's converted again to integer. This field is working ok, but I didn't know how to test it. I've tried to write some tests, but it's not working. Someone can help me with the tests?
Felipe
https://pastebin.com/HSkLZMvn
Felipe
Code is here
Anonymous
django blog sorting latest posts first
Anonymous
django blog sorting latest posts first
Can anyone help me with this
Erick
django blog sorting latest posts first
https://docs.djangoproject.com/en/2.2/ref/models/querysets/#order-by
Anonymous
https://github.com/aakashpadhiyar/Portfolio
Anonymous
Can we use react as a template engine for django app
Sander
You can build a Django API & build a React application on top of that
Anonymous
So how I setup SSR with django
Anonymous
Ok
sahil
Can anyone help How to replace space by an '%' of url in html
أمجد☄
(Skip this) Guys if i have declared and created an object using a view function, if i have another function in the same view how can i call that object created using that function ?
أمجد☄
(Skip this) Guys if i have declared and created an object using a view function, if i have another function in the same view how can i call that object created using that function ?
(And this) I want to call it since i want to check for a boolean if its true or not to make some actions, so whats the best way to call the created object, and this object is having a user field since this webapp includes the login feature, just a thing worth noting.