python - Django "App with label XYZ could not be found" -


i've gone through of various questions on this, none have fixed problem. i'm working on django project up-to-date versions of django, virtualenv, on windows 7 home computer python 2.7. project meant on heroku, doesn't work locally either.

basically, when trying run manage.py sqlall appname, returns following error tree:

traceback (most recent call last):   file "manage.py", line 10, in <module>     execute_from_command_line(sys.argv)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\__init__.py", line 443, in execute_from_command_line     utility.execute()   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\__init__.py", line 382, in execute     self.fetch_command(subcommand).run_from_argv(self.argv)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\commands\test.py", line 49, in run_from_argv     super(command, self).run_from_argv(argv)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\base.py", line 196, in run_from_argv     self.execute(*args, **options.__dict__)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\base.py", line 232, in execute     output = self.handle(*args, **options)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\commands\test.py", line 72, in handle     failures = test_runner.run_tests(test_labels)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\test\simple.py", line 380, in run_tests     suite = self.build_suite(test_labels, extra_tests)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\test\simple.py", line 263, in build_suite     app = get_app(label)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\db\models\loading.py", line 152, in get_app     raise improperlyconfigured("app label %s not found" % app_labe l) django.core.exceptions.improperlyconfigured: app label tryagain not b e found 

it won't recognize brand new, untouched app. example, if run manage.py startapp tryagain , add 'tryagain' installed_apps, still same error when trying manage.py test tryagain. way settings.py file differs normal 1 heroku, i've added following 2 lines:

import dj_database_url databases = {'default': dj_database_url.config(default='postgres://localhost')} 

any appreciated. i'm driving myself crazy here.

edit:

first, tried starting brand new django project brand new app, , still didn't work, though untouched.

since can't figure out settings relevant, i've provided entire settings.py module below troublesome project:

# django settings <problem> project.  debug = true template_debug = debug  admins = (     # ('your name', 'your_email@example.com'), )  managers = admins  ##databases = { ##    'default': { ##        'engine': 'django.db.backends.', # add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ##        'name': '',                      # or path database file if using sqlite3. ##        'user': '',                      # not used sqlite3. ##        'password': '',                  # not used sqlite3. ##        'host': '',                      # set empty string localhost. not used sqlite3. ##        'port': '',                      # set empty string default. not used sqlite3. ##    } ##}   # local time zone installation. choices can found here: # http://en.wikipedia.org/wiki/list_of_tz_zones_by_name # although not choices may available on operating systems. # on unix systems, value of none cause django use same # timezone operating system. # if running in windows environment must set same # system time zone. time_zone = 'america/chicago'  # language code installation. choices can found here: # http://www.i18nguy.com/unicode/language-identifiers.html language_code = 'en-us'  site_id = 1  # if set false, django make optimizations not # load internationalization machinery. use_i18n = true  # if set false, django not format dates, numbers , # calendars according current locale use_l10n = true  # absolute filesystem path directory hold user-uploaded files. # example: "/home/media/media.lawrence.com/media/" media_root = ''  # url handles media served media_root. make sure use # trailing slash. # examples: "http://media.lawrence.com/media/", "http://example.com/media/" media_url = ''  # absolute path directory static files should collected to. # don't put in directory yourself; store static files # in apps' "static/" subdirectories , in staticfiles_dirs. # example: "/home/media/media.lawrence.com/static/" static_root = ''  # url prefix static files. # example: "http://media.lawrence.com/static/" static_url = '/static/'  # url prefix admin static files -- css, javascript , images. # make sure use trailing slash. # examples: "http://foo.com/static/admin/", "/static/admin/". admin_media_prefix = '/static/admin/'  # additional locations of static files staticfiles_dirs = (     # put strings here, "/home/html/static" or "c:/www/django/static".     # use forward slashes, on windows.     # don't forget use absolute paths, not relative paths. )  # list of finder classes know how find static files in # various locations. staticfiles_finders = (     'django.contrib.staticfiles.finders.filesystemfinder',     'django.contrib.staticfiles.finders.appdirectoriesfinder', #    'django.contrib.staticfiles.finders.defaultstoragefinder', )  # make unique, , don't share anybody. secret_key = ''  # list of callables know how import templates various sources. template_loaders = (     'django.template.loaders.filesystem.loader',     'django.template.loaders.app_directories.loader', #     'django.template.loaders.eggs.loader', )  middleware_classes = (     'django.middleware.common.commonmiddleware',     'django.contrib.sessions.middleware.sessionmiddleware',     'django.middleware.csrf.csrfviewmiddleware',     'django.contrib.auth.middleware.authenticationmiddleware',     'django.contrib.messages.middleware.messagemiddleware', )  root_urlconf = 'craigslist.urls'  template_dirs = (     # put strings here, "/home/html/django_templates" or "c:/www/django/templates".     # use forward slashes, on windows.     # don't forget use absolute paths, not relative paths. )  installed_apps = (     'django.contrib.auth',     'django.contrib.contenttypes',     'django.contrib.sessions',     'django.contrib.sites',     'django.contrib.messages',     'django.contrib.staticfiles',     #'kombu.transport.django',     #'djcelery',     '<problemappname>',     # uncomment next line enable admin:     # 'django.contrib.admin',     # uncomment next line enable admin documentation:     # 'django.contrib.admindocs', )  broker_backend = 'django'  # sample logging configuration. tangible logging # performed configuration send email # site admins on every http 500 error. # see http://docs.djangoproject.com/en/dev/topics/logging # more details on how customize logging configuration. logging = {     'version': 1,     'disable_existing_loggers': false,     'handlers': {         'mail_admins': {             'level': 'error',             'class': 'django.utils.log.adminemailhandler'         }     },     'loggers': {         'django.request': {             'handlers': ['mail_admins'],             'level': 'error',             'propagate': true,         },     } }   import dj_database_url databases = {'default': dj_database_url.config(default='postgres://localhost')}  # note becomes following: # databases = {'default': {'engine': 'django.db.backends.postgresql_psycopg2',  #                           'name': '', #                           'host': 'localhost', #                           'user': none, #                           'password': none, #                           'port':  none } } 

