Error when migrating django app on heroku bash
Screenshot of heroku bash running on cmdFirst of all, I deployed my django app on heroku. The site works well but when I try to interact with database (fill a form that submits input to db), I get a programming error. I learnt I needed to run a migrate command on heroku bash and did. After a few migrations it returned a lot of error lines, the first saying '..../django.db.backends.until.py, line 85, in _execute
return self.cursor.execute(SQL, params)
pyscopg2.DataError: integer out of range.
Then other lines of error saying the above error led to the others. How can I fix this please? Searched online but couldn't find it
PS if I run the migrate command cmd in dev mode on my machine it works well.
#0004_auto_... file
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0003_auto_20181109_2333'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='phone',
field=models.CharField(max_length=20),
),
]
and then this is the affected model:
#models.py file
from django.db import models
from django.utils import timezone
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=200)
email = models.CharField(max_length=100)
phone = models.CharField(max_length=20)
message = models.TextField()
date = models.DateTimeFiel``d(default=timezone.now)
def __str__(self):
return self.name +'(' + self.email +')'
django heroku heroku-postgres
add a comment |
Screenshot of heroku bash running on cmdFirst of all, I deployed my django app on heroku. The site works well but when I try to interact with database (fill a form that submits input to db), I get a programming error. I learnt I needed to run a migrate command on heroku bash and did. After a few migrations it returned a lot of error lines, the first saying '..../django.db.backends.until.py, line 85, in _execute
return self.cursor.execute(SQL, params)
pyscopg2.DataError: integer out of range.
Then other lines of error saying the above error led to the others. How can I fix this please? Searched online but couldn't find it
PS if I run the migrate command cmd in dev mode on my machine it works well.
#0004_auto_... file
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0003_auto_20181109_2333'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='phone',
field=models.CharField(max_length=20),
),
]
and then this is the affected model:
#models.py file
from django.db import models
from django.utils import timezone
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=200)
email = models.CharField(max_length=100)
phone = models.CharField(max_length=20)
message = models.TextField()
date = models.DateTimeFiel``d(default=timezone.now)
def __str__(self):
return self.name +'(' + self.email +')'
django heroku heroku-postgres
1
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
1
Please show the migration file (mainsite/migrations/0002_auto_...py
) and the related models
– Alasdair
Nov 14 '18 at 17:04
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07
add a comment |
Screenshot of heroku bash running on cmdFirst of all, I deployed my django app on heroku. The site works well but when I try to interact with database (fill a form that submits input to db), I get a programming error. I learnt I needed to run a migrate command on heroku bash and did. After a few migrations it returned a lot of error lines, the first saying '..../django.db.backends.until.py, line 85, in _execute
return self.cursor.execute(SQL, params)
pyscopg2.DataError: integer out of range.
Then other lines of error saying the above error led to the others. How can I fix this please? Searched online but couldn't find it
PS if I run the migrate command cmd in dev mode on my machine it works well.
#0004_auto_... file
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0003_auto_20181109_2333'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='phone',
field=models.CharField(max_length=20),
),
]
and then this is the affected model:
#models.py file
from django.db import models
from django.utils import timezone
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=200)
email = models.CharField(max_length=100)
phone = models.CharField(max_length=20)
message = models.TextField()
date = models.DateTimeFiel``d(default=timezone.now)
def __str__(self):
return self.name +'(' + self.email +')'
django heroku heroku-postgres
Screenshot of heroku bash running on cmdFirst of all, I deployed my django app on heroku. The site works well but when I try to interact with database (fill a form that submits input to db), I get a programming error. I learnt I needed to run a migrate command on heroku bash and did. After a few migrations it returned a lot of error lines, the first saying '..../django.db.backends.until.py, line 85, in _execute
return self.cursor.execute(SQL, params)
pyscopg2.DataError: integer out of range.
Then other lines of error saying the above error led to the others. How can I fix this please? Searched online but couldn't find it
PS if I run the migrate command cmd in dev mode on my machine it works well.
#0004_auto_... file
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0003_auto_20181109_2333'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='phone',
field=models.CharField(max_length=20),
),
]
and then this is the affected model:
#models.py file
from django.db import models
from django.utils import timezone
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=200)
email = models.CharField(max_length=100)
phone = models.CharField(max_length=20)
message = models.TextField()
date = models.DateTimeFiel``d(default=timezone.now)
def __str__(self):
return self.name +'(' + self.email +')'
django heroku heroku-postgres
django heroku heroku-postgres
edited Nov 14 '18 at 18:05
Cole
asked Nov 14 '18 at 16:17
ColeCole
455
455
1
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
1
Please show the migration file (mainsite/migrations/0002_auto_...py
) and the related models
– Alasdair
Nov 14 '18 at 17:04
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07
add a comment |
1
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
1
Please show the migration file (mainsite/migrations/0002_auto_...py
) and the related models
– Alasdair
Nov 14 '18 at 17:04
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07
1
1
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
1
1
Please show the migration file (
mainsite/migrations/0002_auto_...py
) and the related models– Alasdair
Nov 14 '18 at 17:04
Please show the migration file (
mainsite/migrations/0002_auto_...py
) and the related models– Alasdair
Nov 14 '18 at 17:04
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07
add a comment |
1 Answer
1
active
oldest
votes
Thanks @alasdair for your time, poked around the net more and found the reason.
I ran makemigrations
on heroku bash out for stupid curiousity. I should not have as it was what created those migrations file that gave me trouble. I ran migrate
straight.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304546%2ferror-when-migrating-django-app-on-heroku-bash%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks @alasdair for your time, poked around the net more and found the reason.
I ran makemigrations
on heroku bash out for stupid curiousity. I should not have as it was what created those migrations file that gave me trouble. I ran migrate
straight.
add a comment |
Thanks @alasdair for your time, poked around the net more and found the reason.
I ran makemigrations
on heroku bash out for stupid curiousity. I should not have as it was what created those migrations file that gave me trouble. I ran migrate
straight.
add a comment |
Thanks @alasdair for your time, poked around the net more and found the reason.
I ran makemigrations
on heroku bash out for stupid curiousity. I should not have as it was what created those migrations file that gave me trouble. I ran migrate
straight.
Thanks @alasdair for your time, poked around the net more and found the reason.
I ran makemigrations
on heroku bash out for stupid curiousity. I should not have as it was what created those migrations file that gave me trouble. I ran migrate
straight.
answered Nov 14 '18 at 19:00
ColeCole
455
455
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304546%2ferror-when-migrating-django-app-on-heroku-bash%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
One line of an error message isn’t enough information. Please show the full traceback, the migration file that is failing, and the related model.
– Alasdair
Nov 14 '18 at 16:20
@Alasdair added screenshot cos I cant copy error code on cmd
– Cole
Nov 14 '18 at 17:02
1
Please show the migration file (
mainsite/migrations/0002_auto_...py
) and the related models– Alasdair
Nov 14 '18 at 17:04
@Alasdair code blocks added
– Cole
Nov 14 '18 at 18:07