Questions tagged [syncdb]
82 questions
67
votes
6 answers
Django manage.py Unknown command: 'syncdb'
I'm trying to follow this tutorial but I'm stuck on the 5th step.
When I execute
[~/Django Projects/netmag$] python manage.py syncdb
I get the following error message :
Unknown command: 'syncdb'
Type 'manage.py help' for usage.
and here is the…

jeff
- 13,055
- 29
- 78
- 136
27
votes
1 answer
How can I perform Django's `syncdb --noinput` with call_command?
>>> from django.core.management import call_command
>>> call_command('syncdb')
executes the syncdb management command from within a python script. However, I want to run the equivalent of
$ python manage.py syncdb --noinput
from within a python…

pvoosten
- 3,247
- 27
- 43
24
votes
2 answers
Django flush vs sqlclear & syncdb
Can anyone tell if there is a difference between
>manage.py flush # or reset
and
>manage.py sqlclear appname | python manage.py dbshell
>manage.py syncdb

Jibin
- 3,054
- 7
- 36
- 51
14
votes
7 answers
Postgresql socket error on OSX 10.7.3 when running Django's syncdb
Since upgrading OSX to version 10.7.3, when I attempt to run a Django "syncdb" command, I receive the following psycopg2 error from Postgresql 8.4.2:
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server…

Huuuze
- 15,528
- 25
- 72
- 91
14
votes
1 answer
Django syncdb conflicting related_name when using inheritance and ForeignKey
This time I think it's not me being stupid but an actual conflict. I have the below code (simplified):
from django.db import models
class Alpha(models.Model):
relation = models.ForeignKey('Delta', related_name = 'reverse_relation', blank =…

Mark
- 18,730
- 7
- 107
- 130
14
votes
4 answers
Django syncdb and migrate
I'm moving django website from one server to another, and I tried to syncdb, so i've put python manage.py syncdb, and i get this output:
Syncing...
Creating tables ...
The following content types are stale and need to be deleted:
orders |…

miszczu
- 1,179
- 4
- 19
- 39
13
votes
1 answer
stale content types while syncdb in Django
While I'm trying to syncdb for my django project, I'm seeing following complains:
The following content types are stale and need to be deleted:
myapp |
Any objects related to these content types by a foreign key will also
be deleted. Are you sure…

yuwang
- 846
- 11
- 24
7
votes
1 answer
Django: My models.py file seems to have trouble syncing to the database.
I tried setting up a simple models.py file as part of this tutorial that I was following online. When I tried the syncdb command, I got the following errors:
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File…

sinθ
- 11,093
- 25
- 85
- 121
6
votes
3 answers
Django: update database schema without losing data
What is the best solution if I want to upgrade (alter) my database schema (add new fields to tables by adding them just to Django models) without losing data in these tables? "syncdb" not adding them of course, so I need your advices how to alter…

Ignas Butėnas
- 6,061
- 5
- 32
- 47
6
votes
4 answers
Django Models not Showing Up in DB after syncdb
I have a models folder that has a few models in files that are already in the DB. I have just added another file/model but it is not being added to the DB when I run syncdb. I've tried manage.py validate and it is running fine. I have also run the…

ntrrobng
- 408
- 5
- 15
5
votes
2 answers
Django get syncdb sqlall statement to update after code changes
Trying to see the SQL that syncdb would generate at the current moment in time.
After several searches the answer wasn't readily apparent -- I know you can use:
python manage.py syncdb --sqlall
returns:
Create the database tables for all apps in…

Wade Williams
- 3,943
- 1
- 26
- 35
5
votes
1 answer
Why do I get this error when I run "python manage.py syncdb --all"?
I am trying to apply tutorial http://docs.django-cms.org/en/2.1.3/getting_started/tutorial.html.
But I didn't succeed to perform the initial database setup
Why do I get this error when I run "python manage.py syncdb --all" ?
Traceback (most recent…

pba
- 51
- 1
- 2
4
votes
1 answer
heroku: relation "auth_group" does not exist
I'm facing problem while doing syncdb on heroku.
I have a custom user model and when I try to sync,heroku gives this error.
django.db.utils.ProgrammingError: relation "auth_group" does not exist
I tried python manage.py makemigrations but nothing…

S7H
- 1,421
- 1
- 22
- 37
4
votes
2 answers
Django not creating db tables for models (neither with syncdb nor South)
I have a Django project on a Centos VPS.
I created some models and debugged them so they validate and give no errors.
I have them in a "models" folder in my myapp and have added each model to the init file in this directory, for example:
from…

user3227889
- 41
- 1
- 1
- 5
4
votes
5 answers
Django can't syncdb after drop/create database
I wanted to reset a database and issued a drop database followed by a create database
on a postgresql server accessed through psycopg2 by a django app.
When I do ./manage.py syncdb I get the following…

user234090
- 53
- 1
- 5