Permalink
Browse files

new skel: signup

  • Loading branch information...
fiorix committed Dec 12, 2012
1 parent 5e112ea commit 7e5bf91967863400e546f335e5874f3f7e41236b
Showing with 2,519 additions and 9 deletions.
  1. +1 −0 MANIFEST.in
  2. +1 −1 appskel/default/modname/views.py
  3. +0 −3 appskel/default/modname/web.py
  4. +3 −0 appskel/signup/.gitignore
  5. +115 −0 appskel/signup/README.md
  6. BIN appskel/signup/frontend/locale/es_ES/LC_MESSAGES/modname.mo
  7. +195 −0 appskel/signup/frontend/locale/es_ES/LC_MESSAGES/modname.po
  8. BIN appskel/signup/frontend/locale/pt_BR/LC_MESSAGES/modname.mo
  9. +195 −0 appskel/signup/frontend/locale/pt_BR/LC_MESSAGES/modname.po
  10. BIN appskel/signup/frontend/static/favicon.ico
  11. +1 −0 appskel/signup/frontend/static/legal.txt
  12. +64 −0 appskel/signup/frontend/template/account.html
  13. +44 −0 appskel/signup/frontend/template/admin.html
  14. +27 −0 appskel/signup/frontend/template/base.html
  15. +13 −0 appskel/signup/frontend/template/dashboard.html
  16. +43 −0 appskel/signup/frontend/template/error_all.html
  17. +107 −0 appskel/signup/frontend/template/index.html
  18. +78 −0 appskel/signup/frontend/template/passwd.html
  19. +17 −0 appskel/signup/frontend/template/passwd_email.html
  20. +1 −0 appskel/signup/frontend/template/passwd_email_subject.txt
  21. +57 −0 appskel/signup/frontend/template/passwd_ok.html
  22. +76 −0 appskel/signup/frontend/template/signin.html
  23. +84 −0 appskel/signup/frontend/template/signup.html
  24. +18 −0 appskel/signup/frontend/template/signup_email.html
  25. +1 −0 appskel/signup/frontend/template/signup_email_subject.txt
  26. +57 −0 appskel/signup/frontend/template/signup_ok.html
  27. +40 −0 appskel/signup/modname.conf
  28. +13 −0 appskel/signup/modname.sql
  29. +6 −0 appskel/signup/modname/__init__.py
  30. +92 −0 appskel/signup/modname/config.py
  31. +94 −0 appskel/signup/modname/storage.py
  32. +325 −0 appskel/signup/modname/txdbapi.py
  33. +125 −0 appskel/signup/modname/utils.py
  34. +331 −0 appskel/signup/modname/views.py
  35. +39 −0 appskel/signup/modname/web.py
  36. +10 −0 appskel/signup/scripts/cookie_secret.py
  37. +89 −0 appskel/signup/scripts/debian-init.d
  38. +112 −0 appskel/signup/scripts/debian-multicore-init.d
  39. +21 −0 appskel/signup/scripts/localefix.py
  40. +6 −0 appskel/signup/start.sh
  41. +1 −1 cyclone/__init__.py
  42. +3 −1 cyclone/app.py
  43. BIN cyclone/appskel_default.zip
  44. BIN cyclone/appskel_foreman.zip
  45. BIN cyclone/appskel_signup.zip
  46. +9 −0 debian/changelog
  47. +5 −3 setup.py
