I have a new setup of Django CMS with the following components installed (requirements.txt):
Django==1.11
Pillow==5.0.0
psycopg2-binary==2.7.4
django-ckeditor==5.4.0
django-cms==3.5.1
djangocms-text-ckeditor>=3.6.0
And the following file structure:
.
├── main_app
│ ├── admin.py
│ ├── admin.pyc
│ ├── apps.py
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── migrations
│ ├── models.py
│ ├── models.pyc
│ ├── __pycache__
│ ├── tests.py
│ ├── urls.py
│ ├── urls.pyc
│ ├── views.py
│ └── views.pyc
├── project
│ ├── cms_apps.py
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── local_settings.py
│ ├── local_settings.pyc
│ ├── production.py
│ ├── production.pyc
│ ├── __pycache__
│ ├── settings.py
│ ├── settings.pyc
│ ├── static
│ ├── urls.py
│ ├── urls.pyc
│ ├── wsgi.py
│ └── wsgi.pyc
├── templates
│ ├── 404.html
│ ├── base.html
│ └── ...
├── manage.py
└── requirements.txt
When I add an Apphook, I cannot select the Application in the advanced page settings:
project/cms_apps.py:
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
@apphook_pool.register
class MainApphook(CMSApp):
app_name = 'main_app'
name = 'Main App'
def get_urls(self, page=None, language=None, **kwargs):
return ["main_app.urls"]
My installed apps in settings.py:
INSTALLED_APPS = [
'custom_auth',
'djangocms_admin_style',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djangocms_text_ckeditor',
'cms',
'menus',
'treebeard',
'sekizai',
'ckeditor',
'main_app',
]
I have restarted the server according to the tutorial at http://docs.django-cms.org/en/latest/introduction/apphooks.html
Note that there is no project/cms_apps.pyc
As far as I can tell, I followed the Apphook tutorial exactly, so what am I missing?
main_app
should be app hooked then it needs it's owncms_apps.py
, not one inproject
– markwalker_