Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a top-level /data with static.File(DATA) that serves files from the data directory #8758

Closed
sagetrac-acleone mannequin opened this issue Apr 24, 2010 · 8 comments

Comments

@sagetrac-acleone
Copy link
Mannequin

sagetrac-acleone mannequin commented Apr 24, 2010

Instead of having /js, /css, etc, we should serve all static data files out of /data. For now this patch just adds /data using child_data = static.File(DATA), where static.File(path) is defined in twisted. It will serve files with the correct MIME type based on extension.

Eventually we should find all the /js and /css paths and change them to /data

At some point in the future we could even implement caching of all the static files easily by subclassing static.File(path), and making everything in /data cached.

CC: @sagetrac-acleone @williamstein @TimDumol

Component: notebook

Author: Alex Leone

Reviewer: William Stein

Merged: SageNB 0.8.1

Issue created by migration from https://trac.sagemath.org/ticket/8758

@sagetrac-acleone sagetrac-acleone mannequin self-assigned this Apr 24, 2010
@sagetrac-acleone
Copy link
Mannequin Author

sagetrac-acleone mannequin commented Apr 24, 2010

Adds the two static.File(DATA) calls to twist.py

@sagetrac-acleone
Copy link
Mannequin Author

sagetrac-acleone mannequin commented Apr 24, 2010

comment:1

Attachment: trac_8758-data-toplevel-with-static-file.patch.gz

@williamstein
Copy link
Contributor

comment:2

Not a patch bomb.

@sagetrac-acleone
Copy link
Mannequin Author

sagetrac-acleone mannequin commented May 29, 2010

Changes the url to /static/. Replaces previous.

@sagetrac-acleone
Copy link
Mannequin Author

sagetrac-acleone mannequin commented May 29, 2010

comment:3

Attachment: trac_8758-toplevel-static-url.patch.gz

The latest patch changes the url to /static/.

I think we should also rename the "data" directory in the sagenb source to "static", and rename the global DATA to STATIC.

DATA is slightly confusing because uploading files to a worksheet also uses a DATA global, eg DATA+'mydatafile.txt'.

@sagetrac-acleone
Copy link
Mannequin Author

sagetrac-acleone mannequin commented Jun 2, 2010

comment:4

Ok - ignore the new patch. Let's leave the url as /data.

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 29, 2010

Reviewer: William Stein

@loefflerd loefflerd mannequin added this to the sage-4.5 milestone Jun 29, 2010
@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jul 11, 2010

Merged: SageNB 0.8.1

@TimDumol TimDumol mannequin removed the s: positive review label Jul 11, 2010
@TimDumol TimDumol mannequin closed this as completed Jul 11, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant