PyDev's inteactive shell with Django problem - django

I'm going through Django tutorial and using PyDev Eclipse plugin for development.
For interactive testing I use "Interactive shell with Django" which is accessed by Right click on PyDev project -> Django -> Shell with Django environment.
And here is the problem I encountered ("lemonanas" is my project name, "polls" is my app name):
>>from lemonanas.polls.models import Poll, Choice
>>Poll.objects.filter(id=1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "F:\Python27\lib\site-packages\django\db\models\manager.py", line 141, in filter
return self.get_query_set().filter(*args, **kwargs)
File "F:\Python27\lib\site-packages\django\db\models\query.py", line 561, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "F:\Python27\lib\site-packages\django\db\models\query.py", line 579, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "F:\Python27\lib\site-packages\django\db\models\sql\query.py", line 1170, in add_q
can_reuse=used_aliases, force_having=force_having)
File "F:\Python27\lib\site-packages\django\db\models\sql\query.py", line 1058, in add_filter
negate=negate, process_extras=process_extras)
File "F:\Python27\lib\site-packages\django\db\models\sql\query.py", line 1225, in setup_joins
field, model, direct, m2m = opts.get_field_by_name(name)
File "F:\Python27\lib\site-packages\django\db\models\options.py", line 296, in get_field_by_name
cache = self.init_name_map()
File "F:\Python27\lib\site-packages\django\db\models\options.py", line 326, in init_name_map
for f, model in self.get_all_related_m2m_objects_with_model():
File "F:\Python27\lib\site-packages\django\db\models\options.py", line 401, in get_all_related_m2m_objects_with_model
cache = self._fill_related_many_to_many_cache()
File "F:\Python27\lib\site-packages\django\db\models\options.py", line 415, in _fill_related_many_to_many_cache
for klass in get_models():
File "F:\Python27\lib\site-packages\django\db\models\loading.py", line 167, in get_models
self._populate()
File "F:\Python27\lib\site-packages\django\db\models\loading.py", line 61, in _populate
self.load_app(app_name, True)
File "F:\Python27\lib\site-packages\django\db\models\loading.py", line 76, in load_app
app_module = import_module(app_name)
File "F:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
ImportError: No module named polls
If I use default shell, executing "manage.py shell" - all works fine. But default shell not such comfortable as "Interactive shell with Django".
I noticed that "Interactive shell with Django" does not add my app folder (polls) to python path. And I guess this is the essense of problem. But don't know how to entirely solve all "import/pythonpath/etc." problems with "Interactive shell with Django".
Hope you can help me.
Thanks.

Customize the python path, eclipse uses to include the path to the project. (Not each app, just the project folder. - The one that contains settings.py)

In Eclipse, right click your project, goto PyDev-> Set as source folder

Related

Neo4Django - KeyError: 'GremlinPlugin' error while creating an object

I'm trying to learn to work with Neo4jdatabase in my django projects. I installed Neo4Django from github repository. and following its neo4j tutorial when I try to create a new object from my model I encounter with this error:
KeyError: 'GremlinPlugin'
I'm using Python 2.7, Django Version 1.5.8, Pycharm 3
My model is:
class Movie(models.NodeModel):
# name of the movie
title = models.StringProperty()
and my console code for creating the object is:
from nodes_app.models import Movie
movie = Movie.objects.create(title='a')
and this is the console output for the error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\manager.py", line 43, in create
return self.get_query_set().create(**kwargs)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\query.py", line 1307, in create
return super(NodeQuerySet, self).create(**kwargs)
File "C:\Python27\lib\site-packages\django-1.5.8-py2.7.egg\django\db\models\query.py", line 416, in create
obj.save(force_insert=True, using=self.db)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 325, in save
return super(NodeModel, self).save(using=using, **kwargs)
File "C:\Python27\lib\site-packages\django-1.5.8-py2.7.egg\django\db\models\base.py", line 546, in save
force_update=force_update, update_fields=update_fields)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 341, in save_base
self._save_neo4j_node(using)
File "<string>", line 2, in _save_neo4j_node
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 98, in trans_method
ret = func(*args, **kw)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\db\models\base.py", line 369, in _save_neo4j_node
typesToIndex=type_names_to_index)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\neo4jclient.py", line 179, in gremlin_tx
return self.gremlin(script, tx=True, **params)
File "C:\Python27\lib\site-packages\neo4django-0.1.8-py2.7.egg\neo4django\neo4jclient.py", line 127, in gremlin
ext = self.extensions.GremlinPlugin
File "C:\Python27\lib\site-packages\neo4jrestclient\client.py", line 2176, in __getattr__
self._dict[attr] = ExtensionModule(self._extensions[attr], self._auth)
KeyError: 'GremlinPlugin'
It seems that the Neo4j Django driver depends on the Gremlin plugin on the Neo4j server. Starting with Neo4j 2.0, Gremlin has been removed from the distribution but is still available as a contribution package, see the instructions there.

