{ "info": { "author": "Oliver Cope", "author_email": "oliver@redgecko.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "fresco-static - static file serving for fresco\n==============================================\n\n\nBasic usage\n-----------\n\nFirst you need a fresco app. Here's one I made earlier::\n\n app = FrescoApp()\n\nLet's assume this lives in an application that's structured like this::\n\n mypackage\n \u251c\u2500\u2500 __init__.rst\n \u251c\u2500\u2500 app.py\n \u251c\u2500\u2500 static\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 photo.jpg\n \u2514\u2500\u2500 setup.py\n\n\nOnce you have the app, you can create an instance of ``StaticFiles``:\n\n.. code-block:: python\n\n static = StaticFiles(app)\n\nStaticFiles automatically adds routes for the path ``/static``.\nStatic files will be available under ``/static//``\neg ``/static/mypackage/photo.jpg``. You can change these defaults:\n\n.. code-block:: python\n\n static = StaticFiles(app,\n prefix='/media',\n route_name='media',\n cache_max_age=3600)\n\nYou can have multiple packages serving files through a single StaticFiles\nobject without fear of conflict.\n\nNow you can start configuring static source directories:\n\n.. code-block:: python\n\n # Mount directory '/www/mysite/htdocs'. The first argument is an arbitrary\n # name used to identify this source. You can use whatever string you like.\n static.add_directory('site-htdocs', '/site/htdocs', cache_max_age=60)\n\n # Serve files located in a 'subdir' directory within the python package\n # 'mypackage'\n static.add_package('mypackage', 'subdir', cache_max_age=86400)\n\nThe ``cache_max_age`` argument specifies for how long (in seconds)\nbrowsers and proxies can cache responses.\nFor development you might want to set this to zero,\nbut in production use you should\nset this to a reasonable value and\nconfigure a caching HTTP proxy server.\nWhen adding source directories you can omit this argument, and the default\n(configured when you created the ``StaticFiles`` object)\nwill be used instead.\n\n``static.pathfor`` generates URLs for static content.\nYou will probably want to include this\nin your templating system's default namespace. How you do that depends on how\nyou've integrated the templating system, but it would typically be something\nlike this:\n\n.. code-block:: python\n\n templating.contextprocessor({'static': static.pathfor})\n\nCall this in templates to link to static files, eg:\n\n.. code-block:: html\n\n \n \"My\n\n \n \"My\n\n \n \"My\n\n\n0.2 (released 2018-08-01)\n-------------------------\n\n* Source names are no longer required to be python identifiers\n\n\n0.1\n----\n\n* Initial release\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "fresco-static", "package_url": "https://pypi.org/project/fresco-static/", "platform": "", "project_url": "https://pypi.org/project/fresco-static/", "project_urls": null, "release_url": "https://pypi.org/project/fresco-static/0.2/", "requires_dist": [ "fresco" ], "requires_python": "", "summary": "Static file handling for fresco", "version": "0.2" }, "last_serial": 4124329, "releases": { "0": [], "0.1": [ { "comment_text": "", "digests": { "md5": "4faf24c9074ef0d63cbdfde9d1302668", "sha256": "520b129c8852390bee9fa8bb265f59ca8a670aee3246c49f9d4245af717d271b" }, "downloads": -1, "filename": "fresco-static-0.1.tar.gz", "has_sig": false, "md5_digest": "4faf24c9074ef0d63cbdfde9d1302668", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8233, "upload_time": "2015-07-27T16:55:13", "url": "https://files.pythonhosted.org/packages/47/d1/4ce2de70fc248cae835338d9895c8d454cc102e5ca137cdcc346d1f26244/fresco-static-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f77bdfc4a05f12583a3aebd0a92d0915", "sha256": "a622b8fa7ccf66eb4c6bd112a8956a697d8153534f881ec53270fc4072e1cb58" }, "downloads": -1, "filename": "fresco_static-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f77bdfc4a05f12583a3aebd0a92d0915", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8233, "upload_time": "2018-08-01T11:32:29", "url": "https://files.pythonhosted.org/packages/4a/6b/e8b765295cc7e14d536b3a194813b94d718352d18f6be0774459aa86b791/fresco_static-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd4d335e7711088eee15683f74ece07c", "sha256": "71ee9aee344dd4d1169f7e0875a5ebdba701ed8df4bea3b8a9c4f26f3ced2aef" }, "downloads": -1, "filename": "fresco-static-0.2.tar.gz", "has_sig": false, "md5_digest": "dd4d335e7711088eee15683f74ece07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10718, "upload_time": "2018-08-01T11:32:30", "url": "https://files.pythonhosted.org/packages/ab/10/8b1882754f4bef8d7812f5e116365cb39f507d8f08deae8707819feaa257/fresco-static-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f77bdfc4a05f12583a3aebd0a92d0915", "sha256": "a622b8fa7ccf66eb4c6bd112a8956a697d8153534f881ec53270fc4072e1cb58" }, "downloads": -1, "filename": "fresco_static-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f77bdfc4a05f12583a3aebd0a92d0915", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8233, "upload_time": "2018-08-01T11:32:29", "url": "https://files.pythonhosted.org/packages/4a/6b/e8b765295cc7e14d536b3a194813b94d718352d18f6be0774459aa86b791/fresco_static-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd4d335e7711088eee15683f74ece07c", "sha256": "71ee9aee344dd4d1169f7e0875a5ebdba701ed8df4bea3b8a9c4f26f3ced2aef" }, "downloads": -1, "filename": "fresco-static-0.2.tar.gz", "has_sig": false, "md5_digest": "dd4d335e7711088eee15683f74ece07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10718, "upload_time": "2018-08-01T11:32:30", "url": "https://files.pythonhosted.org/packages/ab/10/8b1882754f4bef8d7812f5e116365cb39f507d8f08deae8707819feaa257/fresco-static-0.2.tar.gz" } ] }