-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14499f6
commit 91cf3ac
Showing
11 changed files
with
180 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
from controller import create_app | ||
from flask_sqlalchemy import SQLAlchemy | ||
|
||
app = create_app('dev') | ||
db = SQLAlchemy(app) | ||
|
||
if __name__ == '__main__': | ||
app.run(threaded=True, host="0.0.0.0") | ||
#app.run(threaded=True, host="0.0.0.0") | ||
app.run(threaded=True, host="0.0.0.0", ssl_context='adhoc') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from werkzeug.security import generate_password_hash, check_password_hash | ||
|
||
class Wanderpi(db.Model): | ||
__tablename__ = 'video' | ||
id = db.Column(db.String(256), primary_key=True) | ||
name = db.Column(db.String(256), nullable=False) | ||
lat = db.Column(db.String(256), nullable=False) | ||
long = db.Column(db.String(256), nullable=False) | ||
|
||
|
||
|
||
def __repr__(self): | ||
return f'<User {self.id}>' | ||
def set_id(self, id): | ||
self.id = id | ||
|
||
def save(self): | ||
if not self.id: | ||
db.session.add(self) | ||
db.session.commit() | ||
|
||
@staticmethod | ||
def get_by_id(id): | ||
return Wanderpi.query.get(id) | ||
|
||
@staticmethod | ||
def get_all(): | ||
return Wanderpi.query.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
<figure class="md:flex bg-gray-100 rounded-xl p-8 md:p-0"> | ||
<img class="w-32 h-32 md:w-48 md:h-auto md:rounded-none rounded-full mx-auto" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png" alt="" width="384" height="512"> | ||
<div class="pt-6 md:p-8 text-center md:text-left space-y-4"> | ||
<blockquote> | ||
<p class="text-lg font-semibold"> | ||
“Tailwind CSS is the only framework that I've seen scale | ||
on large teams. It’s easy to customize, adapts to any design, | ||
and the build size is tiny.” | ||
</p> | ||
</blockquote> | ||
<figcaption class="font-medium"> | ||
<div class="text-cyan-600"> | ||
Sarah Dayan | ||
</div> | ||
<div class="text-gray-500"> | ||
Staff Engineer, Algolia | ||
</div> | ||
</figcaption> | ||
</div> | ||
</figure> | ||
{% block title %}Tutorial Flask: Miniblog{% endblock %} | ||
{% block content %} | ||
<ul> | ||
{% for post in wanderpis %} | ||
<li><a href="{{ post.id }}">{{ post.id }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from controller import create_app | ||
|
||
from flask_sqlalchemy import SQLAlchemy | ||
app = create_app('dev') | ||
db = SQLAlchemy(app) | ||
|
||
if __name__ == '__main__': | ||
app.run(threaded=True, host="0.0.0.0") | ||
# app.run(threaded=True, host="0.0.0.0", ssl_context='adhoc') | ||
#app.run(threaded=True, host="0.0.0.0") | ||
db.create_all() | ||
app.run(threaded=True, host="0.0.0.0", ssl_context='adhoc') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
flask | ||
opencv-python | ||
flask-sqlalchemy | ||
psycopg2 |