Hello; I have being having issues trying to use django orm in my application. This issues occur when using django 1.85. The application run perfectly well on django 1.50. Bellow are the snippet :
Model.py: from django.db import models class Person(models.Model): name = models.CharField(max_length=100) email = models.CharField(max_length=100) birthdate = models.DateField() class Meta: app_label = 'runnable' def __unicode__(self): return u'%d: %s' % (self.id, self.name) app.py: import sys from os import path import collections import datetime sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..'))) from django.core.management import call_command from django.conf import settings #print(sys.path) if not settings.configured: settings.configure( DEBUG=True, DATABASES={ 'default': { # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.sqlite3', # Or path to database file if using sqlite3. 'NAME': ':memory:', } }, INSTALLED_APPS=("runnable", ) ) import django django.setup() #call_command('syncdb') call_command('makemigrations') call_command('migrate') call_command('inspectdb') from models import Person print("PERSON: "+ Person) Console msg: p.py", line 28, in <module> django.setup() File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/data/data/com.hipipal.qpy3/files/lib/python3.2/python32.zip/importlib/__init__.py", line 124, in import_module Note: The application run successfully with django 1.50 by uncomment syncdb and comment out migration, make migrations. Thanks. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMGzuy9BSMrgqw8uMgp3kd9eBu5fTdF4DCB9%3Di-8r6EmZmN-WA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.