I have the same issue. I use python 3.6.7 on Ubuntu 18.04.2 LTS.
I've run the following command:
service mysql start
mysql <<< 'drop database if exists blog; create database blog;'

apt install default-libmysqlclient-dev --assume-yes # for pip3 mysqlclient
pip3 install -U mezzanine
pip3 install -U mezzanine-client # oauth
pip3 install -U mysqlclient
pip3 install -U mezzanine-api
# pip3 install -U MySQL-python

mezzanine-project -a mezzanine_api blog && cd $_
python3 manage.py createdb --noinput
python3 manage.py collecttemplates
python3 manage.py collectstatic
I've changed MIDDLEWARE_CLASS to MIDDLEWARE in blog/settings.py
This INSTALLED_APPS part of settings.py file:
INSTALLED_APPS = (
    'mezzanine_api',
    'rest_framework',
    'rest_framework_swagger',
    'oauth2_provider',
    'django_filters',
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.redirects",
    "django.contrib.sessions",
    "django.contrib.sites",
    "django.contrib.sitemaps",
    "django.contrib.staticfiles",
    "mezzanine.boot",
    "mezzanine.conf",
    "mezzanine.core",
    "mezzanine.generic",
    "mezzanine.pages",
    "mezzanine.blog",
    "mezzanine.forms",
    "mezzanine.galleries",
    "mezzanine.twitter",
    "mezzanine.accounts",
    # "mezzanine.mobile",
)

Then I run server by: *python3 manage.py runserver 0.0.0.0:80 *and get 
error messages:
Unhandled exception in thread started by <function 
check_errors.<locals>.wrapper 
at 0x7f1b22c69c80>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/urls/base.py", line 77
, in reverse
    extra, resolver = resolver.namespace_dict[ns]
KeyError: 'rest_framework'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", 
line 228, in wrapper
    fn(*args, **kwargs)
  File 
"/usr/local/lib/python3.6/dist-packages/mezzanine/core/management/commands/runserver.py"
, line 163, in inner_run
    super(Command, self).inner_run(*args, **kwargs)
  File 
"/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py"
, line 124, in inner_run
    self.check(display_num_errors=True)
  File 
"/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", 
line 359, in check
    include_deployment_checks=include_deployment_checks,
  File 
"/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", 
line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File 
"/usr/local/lib/python3.6/dist-packages/django/core/checks/registry.py", 
line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python3.6/dist-packages/django/core/checks/urls.py", 
line 16, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python3.6/dist-packages/django/core/checks/urls.py", 
line 26, in check_resolver
    return check_method()
  File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", 
line 256, in check
    for pattern in self.url_patterns:
  File "/usr/local/lib/python3.6/dist-packages/django/utils/functional.py", 
line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", 
line 407, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.
urlconf_module)
  File "/usr/local/lib/python3.6/dist-packages/django/utils/functional.py", 
line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", 
line 400, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
  File "/root/blog/blog/urls.py", line 83, in <module>
    url("^", include("mezzanine.urls")),
  File "/usr/local/lib/python3.6/dist-packages/django/conf/urls/__init__.py"
, line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
  File "/usr/local/lib/python3.6/dist-packages/mezzanine/urls.py", line 64, 
in <module>
    url("^", include("mezzanine.accounts.urls")),
  File "/usr/local/lib/python3.6/dist-packages/django/conf/urls/__init__.py"
, line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
  File "/usr/local/lib/python3.6/dist-packages/mezzanine/accounts/urls.py", 
line 31, in <module>
    url("^%s%s$" % (LOGIN_URL.strip("/"), _slash),
  File "/usr/local/lib/python3.6/dist-packages/django/utils/functional.py", 
line 114, in __wrapper__
    res = func(*self.__args, **self.__kw)
  File "/usr/local/lib/python3.6/dist-packages/django/urls/base.py", line 87
, in reverse
    raise NoReverseMatch("%s is not a registered namespace" % key)
django.urls.exceptions.NoReverseMatch: 'rest_framework' is not a registered 
namespace

Any ideas what is wrong?
It looks like pretty standard feature.


W dniu środa, 26 października 2016 03:11:46 UTC+2 użytkownik Ryne Everett 
napisał:
>
> I can't reproduce with a vanilla mezzanine site. 
>
> On 10/25/2016 12:08 AM, Akhlaq Rao wrote: 
> > As soon as I uncomment the mezzanine.accounts app I see the following 
> > error. Is this bug reported? 
> > 
> > django.urls.exceptions.NoReverseMatch: 'rest_framework' is not a 
> > registered namespace 
> > 
> > Unhandled exception in thread started by <function 
> > check_errors.<locals>.wrapper at 0x10951abf8> 
> > Traceback (most recent call last): 
> >   File 
> > 
> "/Users/kashfey/Documents/Kash/Development/Webservice/mezzanine/couture92/lib/python3.5/site-packages/django/urls/base.py",
>  
>
> > line 77, in reverse 
> >     extra, resolver = resolver.namespace_dict[ns] 
> > KeyError: 'rest_framework' 
> > 
> >   File 
> > 
> "/Users/kashfey/Documents/Kash/Development/Webservice/mezzanine/couture92/lib/python3.5/site-packages/mezzanine/accounts/urls.py",
>  
>
> > line 29, in <module> 
> >     url("^%s%s$" % (LOGIN_URL.strip("/"), _slash), 
> >   File 
> > 
> "/Users/kashfey/Documents/Kash/Development/Webservice/mezzanine/couture92/lib/python3.5/site-packages/django/utils/functional.py",
>  
>
> > line 111, in __wrapper__ 
> >     res = func(*self.__args, **self.__kw) 
> >   File 
> > 
> "/Users/kashfey/Documents/Kash/Development/Webservice/mezzanine/couture92/lib/python3.5/site-packages/django/urls/base.py",
>  
>
> > line 87, in reverse 
> >     raise NoReverseMatch("%s is not a registered namespace" % key) 
> > 
> > django.urls.exceptions.NoReverseMatch: 'rest_framework' is not a 
> > registered namespace 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Mezzanine Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to [email protected] <javascript:> 
> > <mailto:[email protected] <javascript:>>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to