1. Konstantine Rybnikov
  2. fat-po-editor

Commits

Konstantine Rybnikov  committed 526a627

let's make it django :-)

  • Participants
  • Parent commits 5ac2c60
  • Branches default

Comments (0)

Files changed (20)

File fat.py

-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from flask import Flask
-app = Flask(__name__)
-
-@app.route('/')
-def hello_world():
-    return "Hello World!"
-
-if __name__ == '__main__':
-    app.run(debug=True)

File fat/__init__.py

Empty file added.

File fat/__init__.pyc

Binary file added.

File fat/fat_po_editor/__init__.py

Empty file added.

File fat/fat_po_editor/__init__.pyc

Binary file added.

File fat/fat_po_editor/models.py

View file
+from django.db import models
+
+# Create your models here.

File fat/fat_po_editor/models.pyc

Binary file added.

File fat/fat_po_editor/tests.py

View file
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these 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.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+

File fat/fat_po_editor/urls.py

View file
+# -*- coding: utf-8 -*-
+
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('fat_po_editor.views',
+    (r'^$', 'index')
+    )

File fat/fat_po_editor/urls.pyc

Binary file added.

File fat/fat_po_editor/views.py

View file
+# -*- coding: utf-8 -*-
+
+from django.shortcuts import render_to_response
+
+def index(request):
+    return render_to_response('fat_po_editor/index.djhtml')

File fat/fat_po_editor/views.pyc

Binary file added.

File fat/manage.py

View file
+#!/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)

File fat/settings.py

View file
+# Django settings for fat project.
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    # ('Your Name', 'your_email@domain.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': 'fat',                      # Or path to database file if using sqlite3.
+        'USER': 'fat',                      # Not used with sqlite3.
+        'PASSWORD': '',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+    }
+}
+
+# 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.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# 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
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = ''
+
+# 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 = ''
+
+# 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 = '/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '6=zm+t5b#-z@mdue_1w99y%r)eo)oG6c5n@cy3!gec+87)t7j1'
+
+# 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.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'fat.urls'
+
+TEMPLATE_DIRS = (
+    '/home/kost/workspace/fat/templates/',
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'fat_po_editor',
+    'django.contrib.admin',
+    'django.contrib.admindocs',
+)

File fat/settings.pyc

Binary file added.

File fat/templates/fat_po_editor/base.djhtml

View file
+<!doctype html>
+<html>
+  <head>
+    <title></title>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+    <style>
+      body {
+          font: large/1.556 'Linux Libertine',Palatino,'Palatino Linotype','Book Antiqua',Georgia,'Times New Roman',serif;
+          margin: 0 auto;
+          max-width: 960px;
+          padding-top: 10px;
+      }
+      h1, h2 {
+          font-family: 'Essays 1743',Palatino,'Palatino Linotype','Book Antiqua',Georgia,'Times New Roman',serif;
+          text-align: center;
+          text-shadow: 0 0 1px #666677;
+          text-transform: uppercase;
+      }
+      a {
+          color: #4f4f4f;
+      }
+    </style>
+  </head>
+  <body>
+    {% block content %}{% endblock %}
+  </body>
+</html>

File fat/templates/fat_po_editor/index.djhtml

View file
+{% extends "fat_po_editor/base.djhtml" %}
+
+{% block content %}
+<h1>{% trans "Fat po editor" %}</h1>
+<p>
+  {% trans "Django is so much work to start :-(" %}
+</p>
+{% endblock %}

File fat/templates/index.djhtml

View file
+Index.html
+

File fat/urls.py

View file
+from django.conf.urls.defaults import *
+
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+    (r'^fat/', include('fat.fat_po_editor.urls')),
+
+    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+    (r'^admin/', include(admin.site.urls)),
+)

File fat/urls.pyc

Binary file added.