mezzanine

Mezzanine BlogCategory parsing categories

时光毁灭记忆、已成空白 提交于 2019-12-14 02:20:10
问题 I want to build a custom filter that takes a blog_post as an argument and does some parsing of the categories (attached to the blog post). I tried like this: from mezzanine import template from mezzanine.blog.models import BlogPost, BlogCategory register = template.Library() @register.filter(name='has_friends') def has_friends(blog_post): categories = blog_post.categories.all() if 'Friends' in categories: return False else: return True The problem is that blog_post.categories.all() returns

python manage.py dbshell doesn't find psycopg2 although it is installed and in path

爱⌒轻易说出口 提交于 2019-12-13 21:04:03
问题 I'd like to be issuing SQL commands via python manage.py dbshell but I get the error "CommandError: You appear not to have the 'sqlite3' program installed or on your path". From the python prompt I can import psycopg2 without getting any errors and psycopg2 appears to be in my python path. I'm trying django and my settings.py specifies "ENGINE": "django.db.backends.postgresql_psycopg2" Any help would be greatly appreciated, Thanks, Julian 回答1: when you run ./manage.py dbshell psql or sqlite3

Sending email from Django Mezzanine running on Heroku

喜欢而已 提交于 2019-12-13 16:27:43
问题 I am using rackspace email and having problem sending email via Mezzanine(1.4.10) form page. This is my settings: EMAIL_HOST = 'secure.emailsrvr.com' EMAIL_PORT = 465 # other ports also tried EMAIL_USE_TLS = True EMAIL_HOST_USER = 'info@example.com' EMAIL_HOST_PASSWORD = 'secret' This is Rackspace documentation: http://www.rackspace.com/apps/support/portal/1088 But I can send email from the console like this: from django.core.mail import send_mail send_mail('Subject here', 'Here is the

Mezzanine/Django 1.10 migrations: Database tables does not much with migrations

≯℡__Kan透↙ 提交于 2019-12-12 03:45:12
问题 I am using Mezzanine (Django 1.10) so I can't see a " db.sqlite3 " I searched similar questions as mine and most of the solutions provided were not effective. I created a new model and later decided to add a new field. I did "python manage.py makemigrations ", and when I looked at my migrations folder, it's there; the new field exists. Now, when I ran the app and looked into admin, it gave me error where it said "No such column exists". Therefore, I think, my database is not synced with the

Getting “ImproperlyConfigured: The SECRET_KEY setting must not be empty.” error when deploying mezzanine 3.0.9 on openshift

爱⌒轻易说出口 提交于 2019-12-11 19:49:24
问题 I have been following this (http://appsembler.com/blog/django-deployment-using-openshift/) tutorial to deploy mezzanine 3.0.9 with python 2.7 and mysql 5.1 After deploy when I make the http request I am getting following error logs: [Sat Mar 22 00:44:31 2014] [error] /var/lib/openshift/532c9876e0b8cdcdeb0001c8/python/virtenv/lib/python2.7/site-packages/Mezzanine-3.0.9-py2.7.egg/mezzanine/utils/conf.py:51: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django 1.5 requires.

Mezzanine ImportError when running tests

限于喜欢 提交于 2019-12-11 19:48:09
问题 I have recently upgraded the version of Django from 1.5.5 to 1.6.2 and Mezzanine to 3.0.9. When I run python manage.py test All the tests run without problem. But When I run project specific tests using python manage.py test <project-name> Then I get ImportError. I get that its something to do with Circular Imports. Here is the stack trace. Please help. ====================================================================== ERROR: Failure: ImportError (cannot import name DisplayableAdmin) ----

Pillow virtualenv install fails: “command 'gcc-4.2' failed” [duplicate]

感情迁移 提交于 2019-12-11 13:05:20
问题 This question already has answers here : gcc-4.2 failed with exit status 1 (8 answers) Closed 5 years ago . I am installing Mezzanine in a virtualenv. It fails at the Pillow installation with a gcc-4.2 related error of which this is an excerpt. I can actually install it successfully on my machine but not inside of a virtualenv. I want it in a venv however. What should I do? `decode.c:465: error: ‘COMPRESSION_SGILOG’ undeclared (first use in this function) decode.c:468: error: ‘COMPRESSION

How to solve UnicodeDecodeError in mezzanine?

北城以北 提交于 2019-12-11 07:51:44
问题 I am using mezzanine cms. When I scrap the data from the blogspot I got this error blog_id: sanavitastudio Traceback (most recent call last): File "/home/nyros/hs/git_br/2013/Oct-9/healersource/apps/blog_hs/forms.py", line 226, in save blog_id=blog_id) File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 150, in call_command return klass.execute(*args, **defaults) File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django

Fetch blog entries with bootstrap custom theme and mezzanine

独自空忆成欢 提交于 2019-12-11 04:58:43
问题 I'm new to mezzanine, I managed to install my custom bootstrap theme just copying templates and static files in the relatives folders in my django app. Assume in my index.html I have some blog entries like these <h2>Other Entries</h2> <article> <h3>Blog Post 1</h3> <p>Contrary to popular belief, Lorem Ipsum is not simply random text.... <a href="#">Read more</a></p> </article> <article> <h3>Blog Post 2</h3> <p>Contrary to popular belief, Lorem Ipsum is not simply random text.... <a href="#"

django-import-export can not get it working

て烟熏妆下的殇ゞ 提交于 2019-12-10 15:56:00
问题 Can not get this to do anything, installed, added to apps, followed the docs. nothing. here's my admin.py: from import_export import resources from import_export.admin import ImportExportModelAdmin class EmailGroupResource(resources.ModelResource): class Meta: model = EmailGroup class EmailGroupAdmin(DjangoObjectActions, ImportExportModelAdmin, admin.ModelAdmin): resource_class = EmailGroupResource .. rest of admin admin.site.register(EmailGroup, EmailGroupAdmin) Maybe i have a conflict?