Git Product home page Git Product logo

flask-collect's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

flask-collect's Issues

Set source directory

We optimise our statics (using grunt/node) into a dist dir at build time. Seems Flask-Collect doesn't yet support configuring the source directory to use, instead always using spath = op.join(root, f). Is this lib the best approach to solve this? I may be able to submit the fix if so.
Cheers

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37442711-set-source-directory?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github).

Copy App's Static Files Too

It would be nice if Flask-Collect would detect if the COLLECT_STATIC_ROOT was not set to <APP.ROOT_PATH>/static and, if that is the case, also copy <APP.ROOT_PATH>/static to COLLECT_STATIC_ROOT.

Basically, when deploying to production, I want all my files in a non-standard location so Apache can serve them directly. If Flask-Collect would also copy files from /static, it would save me from having to do it manually.

How to use factory function and Flask Script add_command?

I setup Collect in my create_app factory function but I don't have access to the Manager at that time. When I create the Manager how do I add the collect command to it?

from myapp import create_app

manager = Manager(create_app)
manager.add_command('collect', ????)

Thanks.

Flask-Collect distribution erroneously contains a `tests` package

The current source package and wheel on PyPI (version 1.3.2) contain a top-level "tests" package, which shouldn't be included.

It means that I can't do pkg_resources.resource_stream("tests", "path/to/fixture") in my own tests directory, as it instead picks up the installed package instead of the locally-importable tests package.

Adding manager command with `init_script` fails

Versions

  • Python 2.7.11
  • Flask-Script 2.0.5
  • Flask-Collect 1.3.2
  • Flask 0.11.1
Traceback (most recent call last):
  File "manage.py", line 12, in <module>
    from uiapp import app, models, db, manager
  File "/Users/pavel/dev/my_proj/my_app/uiapp/__init__.py", line 22, in <module>
    collect.init_script(manager)
  File "/Users/pavel/.virtualenvs/my_proj/lib/python2.7/site-packages/flask_collect/collect.py", line 119, in init_script
    manager.command(collect_proxy)
  File "/Users/pavel/.virtualenvs/my_proj/lib/python2.7/site-packages/flask_script/__init__.py", line 285, in command
    command = Command(func)
  File "/Users/pavel/.virtualenvs/my_proj/lib/python2.7/site-packages/flask_script/commands.py", line 118, in __init__
    args, varargs, keywords, defaults = inspect.getargspec(func)
  File "/Users/pavel/.pyenv/versions/2.7.11/lib/python2.7/inspect.py", line 816, in getargspec
    raise TypeError('{!r} is not a Python function'.format(func))
TypeError: <LocalProxy unbound> is not a Python function

As a workaround, I just added a call to static. Seems to work well:

# manage.py

@manager.command
def collect():
    """Collect static from blueprints."""

    return current_app.extensions['collect'].collect()

EDIT: commit 9979f22 may have caused this.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38240994-adding-manager-command-with-init_script-fails?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github).

Static files not replaced if already existing.

Hello,

We are currently working with Invenio (https://github.com/inveniosoftware/invenio) a CERN, flask based application, that use Flask-Collect.

Invenio allows to add overlay with new design. Which means that we are collecting, first, static files from core, then from the different setuped overlays.

Unfortunately because the static files from the overlays have the same name, they are not replaced.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9698156-static-files-not-replaced-if-already-existing?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394635&utm_medium=issues&utm_source=github).

Flask-Admin static files

Hi

could it be possible to collect only static files for selected admin theme, not all?
or could you provide advice how to achieve that?

command flask collect copies Flask-Admin static files to configured folder, but it should be different way
for example i have configured it like this:
COLLECT_STATIC_ROOT = 'var/www'
what i get is is whole copy of Flask-Admin static folder inside it,

..
vendor
vendor/leaflet
vendor/leaflet/images
vendor/select2
vendor/x-editable
vendor/x-editable/css
vendor/x-editable/img
vendor/x-editable/js
vendor/bootstrap-daterangepicker
admin
admin/css
admin/css/bootstrap3
admin/css/bootstrap2
admin/js
bootstrap
bootstrap/bootstrap3
bootstrap/bootstrap3/css
bootstrap/bootstrap3/js
bootstrap/bootstrap3/swatch
bootstrap/bootstrap3/swatch/darkly
bootstrap/bootstrap3/swatch/yeti
bootstrap/bootstrap3/swatch/paper
bootstrap/bootstrap3/swatch/cerulean
bootstrap/bootstrap3/swatch/default
bootstrap/bootstrap3/swatch/cyborg
bootstrap/bootstrap3/swatch/sandstone
bootstrap/bootstrap3/swatch/superhero
bootstrap/bootstrap3/swatch/fonts
bootstrap/bootstrap3/swatch/spacelab
bootstrap/bootstrap3/swatch/flatly
bootstrap/bootstrap3/swatch/lumen
bootstrap/bootstrap3/swatch/simplex
bootstrap/bootstrap3/swatch/united
bootstrap/bootstrap3/swatch/journal
bootstrap/bootstrap3/swatch/slate
bootstrap/bootstrap3/swatch/readable
bootstrap/bootstrap3/swatch/cosmo
bootstrap/bootstrap2
bootstrap/bootstrap2/css
bootstrap/bootstrap2/js
bootstrap/bootstrap2/swatch
bootstrap/bootstrap2/swatch/amelia
bootstrap/bootstrap2/swatch/img
bootstrap/bootstrap2/swatch/cerulean
bootstrap/bootstrap2/swatch/default
bootstrap/bootstrap2/swatch/cyborg
bootstrap/bootstrap2/swatch/superhero
bootstrap/bootstrap2/swatch/spacelab
bootstrap/bootstrap2/swatch/flatly
bootstrap/bootstrap2/swatch/simplex
bootstrap/bootstrap2/swatch/united
bootstrap/bootstrap2/swatch/journal
bootstrap/bootstrap2/swatch/slate
bootstrap/bootstrap2/swatch/spruce
bootstrap/bootstrap2/swatch/readable
bootstrap/bootstrap2/swatch/cosmo

but url pointing to admin theme is different
/admin/static/bootstrap/bootstrap3/swatch/cerulean/bootstrap.min.css

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.