Code Monkey home page Code Monkey logo

mezzanine's Introduction

Created by Stephen McDonald

Overview

Mezzanine is a powerful, consistent, and flexible content management platform. Built using the Django framework, Mezzanine provides a simple yet highly extensible architecture that encourages diving in and hacking on the code. Mezzanine is BSD licensed and supported by a diverse and active community.

In some ways, Mezzanine resembles tools such as Wordpress, providing an intuitive interface for managing pages, blog posts, form data, store products, and other types of content. But Mezzanine is also different. Unlike many other platforms that make extensive use of modules or reusable applications, Mezzanine provides most of its functionality by default. This approach yields a more integrated and efficient platform.

Visit the Mezzanine project page to see some of the great sites people have built using Mezzanine.

Features

In addition to the usual features provided by Django such as MVC architecture, ORM, templating, caching and an automatic admin interface, Mezzanine provides the following:

The Mezzanine admin dashboard:

http://mezzanine.jupo.org/docs/_images/dashboard.png

Support

To report a security issue, please send an email privately to [email protected]. This gives us a chance to fix the issue and create an official release prior to the issue being made public.

For all other Mezzanine support, the primary channel is the mezzanine-users mailing list. Questions, comments, issues, feature requests, and all other related discussions should take place here.

If you're certain you've come across a bug, then please use the GitHub issue tracker, however it's crucial that enough information is provided to reproduce the bug, ideally with a small code sample repo we can simply fork, run, and see the issue with. Other useful information includes things such as the Python stack trace generated by error pages, as well as other aspects of the development environment used, such as operating system, database, and Python version. If you're not sure you've found a reproducible bug, then please try the mailing list first.

Finally, feel free to drop by the #mezzanine IRC channel on Freenode, for a chat! Lastly, communications in all Mezzanine spaces are expected to conform to the Django Code of Conduct.

Contributing

Mezzanine is an open source project managed using both the Git and Mercurial version control systems. These repositories are hosted on both GitHub and Bitbucket respectively, so contributing is as easy as forking the project on either of these sites and committing back your enhancements.

Donating

If you would like to make a donation to continue development of Mezzanine, you can do so via the Mezzanine Project website.

Quotes

mezzanine's People

Contributors

ajfisher avatar akhayyat avatar alexhill avatar amites avatar dfalk avatar dpnova avatar dsanders11 avatar edschofield avatar eht16 avatar ei-grad avatar gavinwahl avatar henri-hulski avatar jcartmell avatar jerivas avatar joshcartme avatar kenbolton avatar kniyl avatar nikolas avatar renyi avatar ryneeverett avatar sebasmagri avatar simenheg avatar sjkingo avatar solarissmoke avatar spookylukey avatar stephenmcd avatar tourist avatar tvon avatar viaregio avatar wrwrwr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mezzanine's Issues

First install with South

I want to pinpoint a situation where, if you install south early in your setup -early meaning before the first syncdb - you're getting into trouble :

  • mezzanine apps are left out syncdb (south , cleverly auto-installed - do not change this!- , immediatly wants to manage them)
  • you now face a list of apps you have to migrate without knowing their relations

And trying to launch the whole migration simply using ./manage.py migrate will output this :

Running migrations for conf:

  • Nothing to migrate.
    • Loading initial data for conf.
      No fixtures found.
      Running migrations for core:
  • Nothing to migrate.
    • Loading initial data for core.
      No fixtures found.
      Running migrations for blog:
  • Nothing to migrate.
    • Loading initial data for blog.
      No fixtures found.
      Running migrations for forms:
    • Migrating forwards to 0003_auto__chg_field_field_field_type.

      forms:0001_initial
      Traceback (most recent call last):
      File "./manage.py", line 31, in
      ..........
      django.db.utils.DatabaseError: relation "pages_page" does not exist

A fews days ago, I managed to find the right order to do migrations for make this work, but it was a pain.

My suggestion, either :

  • clearly state in the install doc that South must be installed AFTER the first syncdb. After all, concerning the mezzanine packages, you will only use these migrations if you're upgrading from a previous version , happened once for me.
  • or find a way for the migrations to happen in a good sequence when lauching the global migrate command, as this will be the natural thing to do for a South user

For today, I'll just erase my tables, uninstall south and resync, but this kind of little thing has to be watched so the first experience can be the best possible.

cleaner settings.py

