This commit is contained in:
j 2013-02-12 16:16:25 +05:30
parent 4aaf03c4e9
commit 47720f49ee
9 changed files with 38 additions and 37 deletions

19
README
View file

@ -1,26 +1,25 @@
pdfvideo - share pdfs with video overlays videopdf - share pdfs with video overlays
Get: Get:
cd /srv cd /srv
bzr branch http://code.0x2620.org/pdfvideo bzr branch http://code.0x2620.org/videopdf
cd pdfvideo cd videopdf
virtualenv --system-site-packages . virtualenv --system-site-packages .
. bin/activate . bin/activate
pip install -r requirements.txt pip install -r requirements.txt
Develop: Develop:
cd /srv/pdfvideo cd /srv/videopdf
create pdfvideo/local_settings.py
./manage.py runserver ./manage.py runserver
Deploy: Deploy:
cd /srv/pdfvideo cd /srv/videopdf
create pdfvideo/local_settings.py
create /etc/apache2/sites-availavle/sitename.conf # create videopdf/local_settings.py with your database settings
create /etc/init/pdfvideo.conf # create /etc/apache2/sites-availavle/sitename.conf (use etc/apache2/videopdf.conf as template)
#create /etc/init/videopdf.conf (ues etc/init/videopdf.conf as template)
service pdfvideo start service videopdf start

View file

@ -2,13 +2,13 @@
ServerName pdf.0x2620.org ServerName pdf.0x2620.org
LogLevel warn LogLevel warn
ErrorLog /var/log/apache2/pdfvideo.org_error.log ErrorLog /var/log/apache2/videopdf.org_error.log
CustomLog /var/log/apache2/pdfvideo.org_access.log combined CustomLog /var/log/apache2/videopdf.org_access.log combined
<Location /> <Location />
Options -Indexes Options -Indexes
</Location> </Location>
<Directory /srv/pdfvideo> <Directory /srv/videopdf>
Order deny,allow Order deny,allow
Allow from all Allow from all
</Directory> </Directory>
@ -18,13 +18,13 @@
XSendFileAllowAbove on XSendFileAllowAbove on
</Location> </Location>
Alias /.bzr /srv/pdfvideo/.bzr Alias /.bzr /srv/videopdf/.bzr
Alias /static/admin /srv/pdfvideo/src/django/django/contrib/admin/static/admin Alias /static/admin /srv/videopdf/src/django/django/contrib/admin/static/admin
Alias /static /srv/pdfvideo/static Alias /static /srv/videopdf/static
Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt Alias /robots.txt /srv/videopdf/videopdf/static/robots.txt
Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico Alias /favicon.ico /srv/videopdf/videopdf/static/favicon.ico
Alias /data /srv/pdfvideo/data Alias /data /srv/videopdf/data
Alias /admin/media /srv/pdfvideo/src/django/django/contrib/admin/media Alias /admin/media /srv/videopdf/src/django/django/contrib/admin/media
ProxyPass /static ! ProxyPass /static !
ProxyPass /favicon.ico ! ProxyPass /favicon.ico !

View file

@ -1,21 +1,21 @@
# pdfvideo gunicorn daemon # videopdf gunicorn daemon
# #
description "pdfvideo daemon" description "videopdf daemon"
start on runlevel [2345] start on runlevel [2345]
stop on runlevel [!2345] stop on runlevel [!2345]
kill timeout 5 kill timeout 5
respawn respawn
env NAME=pdfvideo env NAME=videopdf
env VENV=/srv/pdfvideo env VENV=/srv/videopdf
env DAEMON_USER=pdfvideo env DAEMON_USER=videopdf
env HOME=/home/pdfvideo env HOME=/home/videopdf
script script
test -e /var/log/$NAME || (mkdir -p /var/log/pdfvideo && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME) test -e /var/log/$NAME || (mkdir -p /var/log/videopdf && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME)
cd $VENV/pdfvideo cd $VENV/videopdf
exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \ exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \
--bind 127.0.0.1:2688 \ --bind 127.0.0.1:2688 \
--timeout 90 \ --timeout 90 \

View file

@ -3,7 +3,7 @@ import os
import sys import sys
if __name__ == "__main__": if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pdfvideo.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "videopdf.settings")
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line

View file

@ -1232,7 +1232,9 @@ var PDFView = {
var zoom = store.get('zoom', PDFView.currentScale); var zoom = store.get('zoom', PDFView.currentScale);
var left = store.get('scrollLeft', '0'); var left = store.get('scrollLeft', '0');
var top = store.get('scrollTop', '0'); var top = store.get('scrollTop', '0');
if(document.location.hash) {
page = document.location.hash.substring(1);
}
storedHash = 'page=' + page + '&zoom=' + zoom + ',' + left + ',' + top; storedHash = 'page=' + page + '&zoom=' + zoom + ',' + left + ',' + top;
} }

View file

@ -1,4 +1,4 @@
# Django settings for pdfvideo project. # Django settings for videopdf project.
import os import os
from os.path import join,dirname,normpath from os.path import join,dirname,normpath
@ -101,10 +101,10 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
) )
ROOT_URLCONF = 'pdfvideo.urls' ROOT_URLCONF = 'videopdf.urls'
# Python dotted path to the WSGI application used by Django's runserver. # Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'pdfvideo.wsgi.application' WSGI_APPLICATION = 'videopdf.wsgi.application'
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
join(PROJECT_ROOT, 'templates') join(PROJECT_ROOT, 'templates')

View file

@ -10,8 +10,8 @@ admin.autodiscover()
urlpatterns = patterns('', urlpatterns = patterns('',
# Examples: # Examples:
# url(r'^$', 'pdfvideo.views.home', name='home'), # url(r'^$', 'videopdf.views.home', name='home'),
# url(r'^pdfvideo/', include('pdfvideo.foo.urls')), # url(r'^videopdf/', include('videopdf.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation: # Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

View file

@ -1,5 +1,5 @@
""" """
WSGI config for pdfvideo project. WSGI config for videopdf project.
This module contains the WSGI application used by Django's development server This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable and any production WSGI deployments. It should expose a module-level variable
@ -15,7 +15,7 @@ framework.
""" """
import os import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pdfvideo.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "videopdf.settings")
# This application object is used by any WSGI server configured to use this # This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION # file. This includes Django's development server, if the WSGI_APPLICATION