0👍
Hey guys thanks for your efforts. Actually, I applied all those solutions before posting my problem here but suddenly I got an idea and I removed all my Charfields
from my fresh_leads_model and cash_buyer_model and left their parameters empty(I mean without max_length=255
). although CharField
was working on my local machine but was not working on a live server. so I decided to change it from CharField
to TextField
without max_length
limit so Heroku supported it and everything is working fine now.
1👍
I know you said you "deleted the migrations and then migrated the whole schema again," but clearly something must be left over from your original schema.
I would suggest:
- Delete the entire database in Heroku if you don’t care about the data:
heroku pg:reset DATABASE
. - Push up your latest code to Heroku (including the new migrations in a new
git commit
):git push heroku HEAD:main
. - Migrate the database:
heroku run python manage.py migrate
.
- [Answered ]-Can't recover list of items from HTTP POST request
- [Answered ]-Django app in heroku and local deployment
- [Answered ]-Delecting empty ModelChoiceField in template
- [Answered ]-Checkbox not working in a Django form (bug?)
0👍
First of all, there is no model with max_length=20
in the sources codes that you’ve provided. So you need to search for it in other models.
Pay attention:
- In Python you need to use CamelCase in class names, so make edits like
class cash_buyer_model(models.Model):
->
class CashBuyerModel(models.Model):
- Because this is a Model so you no need to use it in the class names:
class CashBuyer(models.Model):
- I see that you’ve mentioned that you’ve already found the needed field, you need to push updated code on Heroku
- [Answered ]-How to pass tuple with one element as param in sql query Python?
- [Answered ]-Associate radio buttons with table rows in Django
- [Answered ]-How to get One object value from database in Django