Naol
there is a tutorial section on the documentation, from beginner to advanced, then when you need something, other than the documentation teaches you search on the API reference
Shubham
IntegrityError at /admin/menu/menu/add/
insert or update on table "menu_menu" violates foreign key constraint "menu_menu_vendor_id_38af4d74_fk_accounts_vendor_id"
DETAIL: Key (vendor_id)=(7) is not present in table "accounts_vendor".
Shubham
can we figure this out?
Anonymous
Shubham
sure
Shubham
Anonymous
Did you delete something from your database?
Anonymous
What database are you using for your project?
Shubham
Shubham
Shubham
worked
Shubham
actually mapping went wromg
Shubham
thanks Hemant anyways
Anonymous
I'm following the django-channels tutorial
Everything is working fine but tests are failing namely
test_when_chat_message_posted_then_seen_by_everyone_in_same_room
and
test_when_chat_message_posted_then_not_seen_by_anyone_in_different_room
Has anyone faced that error before?
Naol
did the test failed or is it showing a general django exception
Anonymous
I tried to add print statement in the first line of test to know at which line it is failing as it's in try block
But even the first line of test didn't execute
Bunty chhatri wala..
I saved 1 field in models
Like this : [ (xyz) , (abc), (por) ]
How do i iterate over this list ..if only single query is called.. like : xyz.objects.get(pk=1)
Anonymous
S.H
Can anyone refer opensource project built using django rest framework on GitHub. It should cover all the functionality in drf.
Sopan
Jor
I have this problem with custom users model, inherited from AbstractUser, everything works great but password si not being validated with minimal length or required characters. I'm using the default views for login password_reset, password_done and so on..
Can anyone give me some advice as how to solve this? Or some link, i've looked ay documentación with no luck
Akash
I have enabled CSRF middleware, on successful login CSRFtoken & sessionID cookies are generated but when i check for them in browser's application storage, they are not present.
Even "document.cookie" return null
Any Idea why cookies are not saved ?
Note: I am using Django server for backend, React server for FrontEnd
Schohreh
Hi again
I want to create user in Django but I get error
I coded this
> Python manage.py createsuperuser
Please guide about how can I make an user account in Django
Thanks
M
Prateek
Ashkan
Hello. I want to create a video/audio call app in python. Can anyone help me?
Schohreh
Zey
Import "django.apps" could not be resolved from sourcePylancereportMissingModuleSource
Zey
Zey
Javad
How can get two slug in get_absolute_url in model and view
yasmina
Hi
When I use request.build_absolute_uri
The port is lost
Why?
Muhammad Shofyan
hi, i already success get data from database (models) into json format here my code :
.
def vechilejsonlist(request):
vechile = Vechile.objects.all().values('no_polisi', 'alias')
vechile_list = list(vechile)
return JsonResponse(vechile_list, safe=False)
return render(request, 'booking/booking_list.html').
i wonder, could we replace the key.. ? example : {"oldkey" : "value"} into {"newkey" : "value"}
.
thanks
Doragonsureiyā
R
How can I access each elements of the form data which has array in it
Anonymous
Naol
what it does is basically is access a data or a functionality of a system in the behalf of the the requesting end
Schohreh
Hi 😳🤚
How can I extend the existing API ?
Day
Ivan
Guys, need help. Has anyone connected three or more monitors to the laptop? Tell about it please 😇
Daniil
Daniil
Just make sure you have both thunderbolt and usual usb c cause sometimes you need to switch, as monitors won’t work with certain types of usb c.
Fuad M.
Hello everybody
Fuad M.
I have an issue with runserver, this happens after using serializer
Fuad M.
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\fuadt\AppData\Local\Programs\Python\Python38\lib\site-packages\django\utils\autoreload.py", line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File "C:\Users\fuadt\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1172, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Users\fuadt\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 200, in resolve
return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Fuad M.
do you have and idea about that ?
Gkm
Hello
help me use relativedelta in my models file
Ivan
Sreenath
Hello
Can anyone help me to create a constraint to give conditions to a django field
Eg: I need a datetime field where only dates after 2020-01-01 need to be stored
âshîsh
Elii
Hey guys
How can I use react js in django?
Rohan
where we use oops concepts in django? models.py ?
âshîsh
Elii
Naol
https://reactjs.org/docs/cdn-links.html
Elii
Elii
I'm getting this error ,I search about it but didn't work for me.
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(10)
Naol
the value is too long, check the stack trace for it's origin
Ashwin
Hi. Is it possible to use pysocket in django?
I'm trying to develop an backend which receives data as bytes from a microcontrollers using TCP/IP connection.
Anonymous
Naol
Ashwin
Ive read about asgi websockets. Previously I did a server using python from scratch. I used pysocket to create the entire backend. Am not able to figure out if the codes can be used in django as is?
Bunty chhatri wala..
How to implement search option..
Where a user can search other user and get his public posts..
??
Fabian
hi
Fabian
how do i call a function dinamically? i have a model with 4 many to many relations, and i need something like this
came.came_corregir.add(value)
where the related names are: came_corregir, came_afrontar. etc
Sumit
Hi, how can I run celery task for some days , let's say 10.
Sumit
And how can I run it on the production with apache2. I am hosting my django with apache2.
Nimesh
Hi,
I am having a GET request which return approximately 6000 records and it takes 7-8 MB of data. I would like to introduce caching but My concern is Can i get the latest updated data in database as well after implementing caching?
If yes then can anybody suggest how?
常雄 高橋
Hi, I'm from Russia, so forgive me in advance for my spelling mistakes.
I am New to Python, specifically to Python Django. I did the setup through the settings.py file and after that I wrote the code. I tried to run the server through the console, but it gave an error on line 18 of the code:
NameError: name 'os' is not defined.
This is what was on line 18:
PROJECT_ROOT = os.path.dirname(__file__)
How do I fix it?
Nimesh
常雄 高橋
Thx)
Krishna
I hosted my site on sharehosting but when I turned DEBUG=False its not rendering admin side css files.
Krishna
Image = https://ibb.co/GC7SdnF
Tech
Anyone please tell me how to tack a model in django i.e who created who updated who deleted with date which should display in html
Tech
R else please tell me how to create custom histry model
Swapnil
I'm a novice Django and Python developer. I'm calling following form in two different templates but I prefer that only one template should consider form widget defined in following code. How can I do that?
class NumsEntryForm(ModelForm):
class Meta:
model = RDdbNums
fields = ['application', 'nextnbr', 'scheme', 'ncount', 'reccount', 'recincr', 'comment']
widgets = {
'nextnbr': forms.TextInput(attrs={'class': 'p-3 mb-2 bg-warning text-dark'}),
'reccount': forms.TextInput(attrs={'class': 'p-3 mb-2 bg-warning text-dark'}),
}