Questions tagged [django-syncdb]

`django-admin.py syncdb` is a command which creates the database tables for all apps in `INSTALLED_APPS` whose tables have not already been created.

django-admin.py syncdb is a command which creates the database tables for all apps in INSTALLED_APPS whose tables have not already been created.

Use this command when you've added new applications to your project and want to install them in the database. This includes any apps shipped with Django that might be in INSTALLED_APPS by default.

Syncdb is not a database-migration tool, like south. Syncdb can install your models in the database, but it cannot alter your database after changes in existing models.

Reference:

133 questions
84
votes
15 answers

Automatically create an admin user when running Django's ./manage.py syncdb

My project is in early development. I frequently delete the database and run manage.py syncdb to set up my app from scratch. Unfortunately, this always pops up: You just installed Django's auth system, which means you don't have any superusers…
a paid nerd
  • 30,702
  • 30
  • 134
  • 179
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
63
votes
5 answers

Can I use a database view as a model in Django?

i'd like to use a view i've created in my database as the source for my django-view. Is this possible, without using custom sql? ******13/02/09 UPDATE*********** Like many of the answers suggest, you can just make your own view in the database and…
spence91
  • 77,143
  • 9
  • 27
  • 19
50
votes
5 answers

In django, how do I call the subcommand 'syncdb' from the initialization script?

I'm new to python and django, and when following the Django Book I learned about the command 'python manage.py syncdb' which generated database tables for me. In development environment I use sqlite in memory database, so it is automatically erased…
Thiago Padilha
  • 4,590
  • 5
  • 44
  • 69
48
votes
8 answers

auth_user error with Django 1.8 and syncdb / migrate

When upgrading to Django 1.8 (with zc.buildout) and running syncdb or migrate, I get this message: django.db.utils.ProgrammingError: relation "auth_user" does not exist One of my models contains django.contrib.auth.models.User: user =…
mpso
  • 1,129
  • 2
  • 13
  • 26
39
votes
18 answers

Django/Python Beginner: Error when executing python manage.py syncdb - psycopg2 not found

I have Pythong2.6, psycopg2 and pgAdmin3 installed using Macports. My settings.py is: DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'mysite' # Or…
wenbert
  • 5,263
  • 8
  • 48
  • 77
29
votes
1 answer

Testing Django apps that use South migrations

I'm trying to create some Functional tests for a Django app that uses South migrations. Eventually, I will also be creating Twill tests. When I try to run the existing tests, the test database is not created successfully because of a problem with…
BryanWheelock
  • 12,146
  • 18
  • 64
  • 109
25
votes
6 answers

Django workflow when modifying models frequently?

as I usually don't do the up front design of my models in Django projects I end up modifying the models a lot and thus deleting my test database every time (because "syncdb" won't ever alter the tables automatically for you). Below lies my workflow…
utku_karatas
  • 6,163
  • 4
  • 40
  • 52
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
22
votes
5 answers

how to restore dropped table with django-south?

I wanted to clear out a table in my DB, so I dropped the table. Normally I would do manage.py syncdb to re-create it. However, the answer here says not to use syncdb anymore. So, what do I do instead?
Claudiu
  • 224,032
  • 165
  • 485
  • 680
20
votes
1 answer

Django CMS fails to synch db or migrate

I'm very new to django and in turn the django-cms app. I have followed the tutorial step by step: (from the offical website ) on a new machine and have everything exactly as the tutorial does yet I still can't get anywhere. I get to the final step…
Daniel Tate
  • 2,075
  • 4
  • 24
  • 50
11
votes
2 answers

Invalid Django TIME_ZONE

Doing a recent build, I ran Django's syncdb, and I'm getting the error: Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File…
Cerin
  • 60,957
  • 96
  • 316
  • 522
10
votes
2 answers

Do I need to call syncdb before or after South migrate

I'm new to South so I am wondering if I ever need to call ./manage.py syncdb or doing ./manage.py schemamigration appname --auto ./manage.py migrate appname is sufficient in all cases South can handle on its own.
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
10
votes
3 answers

OperationFailure: database error: not authorized for query on database.system.namespaces

I am beginner lift with django mongodb on heroku [ addon : mongolab ]. heroku run python manage.py syncdb Running python manage.py syncdb attached to terminal... up, run.2332 Creating tables ... OperationFailure: database error: not authorized for…
8
votes
2 answers

How to disable django.contrib.auth completely?

Because I'm using my own authentication and authorization system (with my own User/Permission model), I would like to completely disable this standard app from Django. I've tried removing the relevant lines from MIDDLEWARE_CLASSES…
Sander
  • 83
  • 1
  • 4
1
2 3
8 9