I have existing apps in Django. I want to integrate them with mezzanine project in a way that the apps are available in form of pages. I followed this method.

The steps I followed-

  1. I created a fresh vanilla mezzanine project- it works!
  2. Then I created theme for website- it works! From admin interface if i add a page, the page renders along with website theme.
  3. Copy pasted the Django apps in mezzanine project.
  4. Added the app names in mezzanine project's settings.py file at the beginning of INSTALLED_APPS.
  5. Added corresponding URL patterns in mezzanine project's urls.py file

The related code snippets (example app, About Us)-

testproject/aboutus/views.py

from django.shortcuts import render

def aboutus(request):
    context=locals()
    #context=page(about)
    template = 'aboutus/aboutus.html'
    return render(request,template,context)

testproject/aboutus/urls.py

import mezzanine
from django.conf.urls import url
from aboutus import views
from mezzanine.conf import settings

urlpatterns = [
    url(r'^aboutus.html',views.aboutus,name='aboutus'),
]

testproject/urls.py

from __future__ import unicode_literals
import mezzanine
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.views.i18n import set_language
from mezzanine.core.views import direct_to_template
from mezzanine.conf import settings
from aboutus import views

urlpatterns += [
    url("^$", direct_to_template, {"template": "index.html"}, name="home"),
    url(r'^',include('aboutus.urls')),
    url("^", include("mezzanine.urls")),
]

I'm missing out on something minute but very important. We want the existing Django apps to be integrated as pages in mezzanine so that they are editable through admin interface. I want to know the exact steps to achieve this.

Thanks in advance!

0 Answers 11

Not the answer you're looking for? Browse other questions tagged or ask your own question.