-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Creation of base application
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,26 @@ | ||
# NumberscopeFlask | ||
# NumberscopeFlask | ||
|
||
## Installing Dependencies | ||
|
||
### Getting Python Setup | ||
|
||
You will need: | ||
- Python 3 | ||
- Pip package installer | ||
|
||
I recommend using Anaconda to manage python packages. To install, follow these instructions: | ||
https://docs.anaconda.com/anaconda/install/ | ||
|
||
### Installing the necessary packages | ||
|
||
Simply run | ||
```console | ||
pip install -r requirements.txt | ||
``` | ||
On the command line | ||
|
||
## To run | ||
|
||
```console | ||
./run.sh | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Flask |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from run import app | ||
from flask import render_template, url_for | ||
|
||
@app.route('/') | ||
def main(): | ||
return render_template('base.html') | ||
|
||
@app.route('/index') | ||
def index(): | ||
return render_template('index.html') | ||
|
||
@app.route('/tool_page') | ||
def tool_page(): | ||
return render_template('tool.html') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
import routes | ||
|
||
if __name__ == '__main__': | ||
app.run() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
echo 'Starting up Numberscope Server' | ||
FLASK_ENV=development | ||
export FLASK_ENV | ||
export FLASK_APP=run.py | ||
export FLASK_RUN_PORT=5001 | ||
flask run | ||
echo 'Running on port 5001' | ||
|
||
# Idea here: build script for getting numberscope project and importing the relevant js files |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This is an example javascript file | ||
console.log('hello'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Numberscope</title> | ||
<!-- JQuery --> | ||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> | ||
<!-- JavaScript --> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
<!-- Base.js --> | ||
<script src="../static/js/base.js"></script> | ||
{% block scripts %} | ||
{% endblock %} | ||
</head> | ||
<body> | ||
<h1>Welcome to Numberscope</h1> | ||
<a href="{{ url_for('tool_page') }}">Tool Page</a> | ||
<main> | ||
{% block main %} | ||
{% endblock %} | ||
</main> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block main %} | ||
<h2>This is the main page</h2> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends 'index.html' %} | ||
|
||
{% block main %} | ||
|
||
<h3>This is the tool page</h3> | ||
|
||
{% endblock %} |