move static and files

This commit is contained in:
j 2010-11-06 17:14:40 +01:00
parent 86305e4c76
commit aeaa875608
21 changed files with 29 additions and 14 deletions

View file

@ -278,7 +278,13 @@ class Frame(models.Model):
position = models.FloatField() position = models.FloatField()
frame = models.ImageField(default=None, null=True, upload_to=frame_path) frame = models.ImageField(default=None, null=True, upload_to=frame_path)
#FIXME: frame path should be renamed on save to match current position '''
def save(self, *args, **kwargs):
name = "%d.jpg" % self.position
if file.name != name:
#FIXME: frame path should be renamed on save to match current position
super(Frame, self).save(*args, **kwargs)
'''
def __unicode__(self): def __unicode__(self):
return u'%s at %s' % (self.file, self.position) return u'%s at %s' % (self.file, self.position)

View file

@ -4,9 +4,9 @@
import os import os
from os.path import join from os.path import join
SITENAME = 'Pandora' SITENAME = 'Pan.do/ra'
SITEID = 'pandora' SITEID = 'pandora'
URL = 'pan.do/ra' URL = 'pan.do/ra'
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
@ -67,14 +67,14 @@ APPEND_SLASH = False
# Absolute path to the directory that holds media. # Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/" # Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = join(PROJECT_ROOT, 'media') MEDIA_ROOT = join(PROJECT_ROOT, '..', 'data')
STATIC_ROOT = join(PROJECT_ROOT, 'static') STATIC_ROOT = join(PROJECT_ROOT, '..', 'static')
TESTS_ROOT = join(PROJECT_ROOT, 'tests') TESTS_ROOT = join(PROJECT_ROOT, 'tests')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a # URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases). # trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/" # Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/' MEDIA_URL = '/data/'
STATIC_URL = '/static/' STATIC_URL = '/static/'
@ -138,15 +138,24 @@ VIDEO_H264 = False
#VIDEO_H264 = False #VIDEO_H264 = False
TRANSMISSON_HOST='localhost' TRANSMISSON_HOST = 'localhost'
TRANSMISSON_PORT=9091 TRANSMISSON_PORT = 9091
TRANSMISSON_USER='transmission' TRANSMISSON_USER = 'transmission'
TRANSMISSON_PASSWORD='transmission' TRANSMISSON_PASSWORD = 'transmission'
#list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice #list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice
POSTER_SERVICES=[] POSTER_SERVICES = []
POSTER_PRECEDENCE=('local', 'criterion.com', 'wikipedia.org', 'impawards.com', 'movieposterdb.com', 'imdb.com', 'allmovie.com', 'other') POSTER_PRECEDENCE = (
'local',
'criterion.com',
'wikipedia.org',
'impawards.com',
'movieposterdb.com',
'imdb.com',
'allmovie.com',
'other'
)
#0xdb.org #0xdb.org
#POSTER_SERVICES=['http://data.0xdb.org/poster/'] #POSTER_SERVICES=['http://data.0xdb.org/poster/']

View file

@ -39,7 +39,7 @@ urlpatterns = patterns('',
if settings.DEBUG: if settings.DEBUG:
urlpatterns += patterns('', urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve', (r'^data/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}), {'document_root': settings.MEDIA_ROOT}),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', (r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}), {'document_root': settings.STATIC_ROOT}),

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View file

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB