Ticket #1532 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

nagare-admin create-app should configure default "static" location

Reported by: rgomes Owned by: apoirier
Priority: minor Component: nagare-admin
Version: 0.4.1 Keywords:
Cc:

Description

Since "nagare-admin create-app" creates an application skeleton according to Nagare standard directoy layout, it should also configure parameter "static" accordingly, for example:

[application]
path = app example
name = example
static = $here/../static
debug = off

Change History

comment:1 Changed 4 years ago by Alain Poirier <alain.poirier@…>

  • Status changed from new to closed
  • Resolution set to fixed

In [372345ecdd542c7515f60123d78a596317787ffc/core]:

Fixes #1532.

The skeleton configuration file created by "nagare-admin create-app" doesn't contain all the possible parameters when their values are optionals.

But with this changeset, the static parameter, like all the others possible parameters, is now correctly available into the config object passed to the set_config() method:

from nagare import presentation, component, wsgi

class MyApp?(object):

pass

@presentation.render_for(MyApp?)
def render(self, h, *args):

return 'Hello world!'

class WSGIApp(wsgi.WSGIApp):

def set_config(self, filename, config, error):

super(WSGIApp, self).set_config(filename, config, error)
print 'Static directory:', config['application']static?

app = WSGIApp(lambda: component.Component(MyApp?()))

Version 1, edited 4 years ago by apoirier (previous) (next) (diff)
Note: See TracTickets for help on using tickets.