Permalink
Browse files

djanog 1.5 completer.

  • Loading branch information...
1 parent ee0460a commit eb75ce932ca7d3703cbc08afb8b35698bb7edf18 @CarlFK committed Feb 21, 2013
View
@@ -45,6 +45,8 @@ def logax(request):
l = login(request,user)
else:
ret = {'error_no':-1, 'error_text':'form error'}
+ else:
+ ret = {'error_no':-2, 'error_text':'not POST'}
response = HttpResponse(simplejson.dumps(ret,indent=1))
response['Content-Type'] = 'application/json'
return response
@@ -8,12 +8,12 @@
{% block content %}
<table class="shortcuts">
- <a href="{% url 'admin:main_client_change' client.id%}">client admin</a>
+ <a href="{% url admin:main_client_change client.id%}">client admin</a>
</table>
<table class=tpick>
{% for show in shows%}
- <tr class=row{{ forloop.counter0|divisibleby:2|yesno:"1,2"}}><td> {{show.sequence}}</td><td> <a href="{% url 'episode_list' client.slug show.slug%}">{{ show.name }}</a></td></tr>
+ <tr class=row{{ forloop.counter0|divisibleby:2|yesno:"1,2"}}><td> {{show.sequence}}</td><td> <a href="{% url episode_list client.slug show.slug%}">{{ show.name }}</a></td></tr>
{% endfor %}
</table>
@@ -5,7 +5,7 @@
<h2>Clients</h2>
<table class=tpick>
{% for client in clients %}
- <tr class="row{{ forloop.counter0|divisibleby:2|yesno:"1,2"}}" > <td> {{client.sequence}} </td><td><a href="{% url 'client' client.slug %}">{{ client.name }}</a></td></tr>
+ <tr class="row{{ forloop.counter0|divisibleby:2|yesno:"1,2"}}" > <td> {{client.sequence}} </td><td><a href="{% url client client.slug %}">{{ client.name }}</a></td></tr>
{% endfor %}
</table>
@@ -7,8 +7,8 @@
{% block content %}
-<a href="{% url 'client' client.slug %}">{{ client.name }}</a>
-<a href="{% url 'episode_list' client.slug show.slug%}">{{ show.name }}</a>
+<a href="{% url client client.slug %}">{{ client.name }}</a>
+<a href="{% url episode_list client.slug show.slug%}">{{ show.name }}</a>
<br/>
{% if prev_episode %}
@@ -40,24 +40,24 @@
{% if episode.conf_url %}
<a href="{{episode.conf_url}}">{{episode.conf_url}}</a><br/>
{% endif %}
-Admin: <a href="{% url 'admin:main_episode_change' episode.id%}">episode</a>
-<a href="{% url 'admin:main_cut_list_changelist' %}?episode__id__exact={{episode.id}}">cut list</a>
+Admin: <a href="{% url admin:main_episode_change episode.id%}">episode</a>
+<a href="{% url admin:main_cut_list_changelist %}?episode__id__exact={{episode.id}}">cut list</a>
<br>
<a href="/databrowse/main/episode/objects/{{episode.id}}/">databrowse</a>
-<a href="{% url 'raw_list' episode.id %}{{episode.slug}}.m3u">raw-playlist</a>
-<a href="{% url 'enc_list' episode.id %}{{episode.slug}}.m3u">encoded-files-playlist</a>
+<a href="{% url raw_list episode.id %}{{episode.slug}}.m3u">raw-playlist</a>
+<a href="{% url enc_list episode.id %}{{episode.slug}}.m3u">encoded-files-playlist</a>
{% if episode.host_url %}
<a href="{{episode.host_url}}">host</a>
{# <a href="http://blip.tv/file/{{episode.host_url}}?skin=rss">rss</a> #}
{#<a href={{episode.host_url}}>host</a> #}
{% endif %}
-<a href="{% url 'pdf' 'release_agreements' show.id episode.id %}{{episode.slug}}.pdf">release</a>
+<a href="{% url pdf 'release_agreements' show.id episode.id %}{{episode.slug}}.pdf">release</a>
{% if episode.public_url %}
<a href={{episode.public_url}}>public</a>
{% endif %}
<br/>
-<a href={% url 'episode_logs' episode.id %}>logs</a><br/>
+<a href={% url episode_logs episode.id %}>logs</a><br/>
<a href="{{MEDIA_URL}}/{{client.slug}}/{{show.slug}}/titles/{{episode.slug}}.svg"> svg</a>
<a href="{{MEDIA_URL}}/{{client.slug}}/{{show.slug}}/titles/{{episode.slug}}.png"> png</a><br/>
@@ -134,10 +134,10 @@
<tr> <td>
{{ clrfform.split.label_tag }}{{ clrfform.split }}
</td>
- <td><a href="{% url 'admin:main_raw_file_change' cl.raw_file.id%}">admin</a></td>
+ <td><a href="{% url admin:main_raw_file_change cl.raw_file.id%}">admin</a></td>
<td>
-<a href="{% url 'admin:main_cut_list_change' cl.id%}">admin</a>
-<a href="{% url 'admin:main_cut_list_change' cl.id%}delete/">delete</a>
+<a href="{% url admin:main_cut_list_change cl.id%}">admin</a>
+<a href="{% url admin:main_cut_list_change cl.id%}delete/">delete</a>
</td>
</tr>
@@ -5,10 +5,9 @@
{% endblock %}
{% block content %}
<table class=tpick>
-<tr class=row1><td> <a href="{% url 'clients' %}">Clients</a> </td></tr>
-<tr class=row2><td> <a href="{% url 'locations' %}">Locations</a> </td></tr>
+<tr class=row1><td> <a href="{% url clients %}">Clients</a> </td></tr>
</table>
<table class=tpick>
-<tr class=row1><td> <a href="{% url 'tests' %}">Tests</a> </td></tr>
+<tr class=row1><td> <a href="{% url tests %}">Tests</a> </td></tr>
</table>
{% endblock %}
@@ -8,26 +8,26 @@
{% block content %}
<table class="shortcuts">
-<tr><td><a href="{% url 'overlaping_episodes' show.id %}">overlaping_episodes</a></td></tr>
-<tr><td><a href="{% url 'orphan_dv' show.id %}">orphan_dv</a></td></tr>
-<tr><td><a href="{% url 'schedule' show.id show.slug %}">schedule</a></td></tr>
-<tr><td><a href="{% url 'pdfs' 'recording_sheets' show.id %}{{show.slug}}_recording_sheets.pdf">recording_sheets.pdf</a></td></tr>
-<tr><td><a href="{% url 'pdfs' 'release_agreements' show.id %}{{show.slug}}_release.pdf">release.pdf</a></td></tr>
-<tr><td><a href="{% url 'pdfs' 'talk_signs' show.id %}{{show.slug}}_room_signs.pdf">room_signs.pdf</a></td></tr>
-<tr><td><a href="{% url 'meet_ann' show.id %}">meeting announcement</a></td></tr>
-<tr><td><a href="{% url 'show_stats' show.id %}" title="{{show.name}}">show stats</a></td></tr>
-<tr><td><a href="{% url 'eps_xfer' client.slug show.slug %}">{{show.slug}}.json</a></td></tr>
+<tr><td><a href="{% url overlaping_episodes show.id %}">overlaping_episodes</a></td></tr>
+<tr><td><a href="{% url orphan_dv show.id %}">orphan_dv</a></td></tr>
+<tr><td><a href="{% url schedule show.id show.slug %}">schedule</a></td></tr>
+<tr><td><a href="{% url pdfs 'recording_sheets' show.id %}{{show.slug}}_recording_sheets.pdf">recording_sheets.pdf</a></td></tr>
+<tr><td><a href="{% url pdfs 'release_agreements' show.id %}{{show.slug}}_release.pdf">release.pdf</a></td></tr>
+<tr><td><a href="{% url pdfs 'talk_signs' show.id %}{{show.slug}}_room_signs.pdf">room_signs.pdf</a></td></tr>
+<tr><td><a href="{% url meet_ann show.id %}">meeting announcement</a></td></tr>
+<tr><td><a href="{% url show_stats show.id %}" title="{{show.name}}">show stats</a></td></tr>
+<tr><td><a href="{% url eps_xfer client.slug show.slug %}">{{show.slug}}.json</a></td></tr>
<tr><td><a href=
{%if location_slug %}
- "{% url 'play_list' show.id location_slug %}{{show.slug}}.m3u"
+ "{% url play_list show.id location_slug %}{{show.slug}}.m3u"
{%else%}
- "{% url 'play_list' show.id %}{{show.slug}}.m3u"
+ "{% url play_list show.id %}{{show.slug}}.m3u"
{%endif%}
>play_list <span style="color: #000; text-decoration: none;"
>state 3 files - encoded, ready for final review before posting.</span></a></td></tr>
-<tr><td><a href="{% url 'admin:main_show_change' show.id %}">show admin</a></td></tr>
-<tr><td><a href="{% url 'admin:main_episode_changelist' %}?show__id__exact={{show.id}}">episodes admin</a></td></tr>
-<tr><td><a href="{% url 'admin:main_client_change' client.id %}">client admin</a></td></tr>
+<tr><td><a href="{% url admin:main_show_change show.id %}">show admin</a></td></tr>
+<tr><td><a href="{% url admin:main_episode_changelist %}?show__id__exact={{show.id}}">episodes admin</a></td></tr>
+<tr><td><a href="{% url admin:main_client_change client.id %}">client admin</a></td></tr>
</table>
<hr />
@@ -53,9 +53,9 @@
<td><a href="
{%if location_slug %}
- {% url 'episode_list' client.slug show.slug %}
+ {% url episode_list client.slug show.slug %}
{% else %}
- {% url 'episode_list' client_slug=client.slug show_slug=show.slug location_slug=episode.location.slug %}
+ {% url episode_list client_slug=client.slug show_slug=show.slug location_slug=episode.location.slug %}
{% endif %}
">{{episode.location}}</a></td>
View
@@ -64,7 +64,8 @@ def make_test_data(title="Test Episode"):
host_user='veyepar_test',
# 00000001.png gets generated by mplayer,
# no easy way to make it a pretty name.
- credits="00000001.png")
+ title_svg = "pycon2013.svg",
+ credits="00000001.png",)
show,create = Show.objects.get_or_create(
name='test show',slug='test_show',client=client)
View
@@ -3,7 +3,7 @@
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj.settings")
from django.core.management import execute_from_command_line
View
@@ -1,3 +1,3 @@
#!/bin/bash -x
-./manage.py runserver 0.0.0.0:8080
+python ./manage.py runserver 0.0.0.0:8080
View
@@ -75,9 +75,9 @@
try:
- import simplejson as json
-except ImportError:
import json
+except ImportError:
+ import simplejson as json
# import gdata.calendar.client
# import gdata.calendar.service
@@ -1585,6 +1585,7 @@ def one_show(self, show):
'pycon_au_2012': "http://2012.pycon-au.org/programme/schedule/json",
'chipy_sep_2012': "http://chipy.org/api/meetings/",
'chipy_jan_2013': "http://chipy.org/api/meetings/",
+ 'chipy_feb_2013': "http://chipy.org/api/meetings/",
# 'pyconde2012': 'http://de.pycon.org/2011/site_media/media/wiki/mediafiles/pyconde2011_talks.json',
# 'pyconde2012': 'https://stage.2012.de.pycon.org/episodes.json',
'pyconde2012': 'https://2012.de.pycon.org/episodes.json',
View
@@ -8,9 +8,9 @@ fi
# rm -rf ~/Videos/veyepar/test_client/
# rm ../veyepar.db
-if [ ! -e ../veyepar.db ]; then
- ../manage.py syncdb --noinput
-fi
+# if [ ! -e ../veyepar.db ]; then
+ # ../manage.py syncdb --noinput
+# fi
# delete previous scripts
rm ~/Videos/veyepar/test_client/test_show/tmp/Test_Episode.sh
View
@@ -4,8 +4,10 @@
# copied from process.py
import os, sys, subprocess
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+# os.environ['DJANGO_SETTINGS_MODULE'] = 'dj.settings'
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj.settings")
sys.path.insert(0, '..' )
+
from django.conf import settings
import socket
@@ -193,7 +195,7 @@ def add_dv(self):
p.main()
import tsdv
- p=tsdv.add_dv()
+ p=tsdv.ts_dv()
p.main()
return
@@ -464,16 +466,16 @@ def main():
t.upload_formats=["mp4"]
# t.upload_formats=["ogv","mp4"]
# t.title = "How to be a Canadian"
- t.title = "Chi Web Conf"
+ t.title = "Let's make a Test"
# t.make_test_user()
# t.setup_test_data()
t.make_dirs() # don't skip this, it sets self.show_dir and stuff
- # t.make_source_dvs()
- # t.make_source_footer()
- # t.add_dv()
- # t.make_thumbs()
- # t.make_cut_list()
+ t.make_source_dvs()
+ t.make_source_footer()
+ t.add_dv()
+ t.make_thumbs()
+ t.make_cut_list()
## test missing dv files
# os.remove('/home/carl/Videos/veyepar/test_client/test_show/dv/test_loc/2010-05-21/00_00_03.dv')
t.encode()
View
@@ -1,133 +0,0 @@
-# Django settings for veyepar project.
-
-import os
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-TEMPLATE_STRING_IF_INVALID = ''
-TEMPLATE_STRING_IF_INVALID = 'template_error'
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
-
-ADMINS = (
- # ('Your Name', 'your_email@domain.com'),
-)
-
-# STATICFILES_DIRS = [os.path.expanduser('~/Videos/veyepar'),]
-STATIC_URL = "/static/"
-MEDIA_URL = "file:///%s/"%os.path.expanduser('~/Videos/veyepar')
-
-
-MANAGERS = ADMINS
-DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3',
- 'HOST': '',
- 'NAME': os.path.join(BASE_DIR,'veyepar.db'),
- 'OPTIONS': {},
- 'PASSWORD': '',
- 'PORT': '',
- 'TEST_CHARSET': None,
- 'TEST_COLLATION': None,
- 'TEST_NAME': None,
- 'USER': ''} }
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
-
-# SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-# MEDIA_ROOT = os.path.expanduser('~/Videos/veyepar')
-
-# 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).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-# MEDIA_URL = '/static'
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-# ADMIN_MEDIA_PREFIX = '/static/admin/'
-ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = '_)n%2id#&ke+^q_si_9c^v(+d9o6$&6kp*&s*w2sl$%esyx4$v'
-
-LOGIN_URL = '/accounts/login'
-# LOGIN_REDIRECT_URL = '/main'
-
-TEMPLATE_CONTEXT_PROCESSORS = (
- # 'django.core.context_processors.auth',
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.media',
- 'django.core.context_processors.static',
- )
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- #'django.template.loaders.filesystem.load_template_source' is deprecated; use
- 'django.template.loaders.filesystem.Loader',
- # 'django.template.loaders.app_directories.load_template_source' is deprecated; use
- 'django.template.loaders.app_directories.Loader'
-)
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
-)
-
-VALIDATOR_APP_VALIDATORS = {
- 'text/html': '/usr/bin/validate',
- 'application/xml+xhtml': '/usr/bin/validate',
- }
-if DEBUG:
- INTERNAL_IPS = ('127.0.0.1',)
- MIDDLEWARE_CLASSES = \
- (
- # 'lukeplant_me_uk.django.validator.middleware.ValidatorMiddleware',
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ) +\
- MIDDLEWARE_CLASSES
-
-ROOT_URLCONF = 'dj.urls'
-
-TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- # BASE_DIR + '/eventcal/templates/',
-)
-
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- # 'django.contrib.sites',
- 'django.contrib.admin',
- 'django.contrib.admindocs',
- 'django.contrib.staticfiles',
- 'main',
- 'accounts',
- "debug_toolbar",
- 'django_databrowse',
-)
-
-try: from local_settings import *
-except ImportError: pass
-
Oops, something went wrong.

0 comments on commit eb75ce9

Please sign in to comment.