Skip to main content

Posts

Showing posts with the label update

Pillow compile error clang: -Wno-error=unused-command-line-argument-hard-error-in-future fix

I have had a problem with compiling Pillow recently. the error was with Pillow/Pil compilation. pillow install error clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error- in -future] Apple updated command line tools. So the cc command was updated too. $ gcc --version Configured with : --prefix= /Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.1 (clang- 503.0 . 38 ) (based on LLVM 3.4 svn) Target: x86_64-apple-darwin13. 1.0 Thread model: posix The bug is in GCC. It is quite serious because those flags support will be dropped in future. Fortunately there is a worakround for now: export ARCHFLAGS= "-Wno-error=unused-command-line-argument-hard-error-in-future" It works for Pillow 2.4.0 and I can compile it with Apple LLVM 5.1 (That is current now), as of Xcode 5.1. Hope my findings will help someone.

Django: Add Permission model to admin panel

How to add a permissions model to your Django admin? You may add those lines to anywhere in your code. But it is more convinient to add this to your admin.py or place where django admin custom code lies. Here are them: from django.contrib.auth.models import Permission admin.site.register(Permission) Now you can manage them in in your Django admin panel. May look like this: Hope this helps.