Django runserver command not working

I'm trying to setup a local django installation, but am facing a lot of problems in configuring it properly.
Trying to start the server doesn't work:
admins-macbook:myproject Admin$ python manage.py runserver 8080
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 8, in <module>
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 26, in <module>
from django.views import static
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/views/static.py", line 95, in <module>
template_translatable = ugettext_noop(u"Index of %(directory)s")
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
return _trans.gettext_noop(message)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
if settings.USE_I18N:
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/Users/Admin/myapp/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings '{{ project_name }}.settings' (Is it on sys.path?): No module named {{ project_name }}.settings
I have mainly been following the directions here.
I am completely lost about what I may be doing wrong. I googled and found some people saying that either this could be because of naming conflicts between the project name or trying to use two installations simultaneously. I changed the name of my project, and checked to see that I only have one django installation, but still am facing the same problem. Can anyone help? Thanks for any ideas!
EDIT: Checking the paths
admins-macbook:Downloads Admin$ echo $PATH
/Users/Admin/myapp/lib/python2.7/site-packages/django/conf/myproject:/Users/Admin/myapp/lib/python2.7/site-packages/django/conf:/Users/Admin/myapp/lib/python2.7/site-packages/django:/Users/Admin/myapp/lib/python2.7/site-packages:/Users/Admin/myapp/lib/python2.7:/Users/Admin/myapp/lib:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
EDIT: Adding the directory structure (did not change, straight from django 1.4.2):
-bin
-contrib
-core
-(etc.)
-django
--conf
---__init__
---app_template
---urls
---myproject
----myapp
-----settings.py
-----urls.py
-----(etc.)
----manage.py
When manage.py is first created it includes a code that adds the path to the project's settings.py to the python path whenever a command (such as run server) is run. Since you changed the names of the folders, manage.py can't find the settings anymore.
Open up manage.py and change the old project name there to the new one. There are other places where this problem might show up so keep an eye for references to your old project's name that would cause trouble

adding admin interface to existing pyramid app

I'm trying to add a nice admin interface to an existing Pyramid project. I created a test project using pcreate -s alchemy -s pyramid_fa fa_test and then copied all the extra files created into my project and altered them to be suitable.
Everything looks to be good and dandy until I try to add a formalchemy route:
config.formalchemy_model("/foo", package='bar',
model='bar.models.specific_models.Thingy',
**settings)
Then I get: ImportError: No module named forms
My question is: How do I fix this? Or what is the correct way to add an admin interface?
I've googled around a bunch to no avail...
Here's relevant code:
fainit.py:
from bar import models, faforms
import logging
def includeme(config):
config.include('pyramid_formalchemy')
config.include('bar.fainit')
config.include('fa.jquery')
config.include('pyramid_fanstatic')
model_view = 'fa.jquery.pyramid.ModelView'
session_factory = 'bar.models.access.DBSession'
## register session and model_view for later use
settings = {'package': 'bar',
'view': model_view,
'session_factory': session_factory,
}
config.registry.settings['bar.fa_config'] = settings
config.formalchemy_admin("/admin", models=models, forms=faforms,
**settings)
# Adding the package specific routes
config.include('shop.faroutes')
log.info('formalchemy_admin registered at /admin')
faroutes.py
from bar import models
import logging
log = logging.getLogger(__name__)
def includeme(config):
settings = config.registry.settings.get('shop.fa_settings}}', {})
config.formalchemy_model("/alerts", package='shop',
model='shop.models.super_models.Alert',
**settings)
log.info('shop.faroutes loaded')
And the traceback:
Starting subprocess with file monitor
Traceback (most recent call last):
File "../bin/pserve", line 9, in <module>
load_entry_point('pyramid==1.5a1', 'console_scripts', 'pserve')()
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/scripts/pserve.py", line 51, in main
return command.run()
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/scripts/pserve.py", line 316, in run
global_conf=vars)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/scripts/pserve.py", line 340, in loadapp
return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/home/sheena/WORK/tv_guys_env/shop/shop/__init__.py", line 30, in main
includeme(config)
File "/home/sheena/WORK/tv_guys_env/shop/shop/fainit.py", line 8, in includeme
config.include('shop.fainit')
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/config/__init__.py", line 778, in include
c(configurator)
File "/home/sheena/WORK/tv_guys_env/shop/shop/fainit.py", line 24, in includeme
config.include('shop.faroutes')
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/config/__init__.py", line 778, in include
c(configurator)
File "/home/sheena/WORK/tv_guys_env/shop/shop/faroutes.py", line 12, in includeme
**settings)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/util.py", line 507, in wrapper
result = wrapped(self, *arg, **kw)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid_formalchemy-0.4.4-py2.7.egg/pyramid_formalchemy/__init__.py", line 58, in formalchemy_model
view=view, models=[model], model=model, **kwargs)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid_formalchemy-0.4.4-py2.7.egg/pyramid_formalchemy/__init__.py", line 85, in formalchemy_admin
forms = config.maybe_dotted('%s.forms' % package)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/config/__init__.py", line 848, in maybe_dotted
return self.name_resolver.maybe_resolve(dotted)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/path.py", line 316, in maybe_resolve
return self._resolve(dotted, package)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/path.py", line 323, in _resolve
return self._zope_dottedname_style(dotted, package)
File "/home/sheena/WORK/tv_guys_env/local/lib/python2.7/site-packages/pyramid-1.5a1-py2.7.egg/pyramid/path.py", line 372, in _zope_dottedname_style
__import__(used)
ImportError: No module named forms
It sounds like it's looking for you to create a forms module at shop.faroutes.forms.

