Search Results

Search found 12 results on 1 pages for 'photologue'.

Page 1/1 | 1 

  • Template error with django-photologue: 'Permission Denied'

    - by Ellie P.
    I'm in the process of re-setting up my Django development environment after reinstalling my OS. We use django-photologue with our project, which I installed using easy_install. However, I'm getting a template error on every template that has a photologue photo: TemplateSyntaxError at /newsroom/news/ Caught an exception while rendering: (13, 'Permission denied') One example of the line where the error is located: <img src="{{ photo.get_list_url }}"> I'm totally stumped--I've used photologue for this project on many different platforms and have never had this problem. Google yields nothing. I'm currently using Jolicloud (based on Ubuntu Jaunty). I'm working with a pre-existing database, so all of the photo sizes and everything have already been set up.

    Read the article

  • Dynamically create and save image with Django and PIL/Django-Photologue

    - by Travis
    I want to generate a page of html with dynamic content and then save the result as an image as well as display the page to the user. So, user signs up to attend conference and gives their name and org. That data is combined with html/css elements to show what their id badge for the conference will look like (their name and org on top of our conference logo background) for preview. Upon approval, the page is saved on the server to an image format (PNG, PDF or JPG) to be printed onto a physical badge by an admin later. I am using Django and django-photologue powered by PIL. The view might look like this # app/views.py def badgepreview(request, attendee_id): u = User.objects.get(id=attendee_id) name = u.name org = u.org return render_to_response('app/badgepreview.html', {'name':name,'org':org,}, context_instance = RequestContext(request), ) The template could look like this {# templates/app/badgepreview.html #} {% extends "base.html" %} {% block page_body %} <div style='background:url(/site_media/img/logo_bg.png) no-repeat;'> <h4>{{ name }}</h4> <h4>{{ org }}</h4> </div> {% endblock %} simple, but how do I save the result? Or is there a better way to get this done?

    Read the article

  • Django Photologue - use photo with original compression

    - by 123
    hi, I´m uploading photos with Django Photologue. Is it possible to leave the jpgs as the are? Even if I tell photosize to use Highest Quality compression the files end up having half as many kb as the originals. I must admit that the visable loss of quality is small but as i am a photographer i would like the images to apear exactly as i edited them (photoshop). I don´t need any of photosize´s cropping and effects tools. Can it be turned off completely? thanks for your answers.

    Read the article

  • Django-imagekit: how to reduce image quality with a preprocessor_spec ?

    - by pierre-guillaume-degans
    Hi, please excuse me for my ugly english :p I've created this simple model class, with a Preprocessor to reduce my photos'quality (the photos'extension is .JPG): from django.db import models from imagekit.models import ImageModel from imagekit.specs import ImageSpec from imagekit import processors class Preprocessor(ImageSpec): quality = 50 processors = [processors.Format] class Picture(ImageModel): image = models.ImageField(upload_to='pictures') class IKOptions: preprocessor_spec = Preprocessor The problem : pictures'quality are not reduced. :( Any idea to fix it ? Thank you very much ;)

    Read the article

  • JQuery dynamic .load - works for 1 and not for the other??

    - by Alvin
    UPDATE: Site is online http://qwickqual.com/memorial/create/ under "Memoria Media" - Click on "Our Videos" and it loads the list of categories click on any sub category and it goes through the process below ---------------- end edit ---------------------------------- UPDATED DESCRIPTION OF ERROR: All code is based on <li> objects being linked If I click on an <li> from the Initial page load to load: section 1: I can click on an <li> to load sub-categories section 2: I then click on an <li>, the query is made server returns section 3, section is not loaded to screen / and callback function is skipped over perhaps someone has run into a similar issue before?? ---------------- end edit ---------------------------------- I've also added comments to the code I have a jquery function that is setup to load categorized lists of thumbnails. So far the function is in use in 3 location. Each of them generates HTML using the same template under django. The function works perfectly in 2 of the 3 locations, and I"m plain stumped as to why the 3rd won't work. Below is the complete set of relevant javascript, the page load HTML for the relevant section. And 2 examples of HTML that is loaded through the script, 1 of them works, 1 of them doesn't and both are loaded into the same page load HTML Any ideas what I'm missing here? Or information I need to add to help debug? Currently posting this to a live server to interact with, been local only till now... Error: Script works properly through all levels of title="our_photos" Script loads 1st level of title="our_videos" Script will not load sub-category of title="our_videos" Example: From HTML below: Click on Script will query the server properly: GET http://localhost%3A8000/memorial/media%5Ftype/our%5Fvideos/4/ Script will not load the returned HTML into the #select_media div scopeChain: [Call, Call multi=false uri=/memorial/media_type/our_videos/, Window # 0=Call 1=Call 2=window] relative vars: label = "our_videos" wrapper = "media" uri = "/memorial/media_type/our_videos/" multi = false Javascript <script type="text/javascript"> // this piece is where I'm having trouble in the grand scheme of things // label = piece of class tag // wrapper = tag to load everything inside of // uri = base of the page to load // multi = not relevant for this piece but needed to pass on to next function function img_thumb_loader(label, wrapper, uri, multi) { if(!(wrapper)) { wrapper = label } $('.'+label+'_category').click(function () { // show the loading animation $('div#'+wrapper+'_load').show(); // get var of current object type = $(this).attr('title') || ''; // load it into the screen - this is the error // when I click on an <li> from section 2 below it will query server // (Tamper data & server see it - & return section 3 below // But will not load into the screen on return // also skips over the callback function $('#select_'+label).load(uri+type+'/', '', function() { $('div#'+wrapper+'_load').hide(); $('input.img_'+label+'_field').each(function() { img = $(this).attr('value'); $('li#img_'+label+'-'+img).css('selected_thumb'); }); img_thumb_selected(label); window[label+'_loader'](); }); }); $('.img_'+label).click(function () { if($(this).hasClass('selected_thumb')) { $(this).removeClass('selected_thumb'); id = $(this).attr('title'); $('.img_'+label+'_selected[value="'+id+'"]').remove(); } else { if(!(multi)) { previous = $('.img_'+label+'_selected').val(); $('#img_'+label+'-'+previous).removeClass('selected_thumb'); $('.img_'+label+'_selected').remove(); } $(this).addClass('selected_thumb'); id = $(this).attr('title'); $('#select_'+wrapper).after('<input class="img_'+label+'_selected" id="img_'+label+'_field-'+id+'" type="hidden" name="imgs[]" value="'+id+'" />'); } }); img_thumb_selected(label); } function img_thumb_selected(label) { $('.img_'+label+'_selected').each(function() { current = $(this).val(); if(current) { $('#img_'+label+'-'+current).addClass('selected_thumb'); } }); } function media_type() { $('.media_type').click(function () { $('#media_load').show(); type = $(this).attr('title') || ''; $('#select_media').load('/memorial/media_type/'+type+'/', '', function() { $('#select_media').wrapInner('<div id="select_'+type+'"></div>'); $('#select_media').append('<ul class="root_link"><h3><a class="load_media" onclick="return false;" href="#">Return to Select Media Type</a></h3></ul>'); load_media_type(); $('#media_load').hide(); window[type+'_loader'](); }); }); } media_type(); function load_media_type() { $('.load_media').click(function () { $('#media_load').show(); $('#select_media').load('{% url mem_media_type %}', '', function() { $('#media_load').hide(); media_type(); }); }); } function our_photos_loader() { img_thumb_loader('our_photos', 'media', '{% url mem_our_photos %}', true); } function our_videos_loader() { img_thumb_loader('our_videos', 'media', '{% url mem_our_videos %}', false); } </script> HTML - Initial Page load <fieldset> <legend>Memorial Media</legend> <div style="display: none;" id="media_load" class="loading"/> <div id="select_media"> <ul style="width: 528px;" class="initial"> <li title="your_photos" class="media_type"><div class="photo_select_upload"><h3>Your Photos</h3></div></li> <li title="our_photos" class="media_type"><div class="photo_select"><h3>Our Photos</h3></div></li> <li title="our_videos" class="media_type"><div class="video_select"><h3>Our Videos</h3></div></li> </ul> </div> </fieldset> HTML - Returned from Click on section 1 this section can make calls to subcategories and it will work <br class="clear" /> <ul class="thumb_sub_category" style="width: 352px;"> <li id="our_photos_category-29" class="our_photos_category" title="29"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/stuff_004_thumbnail.jpg);" class="thumb"><span></span></span> <p>Birds 1</p> </div> </li> <li id="our_photos_category-25" class="our_photos_category" title="25"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/dsc_0035_thumbnail.jpg);" class="thumb"><span></span></span> <p>Dogs 1</p> </div> </li> </ul> HTML - Returned from click on Section 2 Having trouble with sub-categories from this area <br class="clear" /> <ul class="thumb_sub_category" style="width: 528px;"> <li id="our_videos_category-1" class="our_videos_category" title="1"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/forest-1_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 1</p> </div> </li> <li id="our_videos_category-3" class="our_videos_category" title="3"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/mountain-1_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 3</p> </div> </li> <li id="our_videos_category-4" class="our_videos_category" title="4"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/mountain-3_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 4</p> </div> </li> </ul> HTML that fails to load inside - Section 3 <br class="clear" /> <ul class="thumb_sub_category" style="width: 528px;"> <li id="our_videos_category-1" class="our_videos_category" title="1"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/forest-1_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 1</p> </div> </li> <li id="our_videos_category-3" class="our_videos_category" title="3"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/mountain-1_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 3</p> </div> </li> <li id="our_videos_category-4" class="our_videos_category" title="4"> <div> <span style="background-image: url(/site_media/photologue/photos/cache/mountain-3_thumbnail.jpg);" class="thumb"><span></span></span> <p>Video 4</p> </div> </li> </ul>

    Read the article

  • Configure Django project in a subdirectory using mod_python. Admin not working.

    - by David
    HI guys. I was trying to configure my django project in a subdirectory of the root, but didn't get things working.(LOcally it works perfect). I followed the django official django documentarion to deploy a project with mod_python. The real problem is that I am getting "Page not found" errors, whenever I try to go to the admin or any view of my apps. Here is my python.conf file located in /etc/httpd/conf.d/ in Fedora 7 LoadModule python_module modules/mod_python.so SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonOption django.root /mysite PythonDebug On PythonPath "['/var/www/vhosts/mysite.com/httpdocs','/var/www/vhosts/mysite.com/httpdocs/mysite'] + sys.path" I know /var/www/ is not the best place to put my django project, but I just want to send a demo of my work in progress to my customer, later I will change the location. For example. If I go to www.domain.com/mysite/ I get the index view I configured in mysite.urls. But I cannot access to my app.urls (www.domain.com/mysite/app/) and any of the admin.urls.(www.domain.com/mysite/admin/) Here is mysite.urls: urlpatterns = patterns('', url(r'^admin/password_reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'), (r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'), (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'), (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'), (r'^$', 'app.views.index'), (r'^admin/', include(admin.site.urls)), (r'^app/', include('mysite.app.urls')), (r'^photologue/', include('photologue.urls')), ) I also tried changing admin.site.urls with ''django.contrib.admin.urls' , but it didn't worked. I googled a lot to solve this problem and read how other developers configure their django project, but didn't find too much information to deploy django in a subdirectory. I have the admin enabled in INSTALLED_APPS and the settings.py is ok. Please if you have any guide or telling me what I am doing wrong it will be much appreciated. THanks.

    Read the article

  • How to extend models of other applications in Django?

    - by culebrón
    I have a small app with Category model and want to make a required foreign key referencing it from Photologue Gallery model. What's the right approach? I can make many-to-many field in Category, but this way it will not be required in Gallery. Use "register" and modify the Gallery model? Inherit it in my app?

    Read the article

  • Django admin, filter objects by ManyToMany reference

    - by Nick Z
    Hello! There's photologue application, simple photo gallery for django, implementing Photo and Gallery objects. Gallery object has ManyToMany field, which references Photo objects. I need to be able to get list of all Photos for a given Gallery. Is it possible to add Gallery filter to Photo's admin page? If it's possible, how to do it best?

    Read the article

  • Django App for Image heavy Magazine Publishing?

    - by stapler
    I'm about to begin work on a Django project for an image heavy non-profit "community arts" magazine. The magazine is published monthly with about 6-8 articles that include with 4-10 images. I've been looking around for other projects that people have started specifically for publishing in Django... Are there any publishing specific Django apps you'd recommend? At the moment the only thing I can find is django-newsroom which looks interesting. Currently I'm just Image Kit / Photologue to attach galleries to an Article Model... but I'd love to figure out a way to more fully integrate images into the article content. Thanks in advance

    Read the article

  • Must See Conference Videos for Python/Django Developers

    - by Koobz
    There's lots of good conference videos online regarding Python and Django development. Instead of watching ST:TNG at the computer, I figure it'd more productive to hone my knowledge . Fire away with some of your most inspiring and educational Python, Django, or simply programming related talks. Provide an explanation of why you found the talk useful. Examples: James Bennet on Re-usable Apps - Got me to take a serious look at django apps. Put together a fairly robust site in two days afterwards with django-cms, django-photologue, django-contact-form. Good advice on when your app is crossing boundaries and why it's good to err on the site of 'make it a separate app.'

    Read the article

  • Why can't I use __getattr__ with Django models?

    - by Joshmaker
    I've seen examples online of people using __getattr__ with Django models, but whenever I try I get errors. (Django 1.2.3) I don't have any problems when I am using __getattr__ on normal objects. For example: class Post(object): def __getattr__(self, name): return 42 Works just fine... >>> from blog.models import Post >>> p = Post() >>> p.random 42 Now when I try it with a Django model: from django.db import models class Post(models.Model): def __getattr__(self, name): return 42 And test it on on the interpreter: >>> from blog.models import Post >>> p = Post() ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (6, 0)) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /Users/josh/project/ in () /Users/josh/project/lib/python2.6/site-packages/django/db/models/base.pyc in init(self, *args, **kwargs) 338 if kwargs: 339 raise TypeError("'%s' is an invalid keyword argument for this function" % kwargs.keys()[0]) -- 340 signals.post_init.send(sender=self.class, instance=self) 341 342 def repr(self): /Users/josh/project/lib/python2.6/site-packages/django/dispatch/dispatcher.pyc in send(self, sender, **named) 160 161 for receiver in self._live_receivers(_make_id(sender)): -- 162 response = receiver(signal=self, sender=sender, **named) 163 responses.append((receiver, response)) 164 return responses /Users/josh/project/python2.6/site-packages/photologue/models.pyc in add_methods(sender, instance, signal, *args, **kwargs) 728 """ 729 if hasattr(instance, 'add_accessor_methods'): -- 730 instance.add_accessor_methods() 731 732 # connect the add_accessor_methods function to the post_init signal TypeError: 'int' object is not callable Can someone explain what is going on? EDIT: I may have been too abstract in the examples, here is some code that is closer to what I actually would use on the website: class Post(models.Model): title = models.CharField(max_length=255) slug = models.SlugField() date_published = models.DateTimeField() content = RichTextField('Content', blank=True, null=True) # Etc... Class CuratedPost(models.Model): post = models.ForeignKey('Post') position = models.PositiveSmallIntegerField() def __getattr__(self, name): ''' If the user tries to access a property of the CuratedPost, return the property of the Post instead... ''' return self.post.name # Etc... While I could create a property for each attribute of the Post class, that would lead to a lot of code duplication. Further more, that would mean anytime I add or edit a attribute of the Post class I would have to remember to make the same change to the CuratedPost class, which seems like a recipe for code rot.

    Read the article

1