how to start integrating django-cms into existing project -


my purpose convert static pages (about us, contact etc) in existing project admin editable pages. have followed instructions @ tutorial things started don't seem results. far performing python manage.py cms check seems indicate got set up. don't seem urls right. says here

you need include 'cms.urls' urlpatterns @ end of urlpatterns.

my urls follows:

urlpatterns = patterns('',                        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),                        # uncomment next line enable admin:                        url(r'^admin/', include(admin.site.urls)),                        # main site                        url(r'^', include('website.urls')),                        url(r'^', include('cms.urls')), )  if settings.debug:     import debug_toolbar      urlpatterns = patterns('',                            url(r'^media/(?p<path>.*)$', 'django.views.static.serve',                                {'document_root': settings.media_root, 'show_indexes': true}),                            url(r'', include('django.contrib.staticfiles.urls')),                            url(r'^__debug__/', include(debug_toolbar.urls)),     ) + urlpatterns 

when type http://localhost:8000?edit, cms toolbar/menus didn't show up. neither page inherited template created below shows placeholder editing when suffixed url ?edit.

any idea did go wrong?

{% load cms_tags sekizai_tags %}  <!doctype html> <html> <head>     {% include "head.html" %}     {% block page_specific %}     {% endblock %}     {% render_block "css" %}     {% render_block "js" %} </head>  <body>  <!--{% include "floating_login.html" %}-->  <section id="subpage_wrapper">     {% include_ribbon=1 %}         {% include "nav_base.html" %}     {% endwith %}      <div id="sub_wrapper_white">         {% placeholder "feature" %}         {% block static_content %}          {% endblock static_content %}     </div>       <div id="sub_wrapper_red"></div>     <div id="sub_wrapper_yellow"></div>  </section>   </body> </html>  

two things, remove, assume be, project urls might cause issues. if need it, don't match base pattern consider bad practise until lot of specific pattern matches in file aren't break cms urls.

then add {% cms_toolbar %} tag base template in order ensure toolbar displays & can interact cms.

urls.py

urlpatterns = patterns('',                        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),                        # uncomment next line enable admin:                        url(r'^admin/', include(admin.site.urls)),                        # main site                        url(r'^project/', include('website.urls')),                        url(r'^', include('cms.urls')), ) 

base.html

{% load cms_tags sekizai_tags %}  <!doctype html> <html> <head>     {% include "head.html" %}     {% block page_specific %}     {% endblock %}     {% render_block "css" %}     {% render_block "js" %} </head>  <body> {% cms_toolbar %} <!--{% include "floating_login.html" %}-->  <section id="subpage_wrapper">     {% include_ribbon=1 %}         {% include "nav_base.html" %}     {% endwith %}      <div id="sub_wrapper_white">         {% placeholder "feature" %}         {% block static_content %}          {% endblock static_content %}     </div>     <div id="sub_wrapper_red"></div>     <div id="sub_wrapper_yellow"></div>  </section>   </body> </html>  

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -