>
> Is there something wrong with the templating settings? I didn't find a
> TEMPLATE directory in the whole project directory.
>

No, those warnings are not a problem. This is the problem:

RuntimeError: Model class mezzanine.pages.models.Page doesn't declare an
> explicit app_label and isn't in an application in INSTALLED_APPS.


Is 'mezzanine.pages' in your INSTALLED_APPS in settings? If so, are you
sure the right settings are being used when you run runserver? You might
try passing it explicitly: `python manage.py runserver --settings
./path/to/settings.py`.


On Fri, May 27, 2016 at 10:56 PM, Xuwen Fang <[email protected]> wrote:

> The error page shows "A server error occurred.  Please contact the
> administrator."
>
> The console shows the following:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3.4/wsgiref/handlers.py", line 137, in run
>     self.result = application(self.environ, self.start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py",
> line 63, in __call__
>     return self.application(environ, start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py",
> line 63, in __call__
>     return self.application(environ, start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/core/handlers/wsgi.py",
> line 158, in __call__
>     self.load_middleware()
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/core/handlers/base.py",
> line 51, in load_middleware
>     mw_class = import_string(middleware_path)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/utils/module_loading.py",
> line 20, in import_string
>     module = import_module(module_path)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/importlib/__init__.py",
> line 109, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 2226, in
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
>   File "<frozen importlib._bootstrap>", line 1129, in _exec
>   File "<frozen importlib._bootstrap>", line 1471, in exec_module
>   File "<frozen importlib._bootstrap>", line 321, in
> _call_with_frames_removed
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/middleware.py",
> line 8, in <module>
>     from mezzanine.pages import context_processors, page_processors
> File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/context_processors.py",
> line 2, in <module>
>     from mezzanine.pages.models import Page
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/models.py",
> line 35, in <module>
>     class Page(BasePage):
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/core/models.py",
> line 390, in __new__
>     return super(OrderableBase, cls).__new__(cls, name, bases, attrs)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/db/models/base.py",
> line 102, in __new__
>     "INSTALLED_APPS." % (module, name)
> RuntimeError: Model class mezzanine.pages.models.Page doesn't declare an
> explicit app_label and isn't in an application in INSTALLED_APPS.
>
> [28/May/2016 02:43:34] "GET /admin/ HTTP/1.1" 500 59
> Traceback (most recent call last):
>   File "/usr/lib/python3.4/wsgiref/handlers.py", line 137, in run
>     self.result = application(self.environ, self.start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py",
> line 63, in __call__
>     return self.application(environ, start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py",
> line 63, in __call__
>     return self.application(environ, start_response)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/core/handlers/wsgi.py",
> line 158, in __call__
>     self.load_middleware()
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/core/handlers/base.py",
> line 51, in load_middleware
>     mw_class = import_string(middleware_path)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/utils/module_loading.py",
> line 20, in import_string
>     module = import_module(module_path)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/importlib/__init__.py",
> line 109, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 2226, in
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
>   File "<frozen importlib._bootstrap>", line 1129, in _exec
>   File "<frozen importlib._bootstrap>", line 1471, in exec_module
>   File "<frozen importlib._bootstrap>", line 321, in
> _call_with_frames_removed
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/middleware.py",
> line 8, in <module>
>     from mezzanine.pages import context_processors, page_processors
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/context_processors.py",
> line 2, in <module>
>     from mezzanine.pages.models import Page
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/pages/models.py",
> line 35, in <module>
>     class Page(BasePage):
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/core/models.py",
> line 390, in __new__
>     return super(OrderableBase, cls).__new__(cls, name, bases, attrs)
>   File
> "/home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/db/models/base.py",
> line 102, in __new__
>     "INSTALLED_APPS." % (module, name)
> RuntimeError: Model class mezzanine.pages.models.Page doesn't declare an
> explicit app_label and isn't in an application in INSTALLED_APPS.
> [28/May/2016 02:43:34] "GET /favicon.ico HTTP/1.1" 500 59
>
>
>
>
> Before I accessed the admin page,  after "python manage.py runserver", the
> console shows the following:
>
> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/utils/conf.py:47:
> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
> requires. Will fall back to the domains configured as sites.
>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/utils/conf.py:47:
> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
> requires. Will fall back to the domains configured as sites.
>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>               .....
>           _d^^^^^^^^^b_
>        .d''           ``b.
>      .p'                `q.
>     .d'                   `b.
>    .d'                     `b.   * Mezzanine 4.1.0
>    ::                       ::   * Django 1.9.6
>   ::    M E Z Z A N I N E    ::  * Python 3.4.3
>    ::                       ::   * SQLite 3.8.2
>    `p.                     .q'   * Linux 4.2.0-36-generic
>     `p.                   .q'
>      `b.                 .d'
>        `q..          ..p'
>           ^q........p^
>               ''''
>
> Performing system checks...
>
> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/template/utils.py:37:
> RemovedInDjango110Warning: You haven't defined a TEMPLATES setting. You
> must do so before upgrading to Django 1.10. Otherwise Django will be unable
> to load templates.
>   "unable to load templates.", RemovedInDjango110Warning)
>
> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/drum/links/urls.py:39:
> RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and
> will be removed in Django 1.10. Update your urlpatterns to be a list of
> django.conf.urls.url() instances instead.
>   name="link_list_tag"),
>
> /home/xuwen/workspaces/python/bbs/xc_bbs/xc_bbs/urls.py:12:
> RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and
> will be removed in Django 1.10. Update your urlpatterns to be a list of
> django.conf.urls.url() instances instead.
>   ("^", include("mezzanine.urls")),
>
> System check identified some issues:
>
> WARNINGS:
> ?: (mezzanine.core.W01) Please update your settings to use the TEMPLATES
> setting rather than the deprecated individual TEMPLATE_ settings. The
> latter are unsupported and correct behaviour is not guaranteed. Here's a
> suggestion based on on your existing configuration:
>
> TEMPLATES = [{'APP_DIRS': True,
>               'BACKEND': 'django.template.backends.django.DjangoTemplates',
>               'DIRS':
> ('/home/xuwen/workspaces/python/bbs/xc_bbs/templates',),
>               'OPTIONS': {'builtins': ['mezzanine.template.loader_tags'],
>                           'context_processors':
> ('django.contrib.auth.context_processors.auth',
>
>  'django.contrib.messages.context_processors.messages',
>
>  'django.core.context_processors.debug',
>
>  'django.core.context_processors.i18n',
>
>  'django.core.context_processors.static',
>
>  'django.core.context_processors.media',
>
>  'django.core.context_processors.request',
>                                                  '
> django.core.context_processors.tz',
>
>  'mezzanine.conf.context_processors.settings',
>
>  'mezzanine.pages.context_processors.page')}}]
>
> ?: (mezzanine.core.W02) TEMPLATE_DEBUG and DEBUG settings have different
> values, which may not be what you want. Mezzanine used to fix this for you,
> but doesn't any more. Update your settings.py to use the TEMPLATES setting
> to have template debugging controlled by the DEBUG setting.
>
> System check identified 2 issues (0 silenced).
> May 28, 2016 - 02:43:29
> Django version 1.9.6, using settings 'xc_bbs.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
>
>
>
> Is there something wrong with the templating settings? I didn't find a
> TEMPLATE directory in the whole project directory.
>
>
>
>
> 在 2016年5月28日星期六 UTC+8上午10:34:44,Ryne Everett写道:
>>
>> No, that ought to work. What is the "error page" you're getting? What
>> does the console show for that request?
>>
>> On Fri, May 27, 2016 at 10:27 PM, Xuwen Fang <[email protected]> wrote:
>>
>>> No. In the virtualenv, I installed Django-1.9.6. This is according to
>>> what "pip list" shows. Is that matter? Should I install a lower Django
>>> version?
>>>
>>> 在 2016年5月28日星期六 UTC+8上午10:10:39,Ryne Everett写道:
>>>>
>>>> Do you have django-1.10 installed per chance? Mezzanine doesn't support
>>>> 1.10 yet.
>>>>
>>>> On Fri, May 27, 2016 at 9:50 PM, Xuwen Fang <[email protected]> wrote:
>>>>
>>>>> Hello.
>>>>> I want to install a Drum instance and follow the instructions on
>>>>> https://github.com/stephenmcd/drum
>>>>> And after "python manage.py createdb --noinput", it shows the
>>>>> following:
>>>>>
>>>>>
>>>>>
>>>>> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/mezzanine/utils/conf.py:47:
>>>>> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
>>>>> requires. Will fall back to the domains configured as sites.
>>>>>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>>>>> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/django/template/utils.py:37:
>>>>> RemovedInDjango110Warning: You haven't defined a TEMPLATES setting. You
>>>>> must do so before upgrading to Django 1.10. Otherwise Django will be 
>>>>> unable
>>>>> to load templates.
>>>>>   "unable to load templates.", RemovedInDjango110Warning)
>>>>>
>>>>> /home/xuwen/workspaces/python/bbs/lib/python3.4/site-packages/drum/links/urls.py:39:
>>>>> RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and
>>>>> will be removed in Django 1.10. Update your urlpatterns to be a list of
>>>>> django.conf.urls.url() instances instead.
>>>>>   name="link_list_tag"),
>>>>>
>>>>> /home/xuwen/workspaces/python/bbs/xc_bbs/xc_bbs/urls.py:12:
>>>>> RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and
>>>>> will be removed in Django 1.10. Update your urlpatterns to be a list of
>>>>> django.conf.urls.url() instances instead.
>>>>>   ("^", include("mezzanine.urls")),
>>>>>
>>>>> System check identified some issues:
>>>>>
>>>>> WARNINGS:
>>>>> ?: (mezzanine.core.W01) Please update your settings to use the
>>>>> TEMPLATES setting rather than the deprecated individual TEMPLATE_ 
>>>>> settings.
>>>>> The latter are unsupported and correct behaviour is not guaranteed. Here's
>>>>> a suggestion based on on your existing configuration:
>>>>>
>>>>> TEMPLATES = [{'APP_DIRS': True,
>>>>>               'BACKEND':
>>>>> 'django.template.backends.django.DjangoTemplates',
>>>>>               'DIRS':
>>>>> ('/home/xuwen/workspaces/python/bbs/xc_bbs/templates',),
>>>>>               'OPTIONS': {'builtins':
>>>>> ['mezzanine.template.loader_tags'],
>>>>>                           'context_processors':
>>>>> ('django.contrib.auth.context_processors.auth',
>>>>>
>>>>>  'django.contrib.messages.context_processors.messages',
>>>>>
>>>>>  'django.core.context_processors.debug',
>>>>>
>>>>>  'django.core.context_processors.i18n',
>>>>>
>>>>>  'django.core.context_processors.static',
>>>>>
>>>>>  'django.core.context_processors.media',
>>>>>
>>>>>  'django.core.context_processors.request',
>>>>>                                                  '
>>>>> django.core.context_processors.tz',
>>>>>
>>>>>  'mezzanine.conf.context_processors.settings',
>>>>>
>>>>>  'mezzanine.pages.context_processors.page')}}]
>>>>>
>>>>> ?: (mezzanine.core.W02) TEMPLATE_DEBUG and DEBUG settings have
>>>>> different values, which may not be what you want. Mezzanine used to fix
>>>>> this for you, but doesn't any more. Update your settings.py to use the
>>>>> TEMPLATES setting to have template debugging controlled by the DEBUG
>>>>> setting.
>>>>>
>>>>> Operations to perform:
>>>>>   Apply all migrations: sites, django_comments, core, redirects,
>>>>> admin, generic, auth, links, contenttypes, sessions, conf
>>>>> Running migrations:
>>>>>   Rendering model states... DONE
>>>>>   Applying contenttypes.0001_initial... OK
>>>>>   Applying auth.0001_initial... OK
>>>>>   Applying admin.0001_initial... OK
>>>>>   Applying admin.0002_logentry_remove_auto_add... OK
>>>>>   Applying contenttypes.0002_remove_content_type_name... OK
>>>>>   Applying auth.0002_alter_permission_name_max_length... OK
>>>>>   Applying auth.0003_alter_user_email_max_length... OK
>>>>>   Applying auth.0004_alter_user_username_opts... OK
>>>>>   Applying auth.0005_alter_user_last_login_null... OK
>>>>>   Applying auth.0006_require_contenttypes_0002... OK
>>>>>   Applying auth.0007_alter_validators_add_error_messages... OK
>>>>>   Applying sites.0001_initial... OK
>>>>>   Applying conf.0001_initial... OK
>>>>>   Applying core.0001_initial... OK
>>>>>   Applying core.0002_auto_20150414_2140... OK
>>>>>   Applying django_comments.0001_initial... OK
>>>>>   Applying django_comments.0002_update_user_email_field_length... OK
>>>>>   Applying django_comments.0003_add_submit_date_index... OK
>>>>>   Applying generic.0001_initial... OK
>>>>>   Applying generic.0002_auto_20141227_0224... OK
>>>>>   Applying links.0001_initial... OK
>>>>>   Applying redirects.0001_initial... OK
>>>>>   Applying sessions.0001_initial... OK
>>>>>   Applying sites.0002_alter_domain_unique... OK
>>>>>
>>>>> Creating default site record: 127.0.0.1:8000 ...
>>>>> Creating default account (username: admin / password: default) ...
>>>>>
>>>>>
>>>>>
>>>>> Then after I "python manage.py runserver", the
>>>>> http://127.0.0.1:8000/admin/ shows an error page.
>>>>> Please tell me how I can solve it.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> --
>>>>> 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.
>>>>>
>>>>
>>>> --
>>> 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.
>>>
>>
>> --
> 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.
>

-- 
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