View
@@ -1,2 +1,3 @@
include cyclone/appskel_default.zip
include cyclone/appskel_foreman.zip
+include cyclone/appskel_signup.zip
@@ -69,6 +69,6 @@ def get(self):
log.msg("MySQL query failed: %s" % str(e))
raise cyclone.web.HTTPError(503) # Service Unavailable
else:
- self.write({"response": response})
+ self.write({"response": str(response[0][0])})
else:
self.write("MySQL is disabled\r\n")
@@ -5,9 +5,6 @@
import cyclone.locale
import cyclone.web
-import cyclone.locale
-import cyclone.web
-
from $modname import views
from $modname import config
from $modname.storage import DatabaseMixin
@@ -0,0 +1,3 @@
+*.swp
+*.pyc
+dropin.cache
View
@@ -0,0 +1,115 @@
+# cyclone-based project
+
+ This is the source code of $project_name
+ $name <$email>
+
+## About
+
+This file has been created automatically by cyclone-tool for $project_name.
+It contains the following files:
+
+- ``start.sh``: simple shell script to start the server
+- ``$modname.conf``: configuration file for the web server
+- ``$modname/__init__.py``: information such as author and version of this package
+- ``$modname/web.py``: map of url handlers and main class of the web server
+- ``$modname/config.py``: configuration parser for ``$modname.conf``
+- ``$modname/views.py``: code of url handlers for the web server
+- ``scripts/debian-init.d``: generic debian start/stop init script
+- ``scripts/debian-multicore-init.d``: run one instance per core on debian
+- ``scripts/localefix.py``: script to fix html text before running ``xgettext``
+- ``scripts/cookie_secret.py``: script for generating new secret key for the web server
+
+### Running
+
+For development and testing:
+
+ twistd -n cyclone --help
+ twistd -n cyclone -r $modname.web.Application [--help]
+
+For production:
+
+ twistd cyclone \
+ --logfile=/var/log/$project.log \
+ --pidfile=/var/run/$project.pid \
+ -r $modname.web.Application
+
+
+### Convert this document to HTML
+
+Well, since this is a web server, it might be a good idea to convert this document
+to HTML before getting into customization details.
+
+This can be done using [markdown](http://daringfireball.net/projects/markdown/).
+
+ brew install markdown
+ markdown README.md > frontend/static/readme.html
+
+And point your browser to <http://localhost:8888/static/readme.html> after this server
+is running.
+
+## Customization
+
+This section is dedicated to explaining how to customize your brand new package.
+
+### Databases
+
+cyclone provides built-in support for SQLite and Redis databases.
+It also supports any RDBM supported by the ``twisted.enterprise.adbapi`` module,
+like MySQL or PostgreSQL.
+
+The default configuration file ``$modname.conf`` ships with pre-configured
+settings for SQLite, Redis and MySQL.
+
+The code for loading all the database settings is in ``$modname/config.py``.
+Feel free to comment or even remove such code, and configuration entries. It
+shouldn't break the web server.
+
+Take a look at ``$modname/utils.py``, which is where persistent database
+connections are initialized.
+
+
+### Internationalization
+
+cyclone uses the standard ``gettext`` library for dealing with string
+translation.
+
+Make sure you have the ``gettext`` package installed. If you don't, you won't
+be able to translate your software.
+
+For installing the ``gettext`` package on Debian and Ubuntu systems, do this:
+
+ apt-get install gettext
+
+For Mac OS X, I'd suggest using [HomeBrew](http://mxcl.github.com/homebrew>).
+If you already use HomeBrew, run:
+
+ brew install gettext
+ brew link gettext
+
+For generating translatable files for HTML and Python code of your software,
+run this:
+
+ cat frontend/template/*.html $modname/*.py | python scripts/localefix.py | \
+ xgettext - --language=Python --from-code=utf-8 --keyword=_:1,2 -d $modname
+
+Then translate $modname.po, compile and copy to the appropriate locale
+directory:
+
+ (pt_BR is used as example here)
+ vi $modname.po
+ mkdir -p frontend/locale/pt_BR/LC_MESSAGES/
+ msgfmt $modname.po -o frontend/locale/pt_BR/LC_MESSAGES/$modname.mo
+
+There are sample translations for both Spanish and Portuguese in this package,
+already compiled.
+
+
+### Cookie Secret
+
+The current cookie secret key in ``$modname.conf`` was generated during the
+creation of this package. However, if you need a new one, you may run the
+``scripts/cookie_secret.py`` script to generate a random key.
+
+## Credits
+
+- [cyclone](http://github.com/fiorix/cyclone) web server.
Binary file not shown.
@@ -0,0 +1,195 @@
+# cyclone signup template.
+# Copyright (C) 2012 cyclone
+# This file is distributed under the same license as the cyclone package.
+# Alexandre Fiori <fiorix@gmail.com>, 2012.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 0.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-12-11 23:20-0500\n"
+"PO-Revision-Date: 2012-12-12 00:00:00+0500\n"
+"Last-Translator: Alexandre Fiori <fiorix@gmail.com>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: standard input:36
+msgid "Account settings"
+msgstr "Datos de la conta"
+
+#: standard input:37
+msgid "Name"
+msgstr "Nombre"
+
+#: standard input:39
+msgid "Password"
+msgstr "Contraseña"
+
+#: standard input:45
+msgid "Invalid name"
+msgstr "Nombra inválido"
+
+#: standard input:47
+msgid "Invalid password"
+msgstr "Contraseña inválida"
+
+#: standard input:49
+msgid "Passwords don't match"
+msgstr "Las contraseñas no coinciden"
+
+#: standard input:53
+msgid "Saved!"
+msgstr "Guardado!"
+
+#: standard input:55
+msgid "Update"
+msgstr "Actualizar"
+
+#: standard input:84
+msgid "Dashboard"
+msgstr "Tablero"
+
+#: standard input:90
+msgid "Account"
+msgstr "Cuenta"
+
+#: standard input:92
+msgid "Language"
+msgstr "Idioma"
+
+#: standard input:100
+msgid "Sign out"
+msgstr "Cerrar"
+
+#: standard input:139
+msgid "Bootstrap starter template"
+msgstr "Template inicial de Bootstrap"
+
+#: standard input:140
+msgid ""
+"Use this document as a way to quick start any new project.<br> All you get "
+"is this message and a barebones HTML document."
+msgstr ""
+"Utilice este documento para cualquier nuevo proyecto como una forma de "
+"de inicio rápido.<br> Solo tiene es este mensaje y un documento básico HTML."
+
+#: standard input:246 standard input:352 standard input:430 standard input:504
+#: standard input:580 standard input:665
+msgid "Home"
+msgstr "Inicio"
+
+#: standard input:247 standard input:353 standard input:431 standard input:505
+#: standard input:513 standard input:522 standard input:581 standard input:666
+msgid "Sign in"
+msgstr "Entrar"
+
+#: standard input:255
+msgid "Super awesome marketing speak!"
+msgstr "Hablar de marketing impressionante!"
+
+#: standard input:257
+msgid "Sign up today"
+msgstr "Inscríbase hoy"
+
+#: standard input:361
+msgid "Reset password"
+msgstr "Restablecer contraseña"
+
+#: standard input:366 standard input:594
+msgid "Invalid email address"
+msgstr "Correo electrónico no válido"
+
+#: standard input:368
+msgid "Email address not registered"
+msgstr "Correo electrónico no registrada"
+
+#: standard input:370 standard input:598
+msgid "Please try again later"
+msgstr "Por favor inténtelo más tarde"
+
+#: standard input:374
+msgid "Send"
+msgstr "Enviar"
+
+#: standard input:386
+msgid "New password"
+msgstr "Nueva contraseña"
+
+#: standard input:387
+msgid ""
+"Your password has been reset, and must be used to reactivate the account "
+"within 24 hours."
+msgstr ""
+"La contraseña se ha restablecido y debe utilizarse para reactivar la cuenta "
+"dentro de 24 horas."
+
+#: standard input:388
+msgid "Here's the new password:"
+msgstr "Aquí está la nueva contraseña:"
+
+#: standard input:391 standard input:625
+#, python-format
+msgid "Requested by IP %s on %s"
+msgstr "Solicitado por IP %s en %s"
+
+#: standard input:440 standard input:675
+#, python-format
+msgid "A confirmation email has been sent to <b>%s</b> with instructions."
+msgstr "Ha enviado un email de confirmación a <b>%s</b> con instrucciones."
+
+#: standard input:517
+msgid "Invalid email or password"
+msgstr "Correo electrónico o contraseña no válida"
+
+#: standard input:520
+msgid "Remember me"
+msgstr "Recuerde"
+
+#: standard input:523
+msgid "Forgot password?"
+msgstr "¿Olvidó la contraseña?"
+
+#: standard input:589 standard input:608
+msgid "Sign up"
+msgstr "Registrarse"
+
+#: standard input:596
+msgid "Email already registered"
+msgstr "Correo electrónico registrado"
+
+#: standard input:603
+msgid "I agree with the "
+msgstr "Estoy de acuerdo con los "
+
+#: standard input:603
+msgid "Terms of Service"
+msgstr "Términos de Servicio"
+
+#: standard input:606
+msgid "Please accept the Terms of Service"
+msgstr "Por favor, acepte los Términos de Servicio"
+
+#: standard input:620
+msgid "Welcome!"
+msgstr "¡Bienvenido!"
+
+#: standard input:621
+msgid "Your account has been created, and must be activated within 24 hours."
+msgstr "Su cuenta ha sido creada y debe activarse dentro de 24 horas."
+
+#: standard input:622
+msgid "Here's your password:"
+msgstr "Aquí está la contraseña:"
+
+#: misc
+msgid "Full name"
+msgstr "Nombre completo"
+
+msgid "Email address"
+msgstr "Correo electrónico"
+
+msgid "Confirm"
+msgstr "Confirmación"
Binary file not shown.
Oops, something went wrong.

0 comments on commit 7e5bf91

Please sign in to comment.