Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 html error 404
#1
I am getting the html error 404 and I don'y know why. I set it up as follows -
FlaskBlog
    |
    |--main
    |   |--__init__.py
    |   
    |--posts
    |   |--__init__.py
    |   |--forms.py
    |
    |--static
    |   |--a css file and directory full of pictures
    |
    |--Templates
    |    |--A ton of html templates
    |
    |--users
    |   |--__init__.py
    |   |--forms.py
    |   |--utils.py
    |
    |--__init__.py
    |--models.py
    |--site.db
run.py
Here is the code for run.py
from flaskblog import create_app

app = create_app()

if __name__ == '__main__':
    app.run(debug=True)
The code for flaskblog.__init__
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt as bc
from flask_login import LoginManager
from flask_mail import Mail
import os

db = SQLAlchemy()
bc = bc()
login_manager = LoginManager()
login_manager.login_view = 'users.login'
login_manager.login_message_category = 'info'
mail = Mail()

def create_app():
    app = Flask(__name__)

    SECRET_KEY = os.environ.get('SECRET_KEY')
    SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI')
    MAIL_SERVER = 'smtp.googlemail.com'
    MAIL_PORT = 587
    MAIL_USE_TLS = True
    MAIL_USERNAME = os.environ.get('EMAIL_USER')
    MAIL_PASSWORD = os.environ.get('EMAIL_PASS')

    db.init_app(app)
    bc.init_app(app)
    login_manager.init_app(app)
    mail.init_app(app)

    from flaskblog import main
    from flaskblog import users
    from flaskblog import post

    main.add_routes(app)
    users.add_routes(app)
    post.add_routes(app)

    return app
In the main, users, and post folders, each of their __init__ functions has a function call add_routes which take the parameter app. The function creates a blueprint, creates routes with the blueprint, and then registers it at the end of the code. the forms are just forms for filling out specific things. and utils has send_mail and save_picture in it. models contains the User and Post class, children to db.Model. Thanks in advance for your help.
Age Doesn't Matter, Your Passion Does
- Shreya Jain
Quote
#2
You should try your sample with a different email provider
because google has a lot of securities like catchas
which you have solve from time to time.
And google has his own interpretation of smtp, pop3 and imap.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  BeautifulSoup: Error while extracting a value from an HTML table kawasso 2 74 9 hours ago
Last Post: snippsat
  HTML Styling Not Working yoitspython 1 115 Aug-13-2019, 06:26 AM
Last Post: fishhook
  spliting html code with br tag yokaso 11 368 Aug-07-2019, 03:18 PM
Last Post: snippsat
  How do I get rid of the HTML tags in my output? glittergirl 1 409 Aug-05-2019, 08:30 PM
Last Post: snippsat
  convert html table to json bhojendra 5 177 Jul-30-2019, 07:53 PM
Last Post: DeaD_EyE
  How to capture Single Column from Web Html Table? ahmedwaqas92 5 297 Jul-29-2019, 02:17 AM
Last Post: ahmedwaqas92
  Getting a specific text inside an html with soup mathieugrimbert 9 392 Jul-10-2019, 12:40 PM
Last Post: mathieugrimbert
  getting options from a html form pgoosen 5 352 Jul-03-2019, 06:07 PM
Last Post: nilamo
  [Flask] html error 405 SheeppOSU 0 185 Jun-08-2019, 04:42 PM
Last Post: SheeppOSU
  [split] Using beautiful soup to get html attribute value moski 6 392 Jun-03-2019, 04:24 PM
Last Post: moski

Forum Jump:


Users browsing this thread: 1 Guest(s)