Relative Content

Tag Archive for pythondjangobackend

ValueError when i migrate in my Django project

I’m trying to make a music streaming website using Django. I have this error when i use the terminal command “migrate”: “ValueError: Field ‘song_id’ expected a number but got ” “. I don’t understand where “song_id” take a value that is not a number. How can i fix it and what is the code line with the problem?
this is my views.py:

Why am i facing “APPEND_SLASH” error in Django?

So i am creating a simple API sing Django. So every time i am getting the APPEND_SLASH issue while making a POST request on localhost:8000/cars from PM , in the body I am passing a JSON request body with one field based on the value of which the data is gonna be filtered from the sqlite DB.

Unable to view the table in Django admin panel

Okay so i am new to django. I created a superuser and then i created a ‘Customer’ model as shown below in models.py inside my app called ‘products’ Now , ran the migration command i.e python manage.py makemigrations followed by python manage.py migrate. After i log into the admin panel i see the ‘Customers table and as soon as i click on it i get this error attached in the screenshot.