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
3
votes
1 answer

Django syncdb tries to delete table that does not exist

I am running syncdb. Django finds a content type where I have deleted the corresponding table already: The following content types are stale and need to be deleted: installs | socialdata After answering 'yes' to continue, Django tries to…
kev
  • 8,928
  • 14
  • 61
  • 103
3
votes
2 answers

python manage.py syncdb does not automatically load initial_data.json fixture in Python Django

I have Python Django project with app at apps/hello and a fixture with initial data at /apps/hello/fixtures/initial_data.json When I git clone my Python Django project from github, checkout needed branch and run ./manage.py syncdb it creates empty…
Sashko Lykhenko
  • 1,554
  • 4
  • 20
  • 36
3
votes
2 answers

django manage.py syncdb not working?

Trying to learn Django, I closed the shell and am getting this problem now when I call python manage.py syncdb, any idea what happened?: I've already set up a db. I have manage.py set up in the folder django_bookmarks. What's up here? Traceback…
Diego
  • 795
  • 2
  • 13
  • 17
3
votes
4 answers

No migrations to apply

$python manage.py syncdb Operations to perform: Apply all migrations: admin, contenttypes, auth, sessions Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. …
Alwerdani
  • 111
  • 1
  • 1
  • 8
3
votes
1 answer

Clarification on django syncdb --all option

I am trying to understand what exactly ./manage.py syncdb --all does? I recently had a database issue that I was able to fix by running this command but I am not exactly sure what it does behind the scenes. I understand that syncdb creates the…
user3282276
  • 3,674
  • 8
  • 32
  • 48
3
votes
2 answers

Multiple databases in django - syncdb doesn't create django_ tables

I'm facing a problem when using multiple databases in Django. Here's the scenario: I have a django project, which is divided into two applications: app1 and app2. App1 will take care of authentication and custom modules (ie. it has its own…
Boun
  • 123
  • 1
  • 10
3
votes
0 answers

cmsplugin-zinnia throwing a No module namedEntryMenu

I've got an issue when trying to run python manage.py syncdb. I am building a site with django-CMS and adding cmsplugin-zinnia for blog features. But this is coming up and I can not figure out why, looking at the code EntryMenu exists. raise…
tjoenz
  • 699
  • 5
  • 14
  • 39
3
votes
2 answers

Django syncdb exception after updating to 1.4

So I was developing an app in Django and needed a function from the 1.4 version so I decided to update. But then a weird error appeared when I wanted to do syncdb I am using the new manage.py and as You can see it makes some of the tables but then…
2
votes
1 answer

Heroku: django syncdb doesn't seem to do anything.

I pushed my app to heroku after making sure it works fine in my local environment. When I try to sync db using: heroku run myapp/manage.py syncdb I see just this. No tables are created. Running myapp/manage.py syncdb attached to…
Aswath Krishnan
  • 1,131
  • 1
  • 9
  • 16
2
votes
3 answers

Django/Python EnvironmentError?

I am getting an error when I try to use syncdb: python manage.py syncdb Error message: File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 83, in __init__ raise EnvironmentError, "Could not import settings '%s' (Is it on…
simi
  • 1,535
  • 3
  • 12
  • 14
2
votes
1 answer

Django's syncdb is inserting duplicated entries in auth_permission table

I have created my models in django and run manage.py syncdb Everything was ok, until I added a new model in an existing app. When I run syncdb again, duplicated entries were inserted in auth_parmission table. Even for entry log from "admin" app. I…
duduklein
  • 10,014
  • 11
  • 44
  • 55
2
votes
2 answers

unable to create table using django syncdb

I am quite new to django and web framework development and I tired my hands on creating tables by using the inbuilt django models and then running the syncdb command to create it automatically . However I am having trouble creating it Here is my…
draklor40
  • 453
  • 7
  • 17
2
votes
1 answer

Django syncdb ignore a specific model

Is there a way to make syncdb ignore a specific table? I decided to declare a M2M twice because from one model I wanted it to appear as a simple M2M that works with filter_horizontal. In another I added a through field and show it in an inline. I…
Bufke
  • 3,195
  • 3
  • 28
  • 28
2
votes
2 answers

Django: Force table creation order on syncdb

I have a Profile model that is used to define a profile for a User from the auth application. Also, I have a signal that will create an empty profile each time a user is created. The problem is that, when starting from clean, the Profile table is…
Nicu Surdu
  • 8,172
  • 9
  • 68
  • 108
2
votes
4 answers

How *not* to run Django code on syncdb

I have some server startup code that is lying in the "models.py" of one of my Django apps. I need to run that code on server startup time. The problem is, that code issues a SQL query, which prevents me from running syncdb with psycopg2 (it breaks…
Attila O.
  • 15,659
  • 11
  • 54
  • 84
1 2
3
8 9