Links

   Quran Explorer - Interactive Audio Recitations & Translations

Thursday, March 27, 2014

Add Mezzanine to an existing Django Project

 

I dont take any credit for the following content.. Its here solely for (my) future reference and has been taken directly from the Mezzanine FAQs page

 

How can I add Mezzanine to an existing Django project?

Mezzanine is a Django project made up of multiple Django apps, and is geared towards being used as the basis for new Django projects, however adding Mezzanine to an existing Django project should be as simple as adding the necessary settings and urlpatterns.
Mezzanine contains a project_template directory, which it uses to create new projects. In here you’ll find the necessary settings.py and urls.py modules, containing the project-level setup for Mezzanine. Of particular note are the following settings:
  • INSTALLED_APPS
  • TEMPLATE_CONTEXT_PROCESSORS
  • MIDDLEWARE_CLASSES
  • PACKAGE_NAME_GRAPPELLI and PACKAGE_NAME_FILEBROWSER (for django-grappelli and django-filebrowser integration)
  • The call to mezzanine.utils.conf.set_dynamic_settings at the very end of the settings.py module.

Tuesday, March 4, 2014

Fixing Django ImportError in production

Hi,

"TemplateSyntaxError: Caught ImportError while rendering: No module named blahblahblah"  

In Development all imports work perfectly untill u move to production....

I 'lost' almost 16 man-hours trying to troubleshoot this. This is almost always a path issue.. There are several options one of them adding the path using os.path but the one that worked for me is to fully qualify the module name.

This means prefixing the project name to the module name such that if your project name was 'my_project' and the missing module/app is 'registration_app' you'll need to use my_project.registration_app EVERYWHERE in your .py files..