ImportError being generated when trying to run django-celery worker process

I'm trying to integrate django-celery into an existing site and I'm coming up against an error that I can't seem to get fixed.
For context, I went through the Django first steps and the test project was successful, ie everything worked as it should.
Now, in my existing project, I can't get the celery worker running from the command line:
manage.py celery worker --loglevel=info --settings=myproject.settings.dev_settings
When i run that I get the following stack trace and error:
Traceback (most recent call last):
File "C:\sites\corecrm\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 453, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\djcelery\management\commands\celery.py", line 22, in run_from_argv
['%s %s' % (argv[0], argv[1])] + argv[2:],
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 901, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "C:\Python27\lib\site-packages\celery\bin\base.py", line 187, in execute_from_commandline
return self.handle_argv(prog_name, argv[1:])
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 893, in handle_argv
return self.execute(command, argv)
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 868, in execute
return cls(app=self.app).run_from_argv(self.prog_name, argv)
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 148, in run_from_argv
return self(*args, **options)
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 118, in __call__
ret = self.run(*args, **kwargs)
File "C:\Python27\lib\site-packages\celery\bin\celery.py", line 220, in run
return self.target.run(*args, **kwargs)
File "C:\Python27\lib\site-packages\celery\bin\celeryd.py", line 153, in run
return self.app.Worker(**kwargs).run()
File "C:\Python27\lib\site-packages\celery\apps\worker.py", line 162, in run
self.app.loader.init_worker()
File "C:\Python27\lib\site-packages\celery\loaders\base.py", line 130, in init_worker
self.import_default_modules()
File "C:\Python27\lib\site-packages\djcelery\loaders.py", line 138, in import_default_modules
self.autodiscover()
File "C:\Python27\lib\site-packages\djcelery\loaders.py", line 141, in autodiscover
self.task_modules.update(mod.__name__ for mod in autodiscover() or ())
File "C:\Python27\lib\site-packages\djcelery\loaders.py", line 176, in autodiscover
for app in settings.INSTALLED_APPS])
File "C:\Python27\lib\site-packages\djcelery\loaders.py", line 195, in find_related_module
return importlib.import_module('%s.%s' % (app, related_name))
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\sites\corecrm\people\tasks.py", line 15, in <module>
from people.models import Customer, CustomerCsvFile, CustomerToTag, get_customer_from_csv_row
File "C:\sites\corecrm\people\models.py", line 163, in <module>
UserProfile._meta.get_field_by_name('username')[0]._max_length = 75
File "C:\Python27\lib\site-packages\django\db\models\options.py", line 351, in get_field_by_name
cache = self.init_name_map()
File "C:\Python27\lib\site-packages\django\db\models\options.py", line 380, in init_name_map
for f, model in self.get_all_related_m2m_objects_with_model():
File "C:\Python27\lib\site-packages\django\db\models\options.py", line 469, in get_all_related_m2m_objects_with_model
cache = self._fill_related_many_to_many_cache()
File "C:\Python27\lib\site-packages\django\db\models\options.py", line 483, in _fill_related_many_to_many_cache
for klass in get_models(only_installed=False):
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 197, in get_models
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 75, in _populate
self.load_app(app_name)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "C:\sites\corecrm\booking\models.py", line 17, in <module>
from people.models import Customer, UserProfile
ImportError: cannot import name Customer
To try and work out what the booking/models.py script sees in people I added the following at the start:
import people
print 'path: %s' % people.__path__
for item in dir(people):
print item
and that gives me the following output:
path: ['C:\\sites\\corecrm\\people']
__builtins__
__doc__
__file__
__name__
__package__
__path__
path: ['C:\\sites\\corecrm\\people']
__builtins__
__doc__
__file__
__name__
__package__
__path__
however, when I run manage.py shell --settings=myproject.settings.dev_settings I get the following output:
path: ['C:\\sites\\corecrm\\people']
__builtins__
__doc__
__file__
__name__
__package__
__path__
path: ['C:\\sites\\corecrm\\people']
__builtins__
__doc__
__file__
__name__
__package__
__path__
models
As you can see the models module is available at the end of the 2nd list for the shell command (and I've confirmed this is also the case for manage.py commands other than celery). How would I make sure that module is available at the same point when I run the celery command?
EDIT: I've now also set up this project on an Ubuntu VM and I'm getting the same error when I try to run the worker manage command. Any ideas? Anyone?
ANOTHER EDIT: I've pasted the code for booking/models.py and people/models.py at http://pastebin.com/fTVVBtB4
I'm pretty sure this line is your problem:
File "C:\sites\corecrm\people\models.py", line 163, in <module>
UserProfile._meta.get_field_by_name('username')[0]._max_length = 75
While you're still busy importing from people.models, this line (in particular get_field_by_name) forces Django to evaluate the model and setup all relationships between that model and it's related models. This, in turn, forces an import of Customer in people.models, while you're still busy importing that exact model. This is what results in an ImportError.
For a working solution you'll need to post your models.py.
Why does this error only occur with celery? I can't say for sure without some more information, but my best guess is that Celery handles importing everything slightly different (Django probably doesn't import Customer, CustomerCsvFile, CustomerToTag and get_customer_from_csv_row all at once) and that this exposes the bug in your code.
EDIT/SOLUTION:
I would remove this line:
UserProfile._meta.get_field_by_name('username')[0]._max_length = 75
And move it to the instance level, into the __init__ method:
class UserProfile(AbstractUser):
def __init__(self, *args, **kwargs):
self._meta.get_field_by_name('username')[0]._max_length = 75
super(UserProfile, self).__init__(*args, **kwargs)
If the cause of the issue is indeed what I think it is, this will fix the circular import while providing the same functionality. If the max_length functionality gets broken somehow (most likely because internally a max_length validator is added to CharField and _max_length is changed too late) I would instead override the complete username field in the init method:
class UserProfile(AbstractUser):
def __init__(self, *args, **kwargs):
super(UserProfile, self).__init__(*args, **kwargs)
self._meta.get_field_by_name('username')[0] = models.CharField(max_length=75, etc.)

