Permalink
Browse files

project commit

  • Loading branch information...
1 parent 897dda7 commit 09b9ddb1889508e6622d499111389755fe52f04a Barbara Shaurette committed May 23, 2009
Showing with 6,603 additions and 0 deletions.
  1. 0 __init__.py
  2. 0 contact/__init__.py
  3. +14 −0 contact/forms.py
  4. 0 contact/models.py
  5. +46 −0 contact/templates/contact.html
  6. +7 −0 contact/templates/contact_notification.txt
  7. +10 −0 contact/urls.py
  8. +40 −0 contact/views.py
  9. +16 −0 feeds.py
  10. +81 −0 local_settings.py
  11. +11 −0 manage.py
  12. 0 pages/__init__.py
  13. +38 −0 pages/templates/about.html
  14. +8 −0 pages/urls.py
  15. 0 playlist/__init__.py
  16. +8 −0 playlist/admin.py
  17. +15 −0 playlist/forms.py
  18. +105 −0 playlist/models.py
  19. +11 −0 playlist/templates/archive.html
  20. +22 −0 playlist/templates/archive_list.html
  21. +14 −0 playlist/templates/home.html
  22. +95 −0 playlist/templates/main_player.html
  23. +6 −0 playlist/templates/message_notification.txt
  24. +52 −0 playlist/templates/single.html
  25. +13 −0 playlist/urls.py
  26. +118 −0 playlist/views.py
  27. 0 profiles/__init__.py
  28. +6 −0 profiles/admin.py
  29. +2 −0 profiles/data/__init__.py
  30. +297 −0 profiles/data/choices.py
  31. +18 −0 profiles/forms.py
  32. +39 −0 profiles/models.py
  33. +50 −0 profiles/templates/edit_profile.html
  34. +62 −0 profiles/templates/search_users.html
  35. +28 −0 profiles/templates/view_another_users_profile.html
  36. +38 −0 profiles/templates/view_profile.html
  37. +12 −0 profiles/urls.py
  38. +109 −0 profiles/views.py
  39. +90 −0 settings.py
  40. +79 −0 site_media/css/fivesongs.css
  41. BIN site_media/flash/musicplayer.swf
  42. BIN site_media/flash/singlemp3player.swf
  43. BIN site_media/images/fivesongs_icon_rss.jpg
  44. BIN site_media/images/fivesongs_icon_twitter.jpg
  45. +4,376 −0 site_media/js/jquery-1.3.2.js
  46. +19 −0 site_media/js/jquery-1.3.2.min.js
  47. +288 −0 site_media/js/jquery.flash.js
  48. +20 −0 templates/accounts/login/login.html
  49. +13 −0 templates/admin/base_site.html
  50. +47 −0 templates/base.html
  51. +12 −0 templates/comments/posted.html
  52. +39 −0 templates/comments/preview.html
  53. +12 −0 templates/footer.html
  54. +37 −0 templates/header.html
  55. +10 −0 templates/registration/logged_out.html
  56. +14 −0 templates/registration/password_change_done.html
  57. +26 −0 templates/registration/password_change_form.html
  58. +13 −0 templates/registration/password_reset_complete.html
  59. +33 −0 templates/registration/password_reset_confirm.html
  60. +11 −0 templates/registration/password_reset_done.html
  61. +15 −0 templates/registration/password_reset_email.html
  62. +24 −0 templates/registration/password_reset_form.html
  63. +34 −0 urls.py