The default django-admin.py generated settings.py is pretty informative, is there any reason not to keep the text it provides in the mezzanine-project generated file, and could a few comments about the additional code be provided?

Issue with clean install via overview docs

I ran this per the docs at http://mezzanine.jupo.org/docs/overview.html#installation

easy_install -U mezzanine
mezzanine-project TestApp
cd TestApp
python manage.py syncdb
python manage.py runserver

I tried this using easy_install, as well as from a clone of the master branch on github. Both ways seem to produce the exact same error. I do not seem to have the filebrowser_safe subdir/application installed into the generated project.

I'm still learning python and django but it seems whatever is supposed to be installing the filebrowser_safe application is not working.

This is the error I see:

TemplateSyntaxError at /
Caught ViewDoesNotExist while rendering: Could not import filebrowser_safe.views. Error was: No module named Image

Template error

In template /home/michael/django/TestApp/templates/base.html, error at line 10
Caught ViewDoesNotExist while rendering: Could not import filebrowser_safe.views. Error was: No module named Image

This is the contents of the TestApp dir:

$ ls -F ~/django/TestApp

init.py* local_settings.py manage.py* mezzanine.db settings.pyc
templates/ urls.pyc init.pyc local_settings.pyc manage.pyc settings.py* site_media/ urls.py*

css bug in admin pages

If you scroll halfway down an edit/add content form and reload it, the menu gets rendered in the middle of the page rather than up in the bar. I suspect its because breadcrumb.offset() is not zero when the page is in the middle.

LOGIN_FORM_KEY broken import

Line 1 in mezzanine.core.middleware 'from django.contrib.admin.views.decorators import LOGIN_FORM_KEY' does not work in django 1.3 (trunk)

That variable is presently imported from django.contrib.admin.sites .

page_menu with given parent page

Hi,

I got an error when I used page_menu templatetag with a parent page: {% page_menu page "pages/menus/secondary.html" %}

It was about parent page not having branch_level field, which is only set if set_menu_helpers() is called. The error occurred on pages_tags.py:61. I got it fixed by adding parent_page.set_menu_helpers(context["request"].path) just before that line. I'm not sure if this is a proper way to fix this issue. I hope you could check it out.

Page Admin - Editable parent and childs

Hi,

I created a new content type and I am trying to make the parent and the childs editable from the admin page.

The parent is easy -although it doesn't check that the new parent is not a child and you can get an inconsistent tree-, just adding "parent" to the fieldset.

Moreover, if you add "children" to the fieldset for editing the childs, you get an error because "the children field is not in the form".

How can I solve it? Maybe is a django issue, not an Mezzanine issue, but I think that this could be an improvement for the admin interface.

Thank you very much!

Mysql constraint errors when doing a clean install

I'm using MySQL. Got this error on "python manage.py syncdb" with a completely clean install.

Installing json fixture 'initial_data' from '/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/mezzanine/pages/fixtures'.
Problem installing fixture '/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/mezzanine/pages/fixtures/initial_data.json': Traceback (most recent call last):
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/core/management/commands/loaddata.py", line 172, in handle
    obj.save(using=using)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/core/serializers/base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/models/base.py", line 527, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/models/query.py", line 1479, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 783, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/backends/util.py", line 15, in execute
    return self.cursor.execute(sql, params)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 86, in execute
    return self.cursor.execute(query, args)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/Users/kevin/Workspace/MixedCase/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`mixedcase`.`pages_page`, CONSTRAINT `parent_id_refs_id_353c0eed` FOREIGN KEY (`parent_id`) REFERENCES `pages_page` (`id`))')

some urls issue after clean install

hi

pip install mezzanine
mezzanine_project mez
...
it's almost ok, but i have some problems with these urls in /admin/:
/media/admin/jquery/jquery-1.3.2.min.js
/media/admin/js/admin/Bookmarks.js
/media/admin/js/admin/CollapsibleGroup.js
and /media/admin/tinymce/jscripts/tiny_mce/tiny_mce.js in /

i've found them in /usr/local/lib/python2.6/dist-packages/(mezzanine/core/admin/) and it is in sys.path when i use ./manage.py shell.

what i did wrong?

null value in column "keyword_id" violates not-null constraint

Django 1.3 + Mezzanine from git + Cartridge from git

EDIT : tried to reinstall the DB, it's impossible to create a page without keywords, and impossible to edit pages that had no keyword

Did a syncb, refusing the pony product but accepting the example content pages
on adding a simple content page, get this error :

