Thanks for the reply. I will try it later. just one thing: I have a view function called photos also, can that cause a conflict?
The path is in (r'^', include('server.music.urls')), : from django.conf.urls.defaults import * from server.music.models import Artist,Album logout={'template_name':'logout.html'} urlpatterns = patterns('', (r'^$', 'server.music.views.index'), (r'^about/$', 'server.music.views.about'), (r'^photos/$', 'server.music.views.photos'), (r'^blogg/$', 'server.music.views.blogg'), (r'^accounts/login/$', 'django.contrib.auth.views.login'), (r'^accounts/profile/$', 'server.music.views.profile'), (r'^accounts/profile/logout/$', 'django.contrib.auth.views.logout',logout), (r'^accounts/profile/search/$', 'server.music.views.search'), ) I could rename the media/photo directory to avoid this conflict but it seems to be a clumsy way to do it. On Jan 23, 3:18 pm, Muslu Yüksektepe <musluyuksekt...@gmail.com> wrote: > i think u have to add this code > > urls.py > > DIRNAME = os.path.dirname(__file__) > (r'^photos/(.*)$', 'django.views.static.serve', {'document_root': > os.path.join(DIRNAME, "photos")}), > > pls answer me if your code will ok > > 2009/1/23 nmr <jonas...@gmail.com> > > 2009/1/23 nmr <jonas...@gmail.com> > > > > > Hi. > > > I'm having problem to view my thumbnails. I'm using sorl for thumbnail > > creation and uploading: > > > model.py: > > > class Photo(models.Model): > > text=models.TextField(max_length=50) > > photo=ImageWithThumbnailsField(upload_to='photos/',thumbnail= > > {'size': (50, 50)}) > > > def __unicode__(self): > > return self.text > > class Admin: > > pass > > > template photo.html: > > > {% extends "base.html" %} > > {% block right %} > > {% load thumbnail %} > > <p> Photos that will come... Still under construction!</p> > > <img src="{% thumbnail "photos/DSCN6487.JPG" 100x100 %}" /> > > {% endblock %} > > > urls.py: > > > urlpatterns = patterns('', > > (r'^admin/(.*)', admin.site.root), > > (r'^', include('server.music.urls')), > > > ) > > > if settings.DEBUG: > > urlpatterns += patterns('',(r'^m/(?P<path>.*)$', serve, { > > 'document_root' : os.path.join(os.path.dirname(__file__),"media") > > }) > > ) > > > and that works (i.e thuimbanils are made in the right directory) but > > they don't show up on the webpage. Now, I think that urls.py needs to > > be configured in the right way, i.e translate the output of the > > thumbnail tag to something that 'django.views.static.serve' can use > > but I haven't figured out how. The last lines in urls.py is for static > > images in css and I guess the tumbs should use something similar. > > > any help? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---