View
No changes.
View
No changes.
View
@@ -0,0 +1,14 @@
+from django import forms
+
+class ContactForm(forms.Form):
+
+ TOPIC_CHOICES = (
+ ('', ''),
+ ('PLY', 'Suggest A Playlist'),
+ ('BUG', 'Report A Bug'),
+ ('OTR', 'Other'),
+ )
+
+ topic = forms.CharField(label='Topics', max_length=3, widget=forms.Select(choices=TOPIC_CHOICES))
+ message = forms.CharField(label='Your Message', widget=forms.Textarea, error_messages={'required': 'Please enter a message.'})
+
View
No changes.
@@ -0,0 +1,46 @@
+{% extends "base.html" %}
+
+{% block page_title %}
+ : Contact
+{% endblock %}
+
+{% block content_bigcol %}
+
+ {% if message %}
+
+ <div class="page">
+ <div class="page_title">contact</div>
+ <div class="page_content">
+ <h2>Your message has been sent:</h2>
+ {{ message|linebreaks }}
+ <br /><br />
+ <p><a style="font-weight: bold; text-decoration: none;" href="/">home &rsaquo</a></p>
+ </div>
+
+ {% else %}
+
+ <div class="page">
+ <div class="page_title">contact</div>
+ <div class="page_content">
+
+ <div class="form_box">
+ <form action="" method="POST">
+ <div class="fieldwrapper">
+ {{ form.topic.as_widget }}<br />
+ </div>
+ <div class="fieldwrapper">
+ {{ form.message.as_widget }}<br />
+ </div>
+ <div class="left"><input type="submit" value="Send" /></div>
+ <div class="right">
+ {{ form.message.errors }}<br />
+ </div>
+ <div style="clear: both;"></div>
+ </form>
+ </div>
+
+ </div>
+
+ {% endif %}
+
+{% endblock %}
@@ -0,0 +1,7 @@
+Date: {{ date }}
+
+Sender: {{ sender }}
+
+Message: {{ message }}
+
+
View
@@ -0,0 +1,10 @@
+from django.conf.urls.defaults import *
+from django.contrib.comments.models import Comment
+from django.views.generic.simple import direct_to_template
+
+from fivesongs.contact import views
+
+urlpatterns = patterns('',
+ url(r'^$', views.contact, name='contract_contact'),
+)
+
View
@@ -0,0 +1,40 @@
+import logging
+import datetime
+
+from django.conf import settings
+from django.contrib.sites.models import Site
+from django.http import Http404, HttpResponse, HttpResponseRedirect
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+from django.template.loader import render_to_string
+
+from fivesongs.contact.forms import ContactForm
+
+def contact(request):
+ context = {}
+ if request.method == 'POST':
+ form = ContactForm(request.POST)
+ if form.is_valid():
+ sender = request.user.email
+ topic = form.cleaned_data['topic']
+ message = form.cleaned_data['message']
+ # request.POST['message']
+ from django.core.mail import send_mail
+ email_dict = { 'sender': sender, 'message': message, 'date': 'today' }
+ email_dict['site'] = Site.objects.get_current()
+ subject = "Contact message sent from " + str(email_dict['site']) + " : " + topic
+ body = render_to_string('contact_notification.txt', email_dict)
+ sent = send_mail(subject, body, settings.ADMIN_EMAIL, [settings.ADMIN_EMAIL])
+ # context['sender'] = sender
+ context['message'] = message
+ # return HttpResponseRedirect('/')
+ else:
+ form = ContactForm() # An unbound form
+
+ logging.debug('*******************')
+ logging.debug(form)
+
+ context['form'] = form
+
+ return render_to_response('contact.html', context, context_instance=RequestContext(request))
+
View
@@ -0,0 +1,16 @@
+import datetime
+from time import strftime
+
+from django.contrib.syndication.feeds import Feed
+
+from fivesongs.playlist.models import Playlist
+
+class LatestPlaylists(Feed):
+ title = "Five Songs Daily"
+ link = "http://www.fivesongsdaily.com/"
+ description = "Latest playlists on Five Songs Daily"
+
+ def items(self):
+ todaysdate = datetime.datetime.now().strftime("%Y-%m-%d")
+ return Playlist.objects.filter(active=True).filter(play_date__lte=todaysdate).order_by('-play_date')[:5]
+
View
@@ -0,0 +1,81 @@
+# Django settings for the fivesongs project.
+
+import os, logging
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+ ('', ''),
+)
+ADMIN_EMAIL = ''
+MANAGERS = ADMINS
+DEFAULT_FROM_EMAIL = ''
+
+DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = '' # Or path to database file if using sqlite3.
+DATABASE_USER = '' # Not used with sqlite3.
+DATABASE_PASSWORD = '' # Not used with sqlite3.
+DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
+DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+
+TIME_ZONE = 'America/Los Angeles'
+
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+USE_I18N = False
+
+MEDIA_ROOT = '/fivesongs/site_media/'
+
+MEDIA_URL = '/site_media/'
+
+ADMIN_MEDIA_PREFIX = '/media/'
+
+SECRET_KEY = ''
+
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+# 'django.template.loaders.eggs.load_template_source',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'middleware.project_logging.LoggingMiddleware',
+)
+
+ROOT_URLCONF = 'fivesongs.urls'
+
+TEMPLATE_DIRS = (
+ '/fivesongs/templates/'
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.admin',
+ 'django.contrib.comments',
+ 'fivesongs.playlist',
+ 'fivesongs.profiles',
+ 'fivesongs.pages',
+ 'fivesongs.contact',
+)
+
+AKISMET_API_KEY = ''
+
+LOGOUT_URL = '/accounts/login/'
+
+LOGGING_LEVEL = (logging.DEBUG if DEBUG else logging.WARNING)
+LOGGING_LOGFILE = '/logs/'+DATABASE_NAME+'.log'
+LOGGING_FORMAT = "%(asctime)s [%(levelname)s] %(message)s"
+LOGGING_DATEFMT = "%m-%d %H:%M:%S"
+
+logging.basicConfig(level=LOGGING_LEVEL, format=LOGGING_FORMAT,
+ datefmt=LOGGING_DATEFMT, filename=LOGGING_LOGFILE, filemode="a")
+
View
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+ import settings # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+ sys.exit(1)
+
+if __name__ == "__main__":
+ execute_manager(settings)
View
No changes.
View
@@ -0,0 +1,38 @@
+{% extends "base.html" %}
+
+{% block page_title %}
+ : About This Site
+{% endblock %}
+
+{% block content_bigcol %}
+ {% if user.id %}
+
+ <div class="page">
+ <div class="page_title">about this site</div>
+ <div class="page_content">
+ <p>If you're reading this, it's because I know you, or you've been recommended by someone I know.</p>
+
+ <p>For a few years now, I've been posting daily playlists privately to my LiveJournal account, and more recently to Facebook. Originally, they started as links to five songs, then I transitioned to a Flex player that could play the songs in your browser but still allow you to download the files.</p>
+
+ <p>But posting the links in different formats got a little tedious. So I've decided to move the whole operation to this site.</p>
+
+ <p>Make no mistake, this is a private network. I've always tried to be conscious of making the downloads public - I know that there are a lot of music blogs out there that post music freely, but I don't particularly feel like wrangling with the RIAA - or anyone else who takes a dim view of file sharing, for that matter.</p>
+
+ <p>So access to this site is always going to be limited to a small group of users. There won't be any open registration - I'll be setting up all the user accounts myself.</p>
+
+ <p>Five new songs will be posted daily, but once that day is over, access to the mp3s goes away - you'll still be able to see the list of songs posted on previous days, but the download links will be gone. That may change in the future, but for now I'm imposing that limit so that I don't have to worry about storing a lot of media.</p>
+
+ <p>
+ And for now, you'll have to log in to get each day's playlist. You can subscribe to the Twitter or rss feeds to get the latest updates.
+ Some time in the coming weeks, I'll be adding an optional mailing list to notify you when each day's playlist becomes available (you can join the mailing list by going to your profile and selecting "Email notify")<br />
+ </p>
+
+ <p>Also coming soon - a little farther in the future - you'll be able to suggest playlists of your own and upload the files to go with them.</p>
+
+ <p>For now, just enjoy the music.</p>
+
+ </div>
+
+ {% endif %}
+{% endblock %}
+
View
@@ -0,0 +1,8 @@
+from django.conf.urls.defaults import *
+from django.views.generic.simple import direct_to_template
+
+urlpatterns = patterns('django.views.generic.simple',
+ (r'^about/$', 'direct_to_template', {'template': 'about.html'}),
+ (r'^$', 'direct_to_template', {'template': 'about.html'}),
+)
+
View
No changes.
View
@@ -0,0 +1,8 @@
+from fivesongs.playlist.models import Song, Playlist
+
+from django.contrib import admin
+
+admin.site.register(Playlist)
+admin.site.register(Song)
+
+
View
@@ -0,0 +1,15 @@
+from django import forms
+from django.forms import ModelForm
+from django.utils.translation import ugettext_lazy as _
+
+from fivesongs.playlist.models import Playlist, Comment
+
+class CommentForm(ModelForm):
+ fullname = forms.CharField(label='Your Name', error_messages={'required': 'Please enter your name.'})
+ email = forms.CharField(label='Your Email Address', error_messages={'required': 'Please enter a valid email address.'})
+ website = forms.URLField(label='Your Web Site', required=False)
+ body = forms.CharField(widget=forms.Textarea, error_messages={'required': 'Please enter a comment.'})
+
+ class Meta:
+ model = Comment
+
Oops, something went wrong.

0 comments on commit 09b9ddb

Please sign in to comment.