IntegrityError at /admin/pages/contentpage/add/

null value in column "keyword_id" violates not-null constraint

Request Method: POST
Request URL: http://dev.quinode.fr:8000/admin/pages/contentpage/add/
Django Version: 1.3
Exception Type: IntegrityError
Exception Value: null value in column "keyword_id" violates not-null constraint
Exception Location: /Users/dom/django/.virtualenvs/bzi/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 44

Looks like then the "meta" keywords form in the admin part cannot be opened.
Verify things, restart the runserver...

I start again by modifying existing example pages, no error
I create a new page , another error :

MultiValueDictKeyError at /admin/pages/contentpage/add/

"Key 'keywords_0' not found in <QueryDict: {u'status': [u'2'], u'in_navigation': [u'on'], u'description': [u''], u'title': [u'Tarifs'], u'in_footer': [u'on'], u'slug': [u''], u'content': [u'

tarifs

'], u'expiry_date_0': [u''], u'expiry_date_1': [u''], u'csrfmiddlewaretoken': [u'727de21437dd4d4744ac52373d328a09'], u'publish_date_0': [u''], u'publish_date_1': [u''], u'_save': [u'Enregistrer']}>"

Request Method: POST
Request URL: http://dev.quinode.fr:8000/admin/pages/contentpage/add/
Django Version: 1.3
Exception Type: MultiValueDictKeyError
Exception Value:

EDIT 2 :
JS files not found on the edit page (I know grapelli does its things here, just to be complete)
jquery.min.js
jquery.init.js
actions.min.js
collapse.min.js

IE 7 issues

Problems in the /admin interface in IE 7:

  1. When going to the Pages admin and there is a subpage, I get a javascript error and the little + icon is not visible.
  2. No TinyMCE editors
  3. The icons to change date and time are not visible
  4. The interface for editing forms is completely borked

Wrong tiny_mce URL in admin form

Crrrently core.admin has that string:
displayable_js.insert(0, "/media/admin/tinymce/jscripts/tiny_mce/tiny_mce.js")
probably should be:
displayable_js.insert(0, MEDIA_ADMIN_PREFIX+"tinymce/jscripts/tiny_mce/tiny_mce.js")

The blogger import management command dies after a partial import of a blogger log

The entries that were imported seem to mostly be intact, some very minor formatting issues.

./manage.py import_blogger --mezzanine-user=seant --blogger-id=35153410
Importing post titled: Pearls of (ahem) wisdom.
Importing post titled: Cultured Pearls.
Importing post titled: You don't write, you don't call.
Importing post titled: You're being too precise.
Importing post titled: A simple thing.
Importing post titled: Speaking naturally.
Importing post titled: Do Androids dream?
Importing post titled: Lost on the web.
Importing comment by: Omarra Byrd
Traceback (most recent call last):
  File "./manage.py", line 31, in <module>
    execute_manager(settings)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/mezzanine/blog/management/base.py", line 119, in handle
    ThreadedComment.objects.get_or_create(**comment)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/manager.py", line 135, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/query.py", line 366, in get_or_create
    return self.get(**kwargs), False
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/query.py", line 333, in get
    clone = self.filter(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/query.py", line 550, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/query.py", line 568, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1128, in add_q
    can_reuse=used_aliases)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1026, in add_filter
    negate=negate, process_extras=process_extras)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1191, in setup_joins
    "Choices are: %s" % (name, ", ".join(names)))
django.core.exceptions.FieldError: Cannot resolve keyword 'website' into field. Choices are: blogpost, by_author, comment, comment_ptr, comments, content_type, email_hash, flags, id, ip_address, is_public, is_removed, object_pk, replied_to, site, submit_date, user, user_email, user_name, user_url

Title and tagline unicode error

I tried the new settings for modifying the default title and tagline but it chokes on accented letters :

 UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 6: ordinal not in range(128)

blog_post_list uses 'user' in context

I'm integrating mezzanine blog with out site and it looks like the blog_post_list view uses the context variable 'user' to represent the author of the posts. This clobbers the context processor that we use to put the request.user in the context.

Obviously, these kinds of collisions will happen but in this case, I'd propose changing the variable in blog_post_list to be 'author' to match the rest of the templates and code.

Another possibility might be to use a mezzanine blog specific prefix for the context variables (maybe mzb or mb) but that seems like overkill.

Missing or broken template?