Why does Aptana 3 (OS X) not find the django settings module in an imported project?

I just started working on a aptana based django project from home. The project works nicely on my windows based machine at work, and partially works on my Mac at home.
When I run
python manage.py runserver
from command line, my django project works fine. However, when I try running it via the aptana debug/run interface, (setup the same way i setup the config at work), I get this message:
pydev debugger: starting
Traceback (most recent call last):
File "/Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydevd.py", line 1307, in
debugger.run(setup['file'], None, None)
File "/Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydevd.py", line 1060, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "/Users/michael/Documents/Aptana Studio 3 Workspace/video-encoder-interface/src/VideoEncoderInterface/manage.py", line 14, in
execute_manager(settings)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 8, in
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 26, in
from django.views import static
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/views/static.py", line 95, in
template_translatable = ugettext_noop(u"Index of %(directory)s")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/init.py", line 75, in gettext_noop
return _trans.gettext_noop(message)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/init.py", line 48, in getattr
if settings.USE_I18N:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/init.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/init.py", line 95, in init
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'video-encoder-interface.settings' (Is it on sys.path?): No module named video-encoder-interface.settings
One thing I have noticed that may be wrong (I don't know how to fix it either), the last line refers to video-encoder-interface.settings where as I think it should be looking for VideoEncoderInterface, as that is the name of the package (video-encoder-interface is just the directory name for the aptana project directory)
Probably your PYTHONPATH is not properly set inside Eclipse/PyDev... Or maybe the settings module is not correct (right click project > propertis > pydev - django: the django settings module should be properly set there).
If you're still not able to find it out, please post a screenshot of the pydev package explorer with your project configuration, and post the contents of your manage.py file.