0

I'm trying to practise deploying a django application that is being developed. i've updated it to work with django 1.3, and everything works in debug mode. as soon as i switch DEBUG in settings to False, the server returns the fault below.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at 192.168.1.220 Port 80

I personally don't want to be using apache, but it's being insisted upon me. anyone able to point me towards what it could be?

Traceback (most recent call last):

File "/home/fakeco/django1.3/django/core/handlers/base.py", line 89, in get_response
    response = middleware_method(request)

File "/home/fakeco/django1.3/django/middleware/common.py", line 67, in process_request
    if (not _is_valid_path(request.path_info, urlconf) and

File "/home/fakeco/django1.3/django/middleware/common.py", line 154, in _is_valid_path
    urlresolvers.resolve(path, urlconf)

File "/home/fakeco/django1.3/django/core/urlresolvers.py", line 342, in resolve
    return get_resolver(urlconf).resolve(path)

File "/home/fakeco/django1.3/django/core/urlresolvers.py", line 250, in resolve
    for pattern in self.url_patterns:

File "/home/fakeco/django1.3/django/core/urlresolvers.py", line 279, in _get_url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/home/fakeco/django1.3/django/core/urlresolvers.py", line 274, in _get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)

File "/home/fakeco/django1.3/django/utils/importlib.py", line 35, in import_module
    __import__(name)

File "/home/fakeco/domains/fakeco-directory.co.uk/fakecodirectory/urls.py", line 3, in <module>
    admin.autodiscover()

File "/home/fakeco/django1.3/django/contrib/admin/__init__.py", line 26, in autodiscover
    import_module('%s.admin' % app)

File "/home/fakeco/django1.3/django/utils/importlib.py", line 35, in import_module
    __import__(name)

File "/home/fakeco/domains/fakeco-directory.co.uk/fakecodirectory/contacts/admin.py", line 2, in <module>
    import fakecodirectory.contacts.models as models

File "/home/fakeco/domains/fakeco-directory.co.uk/fakecodirectory/contacts/models.py", line 3, in <module>
    from fakecodirectory.generic.models import Country, Title

File "/home/fakeco/domains/fakeco-directory.co.uk/fakecodirectory/generic/models.py", line 9, in <module>
    from fakecodirectory.contacts.models import Manufacturer

ImportError: cannot import name Manufacturer

1 Answer 1

3

Make sure you have:

  1. Created a 500.html template
  2. Added your email address to the ADMINS setting so that you are emailed the traceback.
  3. Look in the apache error logs to see if there is any useful information there. For Ubuntu, look in /var/log/apache2/
Sign up to request clarification or add additional context in comments.

3 Comments

I have made the 500.html template, but thanks for the tip on the email setting, not sure how i test if the box can send emails though
I have the error now: ImportError: cannot import name Manufacturer
It looks like a circular import. Your generic app is importing from the contacts app, and vice versa. If you are importing to create foreign keys, then refer to the model as a string and remove the imports. See the foreign key docs for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.