Testing Mezzanine 0.9.1. When attempting to edit the default 'Contact' form or adding a form I'm getting a template syntax error. I've only changed the GRAPPELLI_ADMIN_HEADLINE, and the GRAPPELLI_ADMIN_TITLE. Not sure if it's a bug or an issue on my end. Below are the details of the error, but not the traceback:

TemplateSyntaxError at /admin/forms/form/add/
Caught TemplateDoesNotExist while rendering: nline_admin_formset.opts.templat
Request Method: GET
Request URL: http://localhost:8000/admin/forms/form/add/?parent=3
Django Version: 1.2.3
Exception Type: TemplateSyntaxError
Exception Value:
Caught TemplateDoesNotExist while rendering: nline_admin_formset.opts.templat
Exception Location: /Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/site-packages/django/template/loader.py in select_template, line 196
Python Executable: /Users/nelson/Source/Django/Mezzanine/env/bin/python
Python Version: 2.6.1
Python Path: ['/Users/nelson/Source/Django/Mezzanine/sparkfly', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg', '/Users/nelson/Source/Django/Mezzanine/env/lib/python26.zip', '/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/Library/Python/2.6/site-packages/virtualenv-1.5-py2.6.egg', '/Library/Python/2.6/site-packages/pip-0.8.1-py2.6.egg', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/plat-darwin', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/plat-mac', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/plat-mac/lib-scriptpackages', '/Users/nelson/Source/Django/Mezzanine/env/Extras/lib/python', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/lib-tk', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/lib-old', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/Users/nelson/Source/Django/Mezzanine/env/lib/python2.6/site-packages', '/Library/Python/2.6/site-packages', '/Library/Python/2.6/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode']
Server time: Sat, 18 Dec 2010 11:10:03 -0600

Quick Blog Error

I just setup the test install... when I try to add a "Quick Blog" I get...

IntegrityError at /admin/blog/blogpost/add/
blog_blogpost.user_id may not be NULL

Thought I'd give you a heads up.

I'm running 1.1.2.

Renaming a form page causes 404 error on submit

  1. Create a page of the Form type. When you submit, you should go to the same url with ?sent=1 added.
  2. Change the title of the page (but not the url).
  3. Now when you submit, you are redirected to /pagetitle/?sent=1 instead of /pageurl/?sent=1, causing a 404 error.

Apply Mezzanine's Dynamic inline to Django's Stacked/Generic inlines

I'm running off of head which looks to be version 0.11. I've created a new page type that in the admin uses inlined objects in the admin. The mezzanine code removes all of the inline forms that were added but doesn't put new ones back. Nor does there seem to be a method for adding new ones. Below is my code.

models.py file

from django.conf import settings
from django.db import models
from mezzanine.core.models import RichText
from mezzanine.pages.models import Page

# Create your models here.
class TemplatedPage(Page):
    template = models.CharField(max_length=512, verbose_name="Template Name",
                                                                help_text="The name of the template to use when rendering this page.", 
                                choices=getattr(settings, "EXTENDED_PAGES_TEMPLATES", []))

    class Meta:
        verbose_name = "Templated Page"
        verbose_name_plural = "Templated Pages"

class PageSection(RichText):
    page = models.ForeignKey(TemplatedPage, related_name="sections")
    name = models.CharField(max_length=32, verbose_name="Name", help_text="Name of Page Section Content.")
    order = models.PositiveSmallIntegerField(choices=[(x,x) for x in range(50)], default=0, verbose_name="Order", help_text="If you have multiple sections with the same name this helps order them.")

    class Meta:
        verbose_name = "Page Section"
        verbose_name_plural = "Page Sections"
admin.py file

from copy import deepcopy
from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from .models import PageSection, TemplatedPage

class PageSectionInline(admin.StackedInline):
    model = PageSection
    #fields = ("order", "content")
    #extra = 2

TEMPLATED_PAGE_FIELDSETS = deepcopy(PageAdmin.fieldsets)
TEMPLATED_PAGE_FIELDSETS[0][1]['fields'].insert(2,"template")
class TemplatedPageAdmin(PageAdmin):
    inlines = (PageSectionInline,)
    fieldsets = TEMPLATED_PAGE_FIELDSETS

admin.site.register(TemplatedPage, TemplatedPageAdmin)

If the problem isn't caused by mezzanine but is instead something I've done wrong please let me know.

link to toggle toolbar in a custom theme

Related to the "<<" toggle not working in my theme (hope you see this behaviour too!) :
http://quinode.fr/tmp/darkbleu.zip

just add a console.log or an alert at the start of the
$('#editable-toolbar-toggle').click(function() in the theme's editable_loader file
Load the home page (no inline editing),
you'll see the function called 3 times on page load, then the link remain clickable, but actually any click result in the function called two times, this is why I thought it wasn't working
Is the cookie messed up or something ?
Are the duplicated scripts from the start_theme commands are differents from the core scripts (and bugged) ?

undefined variable

In Mezzanine 0.9.1:

mezzanine/core/admin.py:140 says "model" when it should probably be "self.model":
add_url = admin_url(model, "add")

Lots of unused imports and variable all over the place too, but nothing too significant. Do you guys run pyflakes on the source before each release? It's super quick and a nice way to clean up a lot of those little pieces.

I notice them since I load up the code in PyDev and have to go through and add #@pydevignore's of various types with each new release. Obviously, I wouldn't expect the mezzanine code to have those comments in them, but a quick pyflakes run before each release would catch trivial issues like that as well as any slightly more major ones such as this one.

Thumbnail engine neither works nor fails explicitly

Problem: After installing mezzanine and cartridge, it's stated dependencies and PIL, when adding images to a product two things occur:

I've created a testcase available here:
https://github.com/zenWeasel/mezzanine/commit/c4b04d88f962e2a99301748aec5c87381294ba0c

When the test is run within the project itself, it just fails with an IOError and returns the original image unchanged. Within my project created using the instructions below, still causes the issue with appearing to work, but not.

  1. The upload will accept no format except for gif, stating that the image is corrupted.
  2. For the gif image it creates thumbnails for the various sizes needed within the site but they are all 0 byte files. So essentially all product images show up as broken images.

Steps to reproduce. (with virtualenv and virtualenvwrapper installed)

  • mkvirtualenv mezztest --no-site-packages
  • pip install mezzanine
  • pip install cartridge
  • pip install PIL
  • mezzanine-project -a cartridge testproject (accept all options to install all demo data)
  • cd testproject
  • python manage.py syncdb
  • python ./manage.py runserver
  • Go to admin interface
  • Add product and try to upload a jpg image, receive error.
  • Upload gif image. Verify that after saving the image shows as a broken image
  • Look at /site_media/products and see that all thumbnails are 0 byte files.
    Additionally I tried some of the steps outlined in Josh's question on the mailing list in terms of getting a different version of PIL installed, however, in the template tag thumbnail it uses 'from PIL import image, imageops' and dropping to the django shell, this same command works. Also since it return the URL of a created thumbnail (yoga2_1-90x90.jpg) that leads me to believe that it things that it has created the image correctly.

System: Ubuntu 10.10 and 11.04, Django 1.3, Python 2.7.1, PIL 1.7.1

no such table: conf_setting

Attempting to get 0.10 up and running. Tried both the download and git master versions. Each give the same error: DatabaseError at / no such table: conf_setting.

code bugs in 0.8.1

Mezzanine is fantastic! Thank you for the awesome work!

I found a couple of issues opening up the mezzanine source in pydev (which does pylint like checking across the source code)

mezzanine.scripts.mezanine_project.py:50 - Undefined variable 'package'
Should probably be 'package_name'

mezzanine.blog.views.py:30 - Undefined variable 'Page'
Not directly imported, should be

Other than that, there are a variety of import redefinitions, unused imports and unused variables. Here's the full list in CSV form:

Description,Resource,Path,Location,Type
Import redefinition: template,blog_tags.py,/MezzanineCommon/src/mezzanine/blog/templatetags,line 12,PyDev Problem
Import redefinition: template,pages_tags.py,/MezzanineCommon/src/mezzanine/pages/templatetags,line 6,PyDev Problem
Unused import: _,mezzanine_tags.py,/MezzanineCommon/src/mezzanine/core/templatetags,line 15,PyDev Problem
Unused import: cmemcache,settings.py,/MezzanineCommon/src/mezzanine/project_template,line 123,PyDev Problem
Unused import: Context,admin.py,/MezzanineCommon/src/mezzanine/forms,line 13,PyDev Problem
Unused import: HtmlField,admin.py,/MezzanineCommon/src/mezzanine/core,line 8,PyDev Problem
Unused import: loader,admin.py,/MezzanineCommon/src/mezzanine/forms,line 13,PyDev Problem
Unused import: mark_safe,mezzanine_tags.py,/MezzanineCommon/src/mezzanine/core/templatetags,line 12,PyDev Problem
Unused import: memcache,settings.py,/MezzanineCommon/src/mezzanine/project_template,line 126,PyDev Problem
Unused import: ObjectDoesNotExist,models.py,/Simon/src/snap,line 4,PyDev Problem
Unused import: reverse,models.py,/MezzanineCommon/src/mezzanine/forms,line 1,PyDev Problem
Unused import: reverse,views.py,/MezzanineCommon/src/mezzanine/blog,line 5,PyDev Problem
Unused import: ReverseSingleRelatedObjectDescriptor,utils.py,/MezzanineCommon/src/mezzanine,line 5,PyDev Problem
Unused import: slugify,models.py,/MezzanineCommon/src/mezzanine/forms,line 3,PyDev Problem
Unused import: template,blog_tags.py,/MezzanineCommon/src/mezzanine/blog/templatetags,line 6,PyDev Problem
Unused import: template,pages_tags.py,/MezzanineCommon/src/mezzanine/pages/templatetags,line 2,PyDev Problem
Unused import: ugettext,models.py,/MezzanineCommon/src/mezzanine/forms,line 4,PyDev Problem
Unused import: Zip,models.py,/Simon/src/snap,line 3,PyDev Problem
Unused variable: created,import_tumblr.py,/MezzanineCommon/src/mezzanine/blog/management/commands,line 47,PyDev Problem
Unused variable: created,import_tumblr.py,/MezzanineCommon/src/mezzanine/blog/management/commands,line 53,PyDev Problem
Unused variable: created,import_tumblr.py,/MezzanineCommon/src/mezzanine/blog/management/commands,line 56,PyDev Problem
Unused variable: created,tests.py,/MezzanineCommon/src/mezzanine,line 50,PyDev Problem
Unused variable: created,views.py,/MezzanineCommon/src/mezzanine/core,line 23,PyDev Problem

Documentation Correction

Was working through the example in the documentation and I believe I found a small mistake:

"You’ll also need to create an admin class for the Gallery model that inherits from mezzanine.pages.admin.PageAdmin:

from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from models import Gallery, GalleryImage

class GalleryAdmin(PageAdmin):
inlines = (GalleryImageInline,)

class GalleryImageInline(admin.TabularInline):
model = GalleryImage

admin.site.register(Gallery, GalleryAdmin)"

I had to switch the order in which the classes are being called as calling (GalleryImageInline) before it is defined throws an error.

How mine is configured:

from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from models import Gallery, GalleryImage

class GalleryImageInline(admin.TabularInline):
model = GalleryImage

class GalleryAdmin(PageAdmin):
inlines = (GalleryImageInline,)

admin.site.register(Gallery, GalleryAdmin)"

Disclaimer:
I'm fairly new to Python and Django so please correct me if I just have something improperly configured. This seems to be working though.

Inlines save problem aka "__prefix__ in id and name problem"

When you try to save last item in admin inline it won't save.

I think reason for this as i think is "prefix" instead number in id and name of input fields of inline.

I thought it was my configuration but it's the same in demo
http://mezzanine.jupo.org/admin/shop/order/2/ (Items Inline)
("id_items-prefix-sku" instead of "id_items-0-sku")

This also breaks dynamic add function in grappelli inlines (http://code.google.com/p/django-grappelli/wiki/inlinemodeladminoptions - allow_add). I didn't checked but maybe grappelli JS copies that last (wrong in this case) item if you add new rows.

the blog_categories template tag contains duplicates

The blog_categories template tage does not exclude duplicates, and I'm assuming that it should. I haven't yet forked mezzanine, but here's a diff that'll fix it:

diff --git a/mezzanine/blog/templatetags/blog_tags.py b/mezzanine/blog/templatetags/blog_tags.py
index b8885e7..c1ab3b6 100644
--- a/mezzanine/blog/templatetags/blog_tags.py
+++ b/mezzanine/blog/templatetags/blog_tags.py
@@ -70,7 +70,7 @@ def blog_categories(*args):
     Put a list of categories for blog posts into the template context.
     """ 
     posts = BlogPost.objects.published()
-    return list(BlogCategory.objects.filter(blogposts__in=posts))
+    return list(BlogCategory.objects.filter(blogposts__in=posts).distinct())


 @register.as_tag

meta description should be a plain text field and not rich text

As far as I know HTML isn't allowed in a meta description (or at least it wouldn't be understood there), so using the rich text editor there doesn't make sense.

I'd change it and submit a pull request but honestly I can't quite figure out where and how it's set... it looks like all TextField's are turned into a rich editor...?

Use of "with" keyword in scripts/*.py breaks in Python 2.5

Two of the files in the scripts directory (make_*_safe.py) rely on the "with" keyword, which means that they don't work in Python versions older than 2.6. See PEP 343.

One potential fix would be to add "from future import with_statement", which would support 2.5 but not 2.4. Another fix would be to replace the "with" statements with try/finally pairs.

I haven't looked to see whether any other files outside of the scripts directory also rely on "with".

Note that there was a recent commit cb83559 with the message "Fix admin menu for earlier than Python 2.6 which lacks tuple.index", which makes me think you'd like to support older versions of Python. Regardless, I recommend picking a minimum version of Python and mentioning that version in the dependencies.

draft pages show up in menus

In 0.8.1, pages that are marked as Draft but have their 'show in navigation' and 'show in footer' boxes checked will show up in the navigation and footer menus.

It would be handy to have an overridable utility method on Displayable (perhaps something like .is_visible()) that will take into account:

Published v. Draft
Current date/time
Whether current user can see the page (requires login or not)

TemplateSyntaxError: 'generic_tags' is not a valid tag library - in blog_post_detail.html

I got the following error:
TemplateSyntaxError at /blog/second-post/
'generic_tags' is not a valid tag library: Template library generic_tags not found, tried django.templatetags.generic_tags,mezzanine.core.templatetags.generic_tags...

Here's the traceback:
Environment:

Request Method: GET
Request URL: http://tsicorpnet.cartwheelweb.com/blog/second-post/

Django Version: 1.3
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.redirects',
'django.contrib.sessions',
'django.contrib.sites',
'mezzanine.conf',
'mezzanine.core',
'mezzanine.generic',
'mezzanine.blog',
'mezzanine.forms',
'mezzanine.pages',
'mezzanine.twitter',
'debug_toolbar',
'south',
'filebrowser_safe',
'grappelli_safe',
'django.contrib.admin',
'django.contrib.comments']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'mezzanine.core.middleware.DeviceAwareFetchFromCacheMiddleware',
'mezzanine.core.middleware.AdminLoginInterfaceSelector',
'debug_toolbar.middleware.DebugToolbarMiddleware']

Template error:
In template /home/tsicorpnet/tsicorpnet/templates/blog/blog_post_detail.html, error at line 2
'generic_tags' is not a valid tag library: Template library generic_tags not found, tried django.templatetags.generic_tags,mezzanine.core.templatetags.generic_tags,mezzanine.generic.templatetags.generic_tags,mezzanine.blog.templatetags.generic_tags,mezzanine.pages.templatetags.generic_tags,mezzanine.twitter.templatetags.generic_tags,filebrowser_safe.templatetags.generic_tags,grappelli_safe.templatetags.generic_tags,django.contrib.admin.templatetags.generic_tags,django.contrib.comments.templatetags.generic_tags
1 : {% extends "blog/blog_post_list.html" %}

2 : {% load mezzanine_tags generic_tags i18n %}

3 :

4 : {% block meta_title %}{{ blog_post.title }}{% endblock %}

5 :

6 : {% block meta_keywords %}{% metablock %}

7 : {% for keyword in blog_post.keywords.all %}

8 : {% if not forloop.first %}, {% endif %}

9 : {{ keyword }}

10 : {% endfor %}

11 : {% endmetablock %}{% endblock %}

12 :

Traceback:
File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/src/mezzanine/mezzanine/blog/views.py" in blog_post_detail
  2. t = select_template(templates, request_context)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/src/mezzanine/mezzanine/template/loader.py" in select_template
  3.         return get_template(template_name, context_instance)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/src/mezzanine/mezzanine/template/loader.py" in get_template
  4. return _select_template(template_name_list)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in select_template
  5.         return get_template(template_name)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in get_template
  6. template, origin = find_template(template_name)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in find_template
  7.         source, display_name = loader(name, dirs)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in call
  8.     return self.load_template(template_name, template_dirs)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in load_template
  9.         template = get_template_from_string(source, origin, template_name)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/loader.py" in get_template_from_string
  10. return Template(source, origin, name)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/base.py" in init
  11.     self.nodelist = compile_string(template_string, origin)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/base.py" in compile_string
  12. return parser.parse()
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/base.py" in parse
  13.                 compiled_result = compile_func(self, token)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/src/mezzanine/mezzanine/template/loader_tags.py" in extends
  14. nodelist = parser.parse()
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/base.py" in parse
  15.                 compiled_result = compile_func(self, token)
    
    File "/home/tsicorpnet/.virtualenvs/tsicorpnet/lib/python2.6/site-packages/django/template/defaulttags.py" in load
  16.                                       (taglib, e))
    

Exception Type: TemplateSyntaxError at /blog/second-post/
Exception Value: 'generic_tags' is not a valid tag library: Template library generic_tags not found, tried django.templatetags.generic_tags,mezzanine.core.templatetags.generic_tags,mezzanine.generic.templatetags.generic_tags,mezzanine.blog.templatetags.generic_tags,mezzanine.pages.templatetags.generic_tags,mezzanine.twitter.templatetags.generic_tags,filebrowser_safe.templatetags.generic_tags,grappelli_safe.templatetags.generic_tags,django.contrib.admin.templatetags.generic_tags,django.contrib.comments.templatetags.generic_tags

Mezzanine's TinyMCE doesn't work in IE

The tinymce_setup.js file in mezzanine core and grappelli_safe have dictionaries with trailing commas. Technically, they're not allowed in javascript but Firefox handles this just fine. IE can't deal with it and kills javascript on a page making tinymce not work.

grappelli_safe's tinymce_setup has the offending commas on lines 13 and 17 while the one in core/media/js has them on lines 13, 17 and 125.

Error when trying to install

I get an error when trying to install via both easy_install and setup.py. Tried it both on web host and locally with the same error. This is with a fresh clone from github today.

setup.py:14: Warning: 'with' will become a reserved keyword in Python 2.6
File "setup.py", line 14
with open(e, "r") as f:
^
SyntaxError: invalid syntax

Django >=1.2 and DATABASE_ENGINE NameError

Problem:
When using django version 1.2.3 and setting database info by DATABASES dictionary (1.2 new way) and remove DATABASE_ENGINE from project_template/local_settings.py i get:
NameError: name 'DATABASE_ENGINE' is not defined

That's because of that piece of code in settings.py in project_template
db_engine = DATABASE_ENGINE.split(".")[-1]
if db_engine == "sqlite3" and "/" not in DATABASE_NAME:
# If the sqlite DB name doesn't contain a path, assume it's in the
# project directory and add the path to it.
DATABASE_NAME = os.path.join(project_path, DATABASE_NAME)
elif db_engine == "mysql":
# Required MySQL collation for tests.
TEST_DATABASE_COLLATION = "utf8_general_ci"
elif db_engine.startswith("postgresql") and not globals().get("TIME_ZONE", 1):
# Specifying a blank time zone to fall back to the system's time zone
# will break table creation in Postgres so remove it.
del TIME_ZONE

If I want django 1.2 and new database settings I would need to change that code or leave some fake variables (DATABASE_ENGINE, DATABASE_NAME) or it will break.

This hide well when you have got DATABASE_ENGINE defined in local_settings.py because django 1.2 get DATABASES dict setting first and uses local_settings for that piece of code even if there are some unexisting db info.

It should be fixed to use dictionary as well as old settings depend on what version of django user have.

Too long description but I hope that's clear :)

Cache middleware not working?

The caching seems to be broken.

My middleware classes are defined as

MIDDLEWARE_CLASSES = (
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.redirects.middleware.RedirectFallbackMiddleware",
    "mezzanine.core.middleware.DeviceAwareUpdateCacheMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "mezzanine.core.middleware.DeviceAwareFetchFromCacheMiddleware",
    "mezzanine.core.middleware.AdminLoginInterfaceSelector",
)

and

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/tmp/django_cache',
    }
}

I tried memcached and localmem, in all cases, the page is not being served from cache. When using the disk cache, the directory remains empty, there is no warnings or error anywhere.

No way to serve sites outside of root URL using mod_wsgi

If I use mod_wsgi to serve a site at the URL /mysite, instead of the usual /, all of the links generated by templates will be wrong. For example, content media will be served from /content_media instead of /mysite/content_media. It seems like I should be able to specify a prefix in settings.py, to match the one in my httpd.conf, which would be prepended to all URL variables that are used in templates, which means the defaults specified by mezzanine/conf need to know about that prefix. I can do systematically make these changes, but I wonder if I'm overlooking something much easier. I don't think there is a way to do it in urls.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.