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
8
votes
2 answers

Database error: no such table: auth_user. Extending AbstractUser and using model to register on admin

I'm trying to use AbstractUser to add a field to Django's standard User model. This is my code: class GUser(AbstractUser): uuid = UUIDField(auto=True) This has been successful because from the shell I can say, >>> a = GUser.objects.all() >>>…
7
votes
2 answers

Django 1.8 Syncdb vs migrate

I have created a model and executed syncdb which had created the tables as my model was designed. Afterwards I modified the model and executed makemigrations which created the migrations ignoring the tables that syncdb had already created. So I…
Aymane Shuichi
  • 460
  • 5
  • 14
6
votes
2 answers

How to get './manage.py syncdb' to create additional views or run custom SQL?

Is there a way to run some custom SQL statements after syncdb does it thing creating the tables for the models? Specifically, I would like to create some database views.
Ricky
  • 5,365
  • 2
  • 32
  • 30
4
votes
3 answers

Django create groups on init, extending superuser profile

I create a site in Django and here is my Question How to make something like this: On init (for example, when someone run "syncdb"?) I need to create a group with permissions and extend superuser profile from User to UserProfile(when user register…
Kubas
  • 976
  • 1
  • 15
  • 34
4
votes
2 answers

manage.py syncdb doesn't add tables for some models

My second not-so-adept question of the day: I have a django project with four installed apps. When I run manage.py syndb, it only creates tables for two of them. To my knowledge, there are no problems in any of my models files, and all the apps are…
twneale
  • 2,836
  • 4
  • 29
  • 34
3
votes
2 answers

is running django syncdb in production, post initial deployment safe?

I read somewhere that you would never run syncdb on a database, post its initial run. Is this true? I don't see what the problem could be. Do you?
Val Neekman
  • 17,692
  • 14
  • 63
  • 66
3
votes
2 answers

Heroku Django: Running a Worker

I'm following the Heroku Django tutorial. I believe I followed it exactly. I ran no additional commands besides what they asked for. However, when I get to the part where I sync the Celery and Kombu tables (under the "Running a Worker" section), I…
Alexandre
  • 2,073
  • 4
  • 21
  • 24
3
votes
3 answers

How to do a syncdb with django, when migrations are also involved

when I do a syncdb I get the following error everytime: Not synced (use migrations): - deals - analytics (use ./manage.py migrate to migrate these) And when I run sudo python manage.py migrate. I get the following Running migrations for…
mukul
  • 121
  • 1
  • 11
3
votes
1 answer

Django - Why doesn't syncdb respect the database router?

I have set up a database router to direct different apps and different models to different databases using the db_for_read and db_for_write router methods. That works very well, except that ./manage.py syncdb does't respect those router…
Danilo Bargen
  • 18,626
  • 15
  • 91
  • 127
3
votes
4 answers

Is there a way to update the database with the changes in my models?

Possible Duplicate: update django database to reflect changes in existing models I've used Django in the past and one of the frustrations I've had with it as an ORM tools is the inability to update an existing database with changes in the model.…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
3
votes
3 answers

Django syncdb locking up on table creation

I've added new models and pushed to our staging server, run syncdb to create their tables, and it locks up. It gets as far as 'Create table photos_photousertag' and postgres output shows the notice for creation of 'photos_photousertag_id_seq', but…
ironfroggy
  • 7,991
  • 7
  • 33
  • 44
3
votes
2 answers

Getting error with SOUTH and django migration

I got this error while migrating Sentry app in django. I am using mysql ! Since you have a database that does not support running ! schema-altering statements in transactions, we have had ! to leave it in an interim state between migrations. !…
tej.tan
  • 4,067
  • 6
  • 28
  • 29
3
votes
3 answers

Django post_syncdb signal handler not getting called?

I have a myapp/management/__init__.py that is registering a post_syncdb handler like so: from django.db.models import signals from features import models as features def create_features(app, created_models, verbosity, **kwargs): print "Creating…
David Eyk
  • 12,171
  • 11
  • 63
  • 103
3
votes
1 answer

Django All SQL from syncdb

This may be a real stupid question. But how do you get ALL sql statements django-admin.py is going to run or does run from a syncdb command?
Sean McCully
  • 1,122
  • 3
  • 12
  • 21
3
votes
1 answer

Can Django Syncdb handle compressed initial_data.json.tgz fixtures?

Need to keep the size of the package down, so is it possible to compress the initial data in some supported format for syncdb to pickup?
Val Neekman
  • 17,692
  • 14
  • 63
  • 66
1
2
3
8 9