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
1
vote
3 answers

syncdb ignores imported models

I have a project, structured like this: project/ __init__.py db/ models/ __init__.py article.py project.py ontology/ __init__.py coded.py It's a little bit bigger, but that's…
Martijn
  • 586
  • 5
  • 19
1
vote
1 answer

Django: app_label problem when declaring base models outside models.py

I have an abstract Container class which allows derived models to hold some content blocks such as images, text, etc., which are also separate models. For db tidiness, I want tables for those models to be labeled as content_block_image,…
onurmatik
  • 5,105
  • 7
  • 42
  • 67
1
vote
1 answer

Django - Running custom method on syndb command

I'm wondering if there is a way to run a custom method when syncdb is executed. What I am trying to accomplish is to load a mail template into the database. As I need nearly the same template in multiple entries in the db, I don't want to place it…
Grave_Jumper
  • 1,224
  • 2
  • 8
  • 11
1
vote
1 answer

Getting exception when run syncdb in Django

When I run python manage.py syncdb in my project, I get the following exception. Traceback (most recent call last): File "/home/dima/envs/koncertru/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute return…
Dima Kudosh
  • 7,126
  • 4
  • 36
  • 46
1
vote
2 answers

How to do django syncdb in version 1.4.2?

How to do syncdb in django 1.4.2? i.e. having data in database, how to load the models again when the data schema is updated? Thanks in advance
cck
  • 502
  • 4
  • 17
1
vote
1 answer

Django superuser fixture error - no such table: auth_user

I want to define a fixed username and password for superuser creation in Django's syncdb (after it has been executed). The method I'm using below was working in an older version of Django (I guess 1.6) but now it's not working. I have this fixture…
jeff
  • 13,055
  • 29
  • 78
  • 136
1
vote
3 answers

Select rows before date in sqlite

How can I with sql select only those rows where date is before a specific date? I use sqlite3, I manage my database with Django's syncdb, and my date field is created with date = DateField().
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
1
vote
1 answer

Installing a Stored Procedure or Function with Django syncdb

I general I know how to execute custom SQL on syncdb. I'm using Django 1.7 which has migrate, but due to some special fields my app is not yet ready for it, so Django falls back to syncdb. At least now it is using sqlparse in order to properly split…
Tim
  • 1,315
  • 1
  • 14
  • 35
1
vote
1 answer

Django manage.py syncdb unfinishing

EDIT: changed question title - before it was about incomplete startup package in Postgres but Craig found out it is not db issue i have django app and setup script for it. Among others script ensures that postgresql is installed and perform…
4rlekin
  • 748
  • 5
  • 16
1
vote
1 answer

Django custom User shoots an import issue at runtime when syncing db

I have a custom User model defined in app.models. It is also correctly defined in the AUTH_USER_MODEL setting as app.User. When I run the site, everything works perfectly. However, when I run ./manage.py syncdb --migrate it breaks with the following…
1
vote
1 answer

django settings.py syncdb ("Can't connect to MySQL server on (111)")

I have some sipmlest settings with two servers. On first(192.168.250.199) I have django, and on another(192.168.250.200) i have a mysql server 192.168.250.200:/etc/my.cnf [mysqld] #Base settings for…
ivakon
  • 25
  • 1
  • 4
1
vote
1 answer

Django is doing something weird with my DATABASES settings

I want to switch db backends from django_pyodbc to sqlite in order to make sure my custom user model works before I start messing around with my db. So I commented out the DATABASES setting and put in a new one which uses sqlite. I've done this…
moarCoffee
  • 1,289
  • 1
  • 14
  • 26
1
vote
1 answer

Trying to run syncdb in the django tutorial and getting error

~/Documents/django1/mysite$ python manage.py syncdb Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File…
nicklocicero
  • 106
  • 3
  • 8
1
vote
1 answer

problems: python manage.py syncdb in windows 7 with mysql

I am using python django with mysql.I am following all the rules given in the tutorial but still then um getting error.Problem specification is given below. my database setting in setting.py is like this DATABASES = { 'default': { …
Akhter Al Amin
  • 852
  • 1
  • 11
  • 25
1
vote
2 answers

openshift-django : syncdb, deploy script not running

Is there any way by which I can run syncdb from my terminal? I don't know why my action_hooks/deploy script is not running. When I open my openshift database it show no table created. source ${OPENSHIFT_HOMEDIR}python-2.6/virtenv/bin/activate export…
Sarvesh Gupta
  • 59
  • 1
  • 9
1 2 3
8 9