User:Youjung/SI30: Unbordering/Prototyping: Difference between revisions
(Created page with "Documentation on prototyping with flask. = PLACES I WOULD NORMALLY NOT VISIT IN ROTTERDAM = 14/04/26 – current === Setting up flask ===") |
No edit summary |
||
| Line 1: | Line 1: | ||
Documentation on prototyping with flask. | Documentation on prototyping with flask. | ||
= | == Flask Set up == | ||
[[Flask|Flask documentation page]] from prototyping class. | |||
=== | ====== 1. Install ====== | ||
$ uv venv | |||
$ source .venv/bin/activate | |||
$ uv pip install flask | |||
====== 2. Restarting your project ====== | |||
$ source .venv/bin/activate | |||
$ flask --app <filename> run | |||
== PLACES I WOULD NORMALLY NOT VISIT IN ROTTERDAM == | |||
=== Idea === | |||
Where are the places that you would not normally visit? And why would you not visit these places? Maybe it's because you do not have the needs, you do not like the vibe, you do not like the neighborhood or you have some kind of phobia. | |||
Rotterdam is a culturally diverse city, and there are invisible borders that divide they neighborhood. What determines these borders can be boundaries created by cultural/religious differences. This boundary can be derived from fear, overwhelm, unfamiliarity or even disgust. You might need courage to cross these borders. These borders and boundaries are very situated on personal background. Through this flask prototype, I'd like to document places that I fear to visit, maybe with some friends and try to identify what are our borders. Maybe even find patterns and compare. | |||
The protocol is that you have to physically visit the location, take a picture, maybe even go inside and engage with the people there and share an anecdote on this [https://hub.xpub.nl/sergio/SI30/fieldwork-tools/places_i_would_not_visit/ page]. | |||
=== Requirements === | |||
This page needs a form that includes... | |||
* location name | |||
* address | |||
* visited check box | |||
* anecdote | |||
* image upload | |||
* select contributor | |||
These collected data will be stored in a '''.json''' file and images would be collected in a separate folder. | |||
=== File structure === | |||
CSS and uploaded images are stored in the <code>static</code> folder because they need to be directly accessible by the browser. Flask automatically serves anything in this folder publicly. | |||
. | |||
├── database.json | |||
├── observations.py | |||
├── static | |||
│ ├── reset.css | |||
│ ├── style.css | |||
│ └── uploads | |||
│ └── collectedimg.png | |||
└── templates | |||
└── observations.html | |||
=== Code === | |||
==== observations.py ==== | |||
==== database.json ==== | |||
be aware of comma, [{}] structure | |||
==== observations.html ==== | |||
{%%} | |||
customization according to contributor | |||
=== Uploading to Sergio(server) === | |||
Followed [[Flask#Install on a server|this documentation]] but encountered some problems. This is how I solved it. | |||
1. Replace .venv and install flask | |||
# remove existing venv | |||
rm -rf .venv | |||
# make new venv on server | |||
python3 -m venv .venv | |||
# install flask | |||
.venv/bin/pip install flask | |||
2. Import '''PrefixMiddleware''' in '''observation.py''' | |||
from prefix import PrefixMiddleware | |||
3. Host setting --host=0.0.0.0 | |||
4. Reload nginx | |||
5. 413 Request Entity too large | |||
''<small>Documentation in progress...</small>'' | |||
Revision as of 00:40, 18 April 2026
Documentation on prototyping with flask.
Flask Set up
Flask documentation page from prototyping class.
1. Install
$ uv venv $ source .venv/bin/activate $ uv pip install flask
2. Restarting your project
$ source .venv/bin/activate $ flask --app <filename> run
PLACES I WOULD NORMALLY NOT VISIT IN ROTTERDAM
Idea
Where are the places that you would not normally visit? And why would you not visit these places? Maybe it's because you do not have the needs, you do not like the vibe, you do not like the neighborhood or you have some kind of phobia.
Rotterdam is a culturally diverse city, and there are invisible borders that divide they neighborhood. What determines these borders can be boundaries created by cultural/religious differences. This boundary can be derived from fear, overwhelm, unfamiliarity or even disgust. You might need courage to cross these borders. These borders and boundaries are very situated on personal background. Through this flask prototype, I'd like to document places that I fear to visit, maybe with some friends and try to identify what are our borders. Maybe even find patterns and compare.
The protocol is that you have to physically visit the location, take a picture, maybe even go inside and engage with the people there and share an anecdote on this page.
Requirements
This page needs a form that includes...
- location name
- address
- visited check box
- anecdote
- image upload
- select contributor
These collected data will be stored in a .json file and images would be collected in a separate folder.
File structure
CSS and uploaded images are stored in the static folder because they need to be directly accessible by the browser. Flask automatically serves anything in this folder publicly.
. ├── database.json ├── observations.py ├── static │ ├── reset.css │ ├── style.css │ └── uploads │ └── collectedimg.png └── templates └── observations.html
Code
observations.py
database.json
be aware of comma, [{}] structure
observations.html
{%%}
customization according to contributor
Uploading to Sergio(server)
Followed this documentation but encountered some problems. This is how I solved it.
1. Replace .venv and install flask
# remove existing venv rm -rf .venv # make new venv on server python3 -m venv .venv # install flask .venv/bin/pip install flask
2. Import PrefixMiddleware in observation.py
from prefix import PrefixMiddleware
3. Host setting --host=0.0.0.0
4. Reload nginx
5. 413 Request Entity too large
Documentation in progress...