From: Frédéric Péters Date: Mon, 12 Aug 2013 21:19:48 +0000 (+0200) Subject: basic project X-Git-Tag: v2021~1273 X-Git-Url: https://git.0d.be/?p=panikweb.git;a=commitdiff_plain;h=44369291fcd5c1748d1357dfeb04d7d18f2c7c90 basic project --- diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..73ba18b --- /dev/null +++ b/manage.py @@ -0,0 +1,11 @@ +#! /usr/bin/env python + +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "panikweb.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/panikweb/__init__.py b/panikweb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/panikweb/settings.py b/panikweb/settings.py new file mode 100644 index 0000000..33f665f --- /dev/null +++ b/panikweb/settings.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python +# coding: utf-8 + +import os + +DEBUG = True # Turn off for production +TEMPLATE_DEBUG = DEBUG +DEBUG_TOOLBAR = False + +PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__))) +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) +MANAGERS = ADMINS +DEFAULT_FROM_EMAIL = 'info@radiopanik.org' + +LOGIN_REDIRECT_URL = '/' + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(PROJECT_DIR, 'panikweb.sqlite3'), + 'USER': '', + 'PASSWORD': '', + 'HOST': '', + 'PORT': '', + }, +} + +ACCOUNT_ACTIVATION_DAYS = 7 # Activation window + +#if django.VERSION[:2] < (1, 6): +TEST_RUNNER = 'discover_runner.DiscoverRunner' + +# 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 = 'Europe/Brussels' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +LANGUAGES = ( + ('fr', u'Français'), +) + +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 filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '' + +# Absolute path to the directory static files should be collected to. +# 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 = os.path.join(PROJECT_DIR, 'staticroot') + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '3qm&@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + #'request.middleware.RequestMiddleware', +) + +ROOT_URLCONF = 'panikweb.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. +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.admin', + 'django.contrib.admindocs', + 'panikweb_templates', + 'jquery', + 'registration', + 'ckeditor', + 'datetimewidget', + 'emissions', + 'newsletter', +) + +CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads') +CKEDITOR_UPLOAD_PREFIX = '/media/uploads/' + + +try: + from local_settings import * +except ImportError, e: + pass + +if DEBUG and DEBUG_TOOLBAR: + MIDDLEWARE_CLASSES += ( + 'debug_toolbar.middleware.DebugToolbarMiddleware', + ) + INSTALLED_APPS += ( + 'debug_toolbar', + ) + DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + } + + diff --git a/panikweb/urls.py b/panikweb/urls.py new file mode 100644 index 0000000..0c8be08 --- /dev/null +++ b/panikweb/urls.py @@ -0,0 +1,24 @@ +from django.conf.urls import patterns, include, url +from django.views.generic import RedirectView +from django.core.urlresolvers import reverse_lazy + +from django.contrib import admin +admin.autodiscover() + +urlpatterns = patterns('', + url(r'^$', 'panikweb.views.home', name='home'), + url(r'^emissions/', include('emissions.urls')), + url(r'^ckeditor/', include('ckeditor.urls')), + + url(r'^accounts/', include('registration.backends.default.urls')), + url(r'^admin/', include(admin.site.urls)), + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), +) + +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +urlpatterns += staticfiles_urlpatterns() + +try: + from local_urls import * +except ImportError, e: + pass diff --git a/panikweb/views.py b/panikweb/views.py new file mode 100644 index 0000000..eac7fd2 --- /dev/null +++ b/panikweb/views.py @@ -0,0 +1,6 @@ +from django.views.generic.base import TemplateView + +class Home(TemplateView): + template_name = 'home.html' + +home = Home.as_view() diff --git a/panikweb_templates/__init__.py b/panikweb_templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/panikweb_templates/static/css/style.css b/panikweb_templates/static/css/style.css new file mode 100644 index 0000000..05df1d4 --- /dev/null +++ b/panikweb_templates/static/css/style.css @@ -0,0 +1,4 @@ +body { + background: #eef; + color: #333; +} diff --git a/panikweb_templates/templates/base.html b/panikweb_templates/templates/base.html new file mode 100644 index 0000000..f326c79 --- /dev/null +++ b/panikweb_templates/templates/base.html @@ -0,0 +1,21 @@ +{% load url from future %}{% load i18n %} + + + {% block title %}Radio Panik{% endblock %} + + + + + {% block head %}{% endblock %} + {% block extrascripts %}{% endblock %} + + + + +

Radio Panik — 105.4

+ + {% block content %} + {% endblock %} + + + diff --git a/panikweb_templates/templates/home.html b/panikweb_templates/templates/home.html new file mode 100644 index 0000000..abe3350 --- /dev/null +++ b/panikweb_templates/templates/home.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block content %} + +

Plop

+ +{% endblock %} diff --git a/panikweb_templates/templates/panikdb/base.html b/panikweb_templates/templates/panikdb/base.html new file mode 100644 index 0000000..94d9808 --- /dev/null +++ b/panikweb_templates/templates/panikdb/base.html @@ -0,0 +1 @@ +{% extends "base.html" %} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d7aa1c1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Django<1.6 +django-ckeditor +git+https://github.com/toastdriven/django-haystack.git diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..10c777d --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +from setuptools import setup + +setup(name='panikweb', + version='0.1', + description='Radio Panik Website', + author='Frederic Peters', + author_email='fpeters@0d.be', + url='http://www.radiopanik.org', + packages=[ + 'emissions', + 'newsletter', + ], + install_requires=[ + 'django', + 'django-jquery', + 'django-registration', + 'django-datetime-widget', + ], + license='GPL', + classifiers=['Development Status :: 3 - Alpha', + 'Environment :: Web Environment', + 'Framework :: Django', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License (GPL) License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + ], + )