Forums

Setting up Mezzazine

Hi,

After going through the setup steps detailed in the forum post 'How to use Mezzazine on PythonAnywhere', I could use help on an error I am getting when clicking on the site.

The page says 'Error code: Unhandled Exception'.

Here is the error log:

2016-08-31 00:02:36,837 :Error running WSGI application
Traceback (most recent call last):
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__
    app_iterator = self.app(environ, start_response)
  File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
    raise e
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__
    app_iterator = self.app(environ, start_response)
  File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
    raise e
  File "/bin/user_wsgi_wrapper.py", line 179, in <module>
    application = load_wsgi_application()
  File "/bin/user_wsgi_wrapper.py", line 175, in load_wsgi_application
    return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
  File "/var/www/www_calculuscurve_com_wsgi.py", line 113, in <module>
    application = django.core.handlers.wsgi.WSGIHandler()
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 153, in __init__
    self.load_middleware()
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/core/handlers/base.py", line 56, in load_middleware
    mw_class = import_string(middleware_path)
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/contrib/auth/middleware.py", line 4, in <module>
    from django.contrib.auth.backends import RemoteUserBackend
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/contrib/auth/backends.py", line 4, in <module>
    from django.contrib.auth.models import Permission
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/contrib/auth/models.py", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/contrib/auth/base_user.py", line 52, in <module>
    class AbstractBaseUser(models.Model):
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/db/models/base.py", line 105, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/apps/registry.py", line 237, in get_containing_app_config
    self.check_apps_ready()
  File "/home/thoroly/.virtualenvs/mezzanine/lib/python3.5/site-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

[edit by admin: formatting]

I just went through the Mezzanine instructions as well and am having the same issue.

What versions of django and mezzanine are you using. I would think that you'd see that error if your mezzanine version was expecting an older version of django.

Thanks for your help, Glenn. I'm sorry, I don't know how to get the version of django. When I go back to the mezzazine virtualenv and enter python -c "import django; print(django.get_version())", it says ImportError: No module named django.

I then tried to install Mezzanine from a virtualenv I set up before (the django version is 1.9.8 for that virtualenv) and it says 'Could not find a version that satisfies the requirement mezzazine (from versions: ) No matching distribution found for mezzazine'.

The version of Mezzanine is 4.2.0

Like this:

pip show mezzanine
pip show django

Thanks.

Django is 1.10 Mezzazine is 4.2.0

The mezzanine docs say that mezzanine is compatible with Django 1.8 to 1.9.

Okay thanks.

So I think all we would need to do is create a new virtualenv and install Django 1.8 or 1.9 and Mezzanine. Then start using the new virtualenv on the web tab instead of our current one.

Yup. That's the way to go.

Interesting, thank you. That explains it.

If you create a new virtualenv like JBalloonist mentions and install Django 1.8 or 1.9, will that effect the Django version for the other web app I have? (I have two web apps for two domains).

As long as your other web app does not use the same virtualenv, it will not affect it at all.

Excellent, thank you for your help.

No problem

Thanks very much Glenn. Mezzanine is up and running for me.

After installing the correct version of Django (1.9), I was able to get a live site. The web page was all text links, nothing graphical.

Then, I followed the instructions for 'Configuring static files' (in the 'How to use Mezzanine on PythonAnywhere' forum post). It is still showing text links. After doing this, is the site supposed to look better than all text links?

Hi thoroly,

Is this the help page that you were following? If so, be sure you pay attention to the configuring static files section.

Hi Conrad,

Yes, I was following that page. As I mentioned, after following the 'Configuring static files' section, the home page is not looking any better. It's still all text links.

It works now. The URL setting for the static files did not have '/static/'. It looks much better now! Thank you PythonAnywhere for providing great initial setup instructions for Mezzanine!

@thoroly - have you tried customizing the theme of mezzanine at all?

I've been going through this tutorial but haven't had any success in seeing the changes reflected on my site.

Right after posting I figured out the issue. I had changed my urls.py file to show a "blog only" site. But since I was editing the base.html it wasn't showing up.

Once I switched it back to the default my changes showed up.