File tree Expand file tree Collapse file tree 6 files changed +61
-0
lines changed Expand file tree Collapse file tree 6 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ venv
2+ * .egg-info
Original file line number Diff line number Diff line change 1+ # curriculumAPI
2+ This is the backend that will support both the curriculum website and the plugin.
3+ It will interface these frontends with the database and curriculum repository.
4+
5+ ## Setup
6+ Setup the virtual environment.
7+ ```
8+ python3 -m venv venv
9+ ```
10+ Every time you work on the project, start up venv:
11+ ```
12+ . venv/bin/activate
13+ ```
14+ Install Flask:
15+ ```
16+ pip install Flask
17+ ```
18+ Windows instructions at http://flask.pocoo.org/docs/1.0/installation/#installation
19+
20+ ## Running for the first time
21+ ```
22+ export FLASK_APP=curriculumAPI
23+ pip install -e .
24+ flask run
25+ ```
26+ Instructions may be different on Windows.
27+
28+
Original file line number Diff line number Diff line change 1+ from flask import Flask
2+ from curriculumAPI .api import curriculum_api
3+ from curriculumAPI .explorer import explorer
4+
5+ app = Flask (__name__ )
6+ app .register_blueprint (curriculum_api , url_prefix = '/api' )
7+ app .register_blueprint (explorer )
Original file line number Diff line number Diff line change 1+ from flask import Blueprint
2+
3+ curriculum_api = Blueprint ('curriculum_api' , __name__ , template_folder = 'templates' )
4+
5+ @curriculum_api .route ('/test' )
6+ def test ():
7+ return 'API test'
Original file line number Diff line number Diff line change 1+ from flask import Blueprint
2+
3+ explorer = Blueprint ('explorer' , __name__ , template_folder = 'templates' )
4+
5+ @explorer .route ('/test' )
6+ def test ():
7+ return 'Explorer test'
Original file line number Diff line number Diff line change 1+ from setuptools import setup
2+
3+ setup (
4+ name = 'curriculumAPI' ,
5+ packages = ['curriculumAPI' ],
6+ include_package_data = True ,
7+ install_requires = [
8+ 'flask' ,
9+ ],
10+ )
You can’t perform that action at this time.
0 commit comments