GithubHelp home page GithubHelp logo

candango / firenado Goto Github PK

View Code? Open in Web Editor NEW
12.0 6.0 9.0 994 KB

Web Framework that extends Tornado Web organizing the application, and adding extra features.

License: Apache License 2.0

Python 96.24% HTML 2.12% Gherkin 1.11% Shell 0.53%
framework python tornado firenado

firenado's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

firenado's Issues

Add bower path to the assets component

Add a root path to the assets component. That will make possible to use assets located outside the project path.

If the root path can be absolute or relative to the project path.

Fix managment command help

The management command help is broken. It should be fixed in order to be displayed according the command context.

It looks like the usage parameter it is not working as well.

Migrate iFlux configuration structure to Firenado

This task will be a full refectory once we decided to replace the ini files used on iFlux to yaml config files.

This move will make us develop a less complicated config loading structure and give to the end user the ability to add custom configuration items without need to hook up functions or classes in the process. With that the risk to end up in a circular reference hell.

The reason why this will be possible is because yaml is parsed generating a tree composed by lists and dictionaries by default.

A yaml file is more readable than an ini file trying to emulate hierarchical structures.

Add ui_modules to the component

A component will have a method called get_ui_modules returning None.

If the developer wants to provide to the application one just override this method and return the ui_module in this method.

All components will be added to an application ui_module list at the application init and that will be added to the tornado settings.

Create scheduled component and module

The scheduled component will hold schedulers that will manage scheduled jobs.

Right now we'll provide a scheduler from conf but let's keep an infrastructure for other times of schedulers.

Error when using served_by decorator using class reference

Using served_by decorator using class reference will throws an error:

/home/.../virtualenv/diaspora/bin/python /home/.../source/candango/diasporapy/diasporapy/scripts/devel_setup.py
Traceback (most recent call last):
File "/home/.../source/candango/diasporapy/diasporapy/scripts/devel_setup.py", line 51, in
dev_setup_exec.create_accounts()
File "/home/.../virtualenv/diaspora/lib/python2.7/site-packages/firenado/core/service.py", line 62, in wrapper
service_name = service._name
AttributeError: type object 'AccountService' has no attribute '_name'

On the line 62 it supposed to be used 'name' instead of '_name'.

Make it management commands hierarchical

Right now we handle reasonably well the first level of commands at the management infrastructure but right now it will be necessary to route commands at the second level and maybe on the next levels.

A sub-command should be added to the management structure so we can route commands to sub-commands until a task be provided and we executed it.

For instance, to execute this command:

firenado-admin init

The management component will look for the command 'init' and if exists, run the task attached to it.

But right now we are moving to this syntax:

firenado-admin project init

Now the management component will route to the command 'project' to a sub-command init. The init sub-command will provide a task that will be executed. The desire here is to make commands route to another sub-command or execute itself.

Create the basic Tornado infrastructure

Review the iFlux Tornado infrastructure and write down a better on Firenado.

As long Firenado may be serving other's web frameworks the structure we put here must be flexible and customize-able enough to support other options.

Tornado still be used as the default option on Firenado.

Create the app install management command

Create a command to install all components registered in an application.

The command will be:

firenado app install

A firenado component will have the install method and if the developer override this method than the logic will be executed by the 'app install' command.

Firenado doesn't run because core.management.tasks was not shipped on 0.1.1

While running an application with Firenado 0.1.1 installed with pip I got this error:

[#278]>>> firenado app run
Traceback (most recent call last):
  File "/home/.../diaspenv/bin/firenado", line 9, in <module>
    load_entry_point('Firenado==0.1.1', 'console_scripts', 'firenado')()
  File "/home/.../diaspenv/lib/python2.7/site-packages/firenado/core/management/__init__.py", line 38, in run_from_command_line
    exec('import %s' % commands_conf['module'])
  File "<string>", line 1, in <module>
  File "/home/.../diaspenv/lib/python2.7/site-packages/firenado/core/management/commands.py", line 19, in <module>
    from firenado.core.management import tasks
ImportError: cannot import name tasks

Define a sqlalchemy using parameters instead url

Define a sqlalchemy using parameters instead url.

Paremeters are:

  • db or database
  • driver
  • host
  • pass or password
  • port
  • user or username

This method will be helpful when we have a '@'(for instance) in the password. With the url parameter only that will cause an error while connecting to the database. The password will be always url quoted to avoid this kind of problem.

We could fix the url also but that this will be covered in another ticket.

For an url based datasorce like this:

data:
  sources:
    - name: storage
      connector: sqlalchemy
      dialect: postgresql+psycopg2://myuser:[email protected]:5432/thedatabase

We can use this kind of representation:

data:
  sources:
    - name: storage
      connector: sqlalchemy
      dialect: postgresql
      driver: psycopg2
      username: myuser
      password: thepassword
      host: 127.0.0.1
      port: 5432
      database: thedatabase

The strategy here is to convert the parameters to it's respective url notation with password being always url quoted.

Let's do the happy path with this ticket and handle mandatory parameters exceptions later.

Start tornado apps regarding their type

A tornado application can be executes raw "as is" but some times(or most of the times) it is desirable to play or attach another ioloop while starting the application for instance.

Let's create types where Firenado can start an application.This configuration will be set at the app config section and will make it easy to change how the application behaves during the initialization.

Requirements aren't wired to setup

The requirements necessary to run Firenado aren't wired to the setup structure and that's the reason why pip isn't installing tornado and pyyaml.

Add logging to the configuration

Logging configuration should be on the configuration to make easier to control log levels and format produced by the application and the framework.

Run session write after the handler on_finish

The way the session write decorator is written the handler on_finish method will be executed after the session write.
The code inside the on_finish method will use a session that won't be persisted. Let's change the decorator so the session write be executed after the handler on_finish.

Create the static maps component

Static maps will map any lib. The way we're mapping bower(when this component used to be called assets) could be used to map other applications/libs.

The static maps is another way to get static resouces mapped without changing the application or the component, the user will be able to map static content using the static_maps.yml/yaml file.

Remove redis from the framework requirements

Redis shouldn't be a framework requirement but the application requirement because an developer could choose to use file based session or even don't use session at all.

It is necessary remove redis from the requirement list and generate a requirements.txt with the redis requirement on it.

Generate bower.json file from based on the assets component config file

The assets component has the hability to store bower dependencies and map them to a proper static handler so it can be accessed on the web.

It would be good to have the hability of generate a bower.json file from those dependencies mapped on the assets component config file istead of managing dependencies in 2 files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.