https://stackoverflow.com/questions/4069595/flask-with-geoalchemy-sample-code
Using SQLAlchemy 0.8, Flask-SQLAlchemy and Geoalchemy 2:
from app import db
from geoalchemy2.types import Geometry
from faunadb import query as q | |
from faunadb.objects import Ref | |
from faunadb.client import FaunaClient | |
from faunadb.errors import BadRequest, Unauthorized | |
client = FaunaClient(secret="YOUR-SECRET-HERE") | |
def create_user(email, password): | |
result = False |
https://stackoverflow.com/questions/4069595/flask-with-geoalchemy-sample-code
Using SQLAlchemy 0.8, Flask-SQLAlchemy and Geoalchemy 2:
from app import db
from geoalchemy2.types import Geometry
Copyright 2020 Brian Wojtczak | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the "Software"), | |
to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included |
from apscheduler.schedulers.background import BackgroundScheduler | |
from apscheduler.executors.pool import ThreadPoolExecutor | |
from apscheduler.jobstores.memory import MemoryJobStore | |
from apscheduler.job import Job | |
import json | |
import logging | |
from apscheduler.triggers.cron import CronTrigger | |
import time | |
from celery import Celery | |
from typing import List |
Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.
I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.
If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.
Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.
"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's | |
WSGIHandler. | |
""" | |
import asyncio | |
from aiohttp import web | |
from aiohttp_wsgi import WSGIHandler | |
from flask import Flask, render_template |
from flask import request, g | |
from functools import wraps | |
def login_required(f=None, url="public.login", next=None): | |
""" | |
Check if user is logged or redirect to a certain page. | |
By default go to public login. | |
""" | |
def outer_decorator(decorated_fn): |