I install pydev and checkout last version OSQA. I import OSQA in my pydev installation and create my settings_local.py file:
DATABASE_NAME = 'osqa_pg' # Or path to database file if using sqlite3. DATABASE_USER = 'osqa_pg' # Not used with sqlite3. DATABASE_PASSWORD = 'osqa_pg' # Not used with sqlite3. DATABASE_ENGINE = 'postgresql_psycopg2' #mysql, etc DATABASE_HOST = '127.0.0.1' DATABASE_PORT = ''
When I execute Django > Syn DB (manage.py syncdb) It returns with an error: E
rror: One or more models did not validate: forum.action: 'node' has a relation with model Node, which has either not been installed or is abstract. forum.user: 'subscriptions' has an m2m relation with model Node, which has either not been installed or is abstract. Finished "/home/gse/quasutra/workspace/osqa/manage.py syncdb" execution.
Any idea to help me to eliminate this error?
Answer by rick , Husband, father, coffee addict, dork · May 09, 2010 at 09:26 AM
Guillaume, this will be something we can probably help with more easily in the OSQA online chat. Feel free to lurk/idle in the chatroom until one of us becomes available, and we'll do what we can to try to figure this out with you.
One thing that occurs to me is that there was an old
.project file in the repo from when I initially tried using PyDev myself. I have long since switched to IntelliJ IDEA with its Python plugin, so that original Eclipse project probably has some obsolete dependencies, bad source directory references, or worse. It might be better to start from scratch if you were trying to use that one. I'll fire up Eclipse and take a peek.
Answer by rick , Husband, father, coffee addict, dork · May 09, 2010 at 12:53 PM
I just grabbed the latest PyDev from Aptana and made a new project with the latest SVN sources. It appears that one of the changes in the most recent PyDev is improved Django support and it made the whole thing a little easier.
Make sure you Python interpreter is properly configured with access to all your required libs/eggs, set up your settings_local.py, and then use the "Django -> Custom command" form the project context menu (I just right-click the project and select it.)
"syncdb --all" and run it. Then do it again and enter
"migrate forum --fake" to get the South migrations up to the current schema level, and you should be off to the races.
PS - I checked in updated
.pydevproject files from my working local copy. Maybe they will help.
Answer by rich seller · May 09, 2010 at 05:47 PM
I had the same issue as you running syncdb from the commandline. I found that if I checked out revision 155, then ran
migrate I could set up the database. I then checked out the latest revision and ran
migrate again. I'm sure this isn't the ideal approach, but it seems to work...
To do this I ran the following commands.
Check out the 155 revision:
svn co http://svn.osqa.net/svnroot/osqa/trunk -r 155 c:\osqa\source
Configure database for 155 revision:
python c:\osqa\source\manage.py syncdb --all python c:\osqa\source\manage.py migrate --all
Update to latest revision:
svn update c:\osqa\source
Migrate database to latest revision:
python c:\osqa\source\manage.py migrate --all
About upgrading database schema 1 Answer
Module db table not created 1 Answer