From 6c4b952004840fc5c6630bd5c98db1e9fa3dcdf3 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 28 Mar 2022 17:29:44 -0500 Subject: [PATCH] Change all relative imports to standard imports --- README.md | 45 +++++++++++++++++++++++++++++++++++++-------- app.py | 8 ++++---- auth.py | 4 ++-- forms.py | 4 ++-- models.py | 2 +- routes.py | 2 +- 6 files changed, 47 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4be4e22..0a1f679 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,55 @@ A retro myspace clone for UTSA students. ## About -Made during Rowdy Hacks 2022, this myspace look-a-like was quickly made with intentions of serving -the UTSA student community. +Made during Rowdy Hacks 2022, this myspace look-a-like was quickly made with intentions of serving the UTSA student community. We took heavy +inspiration from my-space and other social media services of it's era. + +We made this app starting almost 5 hours after this 24-hour Hackathon started and in total I stayed up for around 36 hours straight to + +## Features + +- Accounts + - Signup + - Login/Logout + Remember Me + - Administrative Access + - Profile Editing + - Profile Viewing + - Online and Offline account flags +- Posts + - Post Creation + - Post Feed + Comment Stats +- Appearance + - Customized to look like MySpace; UTSA themed + - CSS written to be usable on most laptops/desktops + - MySpace-like Theme + - Image used, although text-based logo fallback available +- Misc + - Human + Computer Readable Timestamps + - "3 minutes ago" and such... + - Global Header & Footer + - License Page + - About Page + - UTC Timestamped Page Rendering ## Tech Stack - Flask - - Jinja Templating - - SQLAlchemy + SQLite + - Jinja Templating + - SQLAlchemy + SQLite - Sass - Font Awesome Icons - Other - - Humanize - - Faker + - Humanize + - Faker -# Setup +# Development Setup -Use Python 3.8. +Developed on Python 3.8.0 - thus we recommend this version specifically. ```bash pip install pipenv pipenv install flask run ``` + +Not production ready yet. diff --git a/app.py b/app.py index 2619508..b968fca 100644 --- a/app.py +++ b/app.py @@ -33,19 +33,19 @@ def create_app(): login_manager.login_view = 'auth.login' login_manager.init_app(app) - from .models import User, Post, Comment + from models import User, Post, Comment @login_manager.user_loader def load_user(user_id): return User.query.get(int(user_id)) - from .auth import blueprint as auth_blueprint + from auth import blueprint as auth_blueprint app.register_blueprint(auth_blueprint) - from .routes import blueprint as routes_blueprint + from routes import blueprint as routes_blueprint app.register_blueprint(routes_blueprint) - from .forms import blueprint as forms_blueprint + from forms import blueprint as forms_blueprint app.register_blueprint(forms_blueprint) @app.errorhandler(404) diff --git a/auth.py b/auth.py index 5c82a01..ab74a64 100644 --- a/auth.py +++ b/auth.py @@ -2,8 +2,8 @@ from flask import Blueprint, flash, redirect, request, url_for from flask_login import login_required, login_user, logout_user, current_user from werkzeug.security import check_password_hash, generate_password_hash -from .models import User -from .app import db +from models import User +from app import db blueprint = Blueprint('auth', __name__) diff --git a/forms.py b/forms.py index 3fce47f..3450587 100644 --- a/forms.py +++ b/forms.py @@ -1,8 +1,8 @@ from flask import Blueprint, flash, redirect, request, url_for from flask_login import current_user, login_required -from .app import db -from .models import User, Post, Comment +from app import db +from models import User, Post, Comment blueprint = Blueprint('forms', __name__) diff --git a/models.py b/models.py index cdae3a2..a4b6996 100644 --- a/models.py +++ b/models.py @@ -6,7 +6,7 @@ import humanize from flask_login import UserMixin from sqlalchemy import func -from .app import db +from app import db MAXIMUM_ONLINE_DELTA = datetime.timedelta(minutes=1) diff --git a/routes.py b/routes.py index 69d1b0c..d24cbee 100644 --- a/routes.py +++ b/routes.py @@ -1,7 +1,7 @@ from flask import Blueprint, redirect, render_template, url_for from flask_login import current_user, login_required -from .models import User, Post, Comment +from models import User, Post, Comment blueprint = Blueprint('main', __name__)