I searched google and this forum and I found this solution
sth=os.path.abspath('/home/artur/Desktop')
sys.path.append(sth)
os.environ['DJANGO_SETTINGS_MODULE'] = 'project_name.settings'
Everything seems to be fine, even my editor supports import statement support. And when I try to import my models, I get this
Traceback (most recent call last):
File "email.py", line 12, in <module>
from app_name.models import *
File "app models models.py", line 1, in <module>
from django.db import models
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/__init__.py", line 5, in <module>
from django.db.models.query import Q
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/query.py", line 9, in <module>
from django.db.models.fields import DateField
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/fields/__init__.py", line 14, in <module>
from django import forms
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/forms/__init__.py", line 14, in <module>
from widgets import *
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/forms/widgets.py", line 9, in <module>
from django.utils.html import escape, conditional_escape
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/utils/html.py", line 9, in <module>
from django.utils.http import urlquote
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/utils/http.py", line 4, in <module>
from email.Utils import formatdate
ImportError: No module named Utils
I'm trying google about this but can't find anything to help solve this problem (found a similar way to add django settings file, but all failed with the same error). My OS is testing Debian and python 2.6.6. Thanks for any help or sugestions.
source
share