additional edit: directory structure can seen below, comments in parentheses.

 - craigslist (project)      - craigslist          - __init__.py          - settings.py          - urls.py          - wsgi.py      - venv (virtualenv)          - include (directory)          - lib (directory)          - scripts (directory)      - webpage (app)          - __init__.py          - models.py          - tests.py          - views.py      - __init__.py      - listings.py (custom module, not touched yet)      - manage.py      - requirements.txt      - settings.py      - urls.py 

third edit: thought might helpful when run manage.py syncdb, following error instead:

traceback (most recent call last):   file "manage.py", line 10, in <module>     execute_from_command_line(sys.argv)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\__init__.py", line 443, in execute_from_command_line     utility.execute()   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\__init__.py", line 382, in execute     self.fetch_command(subcommand).run_from_argv(self.argv)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\base.py", line 196, in run_from_argv     self.execute(*args, **options.__dict__)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\base.py", line 232, in execute     output = self.handle(*args, **options)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\base.py", line 371, in handle     return self.handle_noargs(**options)   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\core\management\commands\syncdb.py", line 57, in handle_noargs     cursor = connection.cursor()   file "c:\users\jj\documents\coding fun\craigslist\venv\lib\site-packages\djang o\db\backends\dummy\base.py", line 15, in complain     raise improperlyconfigured("settings.databases improperly configured. " django.core.exceptions.improperlyconfigured: settings.databases improperly co nfigured. please supply engine value. check settings documentation more details. 

yet edit: requested, here models.py.

# models.py  django.db import models  # create models here.  class listing(models.model):     body = models.charfield(max_length=10000)     title = models.charfield(max_length=400)     url = models.urlfield(primary_key = true)     scraping_time = models.datetimefield()     phone = models.charfield(max_length=20)     posting_time = models.datetimefield()     email = models.emailfield()     # imglist separate model      def __str__(self):         return self.title  class imagelist(models.model):     listing = models.foreignkey(listing)     img_url = models.urlfield()      def __str__(self):         return self.img_url 

after headache, figured out.

for reason, there 2 settings.pys--one in overall project directory craigslist, , 1 in subdirectory craigslist\craigslist, , editing top-level settings.py, , should have been editing lower one. have no idea why is, after copying on code top-level sub-level one, manage.py sqlall webpage worked.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -