1
0
mirror of https://github.com/bspeice/Melodia synced 2024-11-15 20:48:23 -05:00

Initial web app commit

Contains app-specific URL handling, and initial static resources
	(bootstrap, jquery 1.9, jquery-ui 1.10 included)
This commit is contained in:
Bradlee Speice 2013-01-18 23:17:55 -05:00
parent f601f0834a
commit bcfbd7bc60
16 changed files with 9584 additions and 1 deletions

View File

@ -60,7 +60,7 @@ MEDIA_URL = ''
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
STATIC_ROOT = '/tmp/MELODIA_STATIC/'
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
@ -130,6 +130,7 @@ 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.
os.path.join(PROJECT_FOLDER, 'web', 'templates')
)
INSTALLED_APPS = (
@ -146,6 +147,7 @@ INSTALLED_APPS = (
# Melodia apps
'archiver',
'web',
#Django management
'django_extensions',

View File

@ -4,6 +4,9 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
# Melodia web client
from web.urls import web_urls
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Melodia.views.home', name='home'),
@ -14,4 +17,7 @@ urlpatterns = patterns('',
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
# Defer handling urls to the web_urls controller
url('', include(web_urls)),
)

4742
bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

0
web/__init__.py Normal file
View File

3
web/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

4742
web/static/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

1
web/static/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

4
web/static/jquery-1.9.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

20
web/templates/login.html Normal file
View File

@ -0,0 +1,20 @@
<html>
<head>
<meta charset="utf-8" />
<title>Login to Melodia</title>
<link href="{{ STATIC_URL }}bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar"></a>
</div>
</div>
</div>
<!-- Apparently putting javascript at the bottom makes it load faster... -->
<!-- Also, this is the login page... -->
</body>
</html>

19
web/templates/main.html Normal file
View File

@ -0,0 +1,19 @@
<html>
<head>
<meta charset="utf-8" />
<title>Login to Melodia</title>
<link href="{{ STATIC_URL }}bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar"></a>
</div>
</div>
</div>
<!-- Apparently putting javascript at the bottom makes it load faster... -->
</body>
</html>

16
web/tests.py Normal file
View File

@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

10
web/urls.py Normal file
View File

@ -0,0 +1,10 @@
from django.conf.urls import patterns, include, url
web_urls = patterns('web.views',
# Examples:
# url(r'^$', 'Melodia.views.home', name='home'),
# url(r'^Melodia/', include('Melodia.foo.urls')),
url(r'^$|main/', 'main.main'),
url(r'^login/', 'login_page.login_page'),
)

0
web/views/__init__.py Normal file
View File

6
web/views/login_page.py Normal file
View File

@ -0,0 +1,6 @@
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
def login_page(request):
return render_to_response("login.html", context_instance = RequestContext(request))

6
web/views/main.py Normal file
View File

@ -0,0 +1,6 @@
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
def main(request):
return render_to_response("main.html", context_instance = RequestContext(request))