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

Django creating a DateTimeField(auto_now_add) on a populated table

I decided to add a created = Models.DateTimeField(auto_now_add = True) field to a model which already has objects instantiated (without created field of course), and I saved them as initial_data So now when I run syncdb, I get the error…
jeff
  • 13,055
  • 29
  • 78
  • 136
2
votes
1 answer

Django update models.py when database changes

I know this might be a sill question but I've been half an hour trying to figure this out and couldn't find anything :S I have a django app and I significantly changed my database tables. I want to update my models.py file, but I tried the following…
Danidestroyer
  • 87
  • 1
  • 7
2
votes
2 answers

Django doesn't detect the model I try to create

I'm beginning (again) with django (1.7.5). I've created : a project named "hypnose". an app named "main". a model named "Article". a superuser. I've done enough code to make my application work, I can open the admin pannel, navigate through…
vmonteco
  • 14,136
  • 15
  • 55
  • 86
2
votes
1 answer

Can't get python.manage.py syncdb to work

I just created my first django app, initialized variables DATABASE_ENGINE and DATABASE_NAME in settings.py, but now when I run python manage.py syncdb, I get the following error Can somebody help? Does this have to do with having two python versions…
Diego
  • 795
  • 2
  • 13
  • 17
2
votes
1 answer

Django User(AbstractUser) contains foreign key

I'm trying to figure out how to handle this situation in which my user class (which extends AbstractUser) contains a foreign key to another object. For example, Class Store(models.Model): #attributes Class Employee(AbstractUser): store =…
Anthony F.
  • 545
  • 1
  • 5
  • 20
2
votes
1 answer

python manage.py syncdb not working

C:\Users\acc\Desktop\coding>python manage.py syncdb Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "C:\Python27\lib\site-packages\django\core\management__init__.py", line 399, in…
user3500741
  • 61
  • 2
  • 8
2
votes
1 answer

How to clean Django database after install and uninstall packages?

I just learned that I should be more careful after installing any package in Django. This is I should dump my database (or simply copy the the database file) before migrating or syncdb it when I install a new plugin. Now, it is to late. I have…
toto_tico
  • 17,977
  • 9
  • 97
  • 116
2
votes
1 answer

Can someone help clarify my confusion about syncdb and import loops, 'Do you have to be explicit on imports?'

I have been having a difficult time building the database with syncdb on Python2.5. I think that some of this issue is because of the use of wildcard* for importing forum.models it seems to be creating a loop. >>> import settings >>> from…
BryanWheelock
  • 12,146
  • 18
  • 64
  • 109
2
votes
2 answers

Heroku run command throws timeout await

Whenever I run heroku run python manage.py syncdb or heroku run python manage.py shell it console "Timeout await process", I have even tried telnet rendezvous.heroku.com 5000 it console Trying 50.19.103.36... telnet: Unable to connect to remote…
Sarvesh Gupta
  • 59
  • 1
  • 9
2
votes
2 answers

Initializing after first superuser is created

I want to know if there are any specific signals sent when the first superuser is created. Am talking about when I run syncdb and am asked to create a super user. At that point I want to know if any signals are sent so that I can Use the signal to…
flexxxit
  • 2,440
  • 5
  • 42
  • 69
2
votes
2 answers

How to load initial_data (fixture) after migration and not after syncdb?

I have a bootstrap script that performs syncdb and migrate: import settings from django.core.management import setup_environ, call_command setup_environ(settings) # Setting up the env…
Yugal Jindle
  • 44,057
  • 43
  • 129
  • 197
1
vote
1 answer

Django not creating tables for an installed app

My django site was functioning before I installed Lion and had to reinstall everything related to development. Since then, I have deleted and recreated my database, but one of my two installed apps is being ignored in syncdb. Those tables are not…
JazzTpt
  • 93
  • 8
1
vote
2 answers

Keep code from running during syncdb

I have some code that throws causes syncdb to throw an error (because it tries to access the model before the tables are created). Is there a way to keep the code from running on syncdb? something like: if not syncdb: run_some_code() Thanks…
Jiaaro
  • 74,485
  • 42
  • 169
  • 190
1
vote
1 answer

Proper way to update model in Django

I keep modifying my model in Django. However after I do it I have to go into the database, delete the table manually and then manage.py syncdb. I tried manage.py reset <> but it doesn't drop then reinstall the model with the new fields. …
Alexis
  • 23,545
  • 19
  • 104
  • 143
1
vote
2 answers

How can I drop the tables and syncdb for just one app in my Django project?

I have a Django app deployed on DjangoZoom. People have been signing up, so there are users in that database. I want to restructure the database of one of my apps within the project. My plan was to drop all the tables then do syncdb to establish the…
1 2 3
8 9