Hello,
I was using django 1.3 and python 2.4 for a big scale project. I decided to update it to django 1.9 and python 2.7.
Since django_admin's sql parameter is depreciated in 1.9, the update database creation method changed a lot.
I am using the command:
"python /usr/local/django/<project>/manage.py makemigrations"
"python /usr/local/django/<project>/manage.py migrate --fake-initial --noinput --run-syncdb "
for table creation. But my tables are not created and manage is printing this error in both commands.
Traceback (most recent call last):File "/src/project/project-export/django/projectadmin/manage.py", line 13, in <module>execute_from_command_line(sys.argv)File "/opt/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utilityutility.execute()File "/opt/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in executeself.fetch_command(subcommand).run_from_argv(self.argv)File "/opt/python/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argvself.execute(*args, **cmd_options)File "/opt/python/lib/python2.7/site-packages/django/core/management/base.py", line 398, in executeself.check()File "/opt/python/lib/python2.7/site-packages/django/core/management/base.py", line 426, in check include_deployment_checksinclude_deployment_checks=include_deployment_checks,File "/opt/python/lib/python2.7/site-packages/django/core/checks/registry.py", line 75, in run_checks new_errorsnew_errors = check(app_configs=app_configs)File "/opt/python/lib/python2.7/site-packages/django/core/checks/urls.py", line 13, in check_url_configreturn check_resolver(resolver)File "/opt/python/lib/python2.7/site-packages/django/core/checks/urls.py", line 23, in check_resolverfor pattern in resolver.url_patterns:File "/opt/python/lib/python2.7/site-packages/django/utils/functional.py", line 33, in __get__ resres = instance.__dict__[self.name] = self.func(instance)File "/opt/python/lib/python2.7/site-packages/django/core/urlresolvers.py", line 417, in url_patterns patternspatterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)File "/opt/python/lib/python2.7/site-packages/django/utils/functional.py", line 33, in __get__ resres = instance.__dict__[self.name] = self.func(instance)File "/opt/python/lib/python2.7/site-packages/django/core/urlresolvers.py", line 410, in urlconf_modulereturn import_module(self.urlconf_name)File "/opt/python/lib/python2.7/importlib/__init__.py", line 37, in import_module __import____import__(name)File "/usr/local/django/projectadmin/projectadmin/urls.py", line 4, in <module>import projectadmin.viewsFile "/usr/local/django/projectadmin/projectadmin/views.py", line 20, in <module>from projectadmin.forms import UserCreationFormFile "/usr/local/django/projectadmin/projectadmin/forms.py", line 252, in <module>class UserCreationForm(forms.ModelForm):File "/usr/local/django/projectadmin/projectadmin/forms.py", line 256, in UserCreationFormtemplate_choice = form_utils.create_template_choices_field()File "/usr/local/django/projectadmin/projectadmin/form_utils.py", line 15, in create_template_choices_field choiceschoices = [(x.id, x.template_name) for x in all_templates]File "/opt/python/lib/python2.7/site-packages/django/db/models/query.py", line 258, in __iter__self._fetch_all()File "/opt/python/lib/python2.7/site-packages/django/db/models/query.py", line 1074, in _fetch_allself._result_cache = list(self.iterator())File "/opt/python/lib/python2.7/site-packages/django/db/models/query.py", line 52, in __iter__ resultsresults = compiler.execute_sql()File "/opt/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 848, in execute_sql cursorcursor.execute(sql, params)File "/opt/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in executereturn self.cursor.execute(sql, params)File "/opt/python/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__ sixsix.reraise(dj_exc_type, dj_exc_value, traceback)File "/opt/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in executereturn self.cursor.execute(sql, params)File "/opt/python/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 112, in executereturn self.cursor.execute(query, args)File "/opt/python/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in executeself.errorhandler(self, exc, value)File "/opt/python/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandlerraise errorclass, errorvalue djangodjango.db.utils.ProgrammingError: (1146, "Table 'project.projectadmin_usertemplate' doesn't exist")There is nothing related with table creation in the error or in any logs. It complains about missing the table but does not create it.
I am suspecting that
INSTALLED_APPSdoes not include my tables even I am sure it includes my projectadmin, but I have appended my application to the list in mysettings.py. I got suspicious that I need to add my application separately to theinstalled_appslist.I have followed recommended procedure by django itself while updating the system.
If my suspicions are true how could I add models to installed apps or any other suggestion would be great?Thanks in advanceYalin Aksoy
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c6059f27-6ae6-4e0b-9af2-859317512786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment