0

I have a model which I'm keen to integrate to my open shift platform. The issue I'm having is that my view imports the model, but this causes a failure, but this should be pretty standard. I cannot see what the error from the log is - but I don't get any rendering of anything on screen, 500 error.

  1. rhc tail amycoolapp doesn't provide much guidance to error? Where can I find more errors the rhc tail simply shows the python.log - is there another log that I can use that contains more information?
  2. from django.db import models works when included in models.py which in turn is included in views.py.
  3. Including a class definition causes the failure ( class Test(models.Model): s="hello"). It seems the use of models.Model is an issue.
  4. My directory structure is such that models.py and views.py at at the same level in a directory under the app name.
  5. In settings.py we have: INSTALLED_APPS = ('amycoolapp',) which is the name of the app and the folder that views.py and models.py sits in.
  6. Managed to get some logging out: [Wed Jul 30 14:23:30 2014] [error] [client 127.8.250.1] ImportError: No module named 'amycoolapp'

I switched on logging so I get the following when I include the dummy model class in my views.py

IndexError at /
list index out of range
Request Method: GET
Request URL:    http://xxx.rhcloud.com/
Django Version: 1.6.5
Exception Type: IndexError
Exception Value:    
list index out of range
Exception Location: /var/lib/openshift/53b536da5004463b6e00022e/python/virtenv/venv/lib/python3.3/site-packages/Django-1.6.5-py3.3.egg/django/db/models/base.py in __new__, line 92
Python Executable:  /var/lib/openshift/53b536da5004463b6e00022e/python//virtenv/venv/bin/python3
Python Version: 3.3.2

Any suggestions? It fails with the addition of:

from django.db import models

class Test(models.Model):
    s = 'hello'
disruptive
  • 5,687
  • 15
  • 71
  • 135

0 Answers0