This project has moved and is read-only. For the latest updates, please go here.


Django Sync DB needs to be executed twice


Create new django project (starter)
Install django if needed
Right click on project node, Python->Django Sync DB...

Look at the Django Management Console, it's not doing the sync:
Python interactive window. Type $help for a list of commands.
Executing syncdb
Execute the command again, and now it works:
Python interactive window. Type $help for a list of commands.
Executing syncdb
Executing syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): 
This is pretty consistent.
Closed Aug 22, 2014 at 5:57 PM by huguesv
This appears to work all the time now.


huguesv wrote Jun 9, 2014 at 11:37 PM

I see this in the output window on the first click of sync db command:
An error occurred while running resource:Microsoft.PythonTools.Django;Microsoft.PythonTools.Django.Resources;SyncDbLabel.

Microsoft.PythonTools.Repl.BasePythonReplEvaluator+CommandProcessorThread+DisconnectedException: The interactive window has become disconnected from the remote process. Please reset the window.
   at Microsoft.PythonTools.Repl.BasePythonReplEvaluator.CommandProcessorThread.ThrowIfDisconnected()
   at Microsoft.PythonTools.Repl.BasePythonReplEvaluator.CommandProcessorThread.ExecuteFile(String filename, String extraArgs, String fileType)
   at Microsoft.PythonTools.Repl.BasePythonReplEvaluator.ExecuteFile(String filename, String extraArgs)
   at Microsoft.PythonTools.Project.CustomCommand.<RunInRepl>d__29.MoveNext()

huguesv wrote Jun 9, 2014 at 11:38 PM

If it's just due to the missing resource, then we should fix for beta 2. This is in our readme, so users will hit this issue.