Can't access models from seperate: ImportError: no module named "HealthNet.ActivityLog"
<p>I've been working on a way to log the activity of a system for a school project in Python 3.4 and Django 1.9. I am currently trying to import a models.py file from my ActivityLog app into other applications in my HealthNet project to save the activity. The IDE I'm using (Pycharm), is telling me that my code is correct but I get the this error whenever I try to makemigrations/migrate/runserver:</p>

<blockquote>
  <p>ImportError: No module named 'HealthNet.ActivityLog'</p>
</blockquote>

<p>Here is my file setup:</p>

<pre><code>HealthNet
    ActivityLog
        Migrations
        __init__.py
        admin.py
        apps.py
        models.py
        tests.py
        views.py
    Appointments
        Migrations
        __init__.py
        admin.py
        apps.py
        models.py
        tests.py
        views.py
HealthNet
    __init__.py
    settings.py
    urls.py
    wsgi.py
</code></pre>

<p>I'm trying to import models.py from ActivityLog into views.py from Appointments.</p>

<p>Here's my code from models.py</p>

<pre><code>from django.db import models


class Log(models.Model):
    logTime = models.DateTimeField()
    logEvent = models.CharField(max_length=500)

    def __str__(self):
        return self.logEvent
</code></pre>

<p>This is the import statement from views.py in the Appointment package, which is the line that the error is tracing back to:</p>

<pre><code>from HealthNet.ActivityLog.models import Log
</code></pre>

<p>And here is my list of installed apps in my settings.py file:</p>

<pre><code>INSTALLED_APPS = [
    'Appointment.apps.AppointmentConfig',
    'User.apps.UserConfig',
    'ActivityLog.apps.ActivitylogConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

]
</code></pre>

<p>Thank you!</p>

<pre><code>from ActivityLog.models import Log
</code></pre>

<p>'ActivityLog' and 'Appointments' are apps. So add 'ActivityLog' and 'Appointments' to INSTALLED_APPS in settings.py</p>

<p>For eg: </p>

<pre><code>    INSTALLED_APPS = [ 
    'Appointment.apps.AppointmentConfig',
    'User.apps.UserConfig',
    ..........................
    .........................
    'ActivityLog',
    'Appointments',
    ]
</code></pre>

<p>Try this. It will work.</p>

python django