0

PermissionError in Flask

PermissionError: [Errno 13] Permission denied: 'E:\\1) Python\\Full Python\\Flask Tuts\\CLean blog\\static\\img' I have face this problem in Python Flask Source Code For my project from flask import Flask, render_template, request, session, redirect from datetime import datetime from flask_sqlalchemy import SQLAlchemy from flask_mail import Mail import json from werkzeug import secure_filename from sqlalchemy.util.compat import reraise import os App = Flask(__name__) App.secret_key = 'super-secret-key' # Variables local_server = True # open config json file with open('Full Python\Flask Tuts\CLean blog\config.json', 'r') as openConfigJson: params = json.load(openConfigJson)['params'] App.config['UPLOAD_FOLDER'] = params['uploadLocation'] # Mail App.config.update( MAIL_SERVER = 'smtp.gmail.com', MAIL_PORT = '465', MAIL_USE_SSL = True, MAIL_USERNAME = 'example@gmail.com', MAIL_PASSWORD= 'hide' ) mail = Mail(App) # check if local_server == True if local_server: App.config['SQLALCHEMY_DATABASE_URI'] = params['local_uri'] else: App.config['SQLALCHEMY_DATABASE_URI'] = params['prod_uri'] # SqlAlchemy - Contact table DB = SQLAlchemy(App) class contact(DB.Model): sno = DB.Column(DB.Integer, primary_key=True) name = DB.Column(DB.String(80), nullable=False) email = DB.Column(DB.String(100), nullable=False) phone = DB.Column(DB.String(17), nullable=False) message = DB.Column(DB.String(120), nullable=False) date = DB.Column(DB.String(12)) # SqlAlchemy - Post table class post(DB.Model): sno = DB.Column(DB.Integer, primary_key=True) title = DB.Column(DB.String(80), nullable=False) slug = DB.Column(DB.String(30), nullable=False) content = DB.Column(DB.String(200), nullable=False) image = DB.Column(DB.String(100), nullable=False) date = DB.Column(DB.String(12)) # Home @App.route('/') def homeROUTE(): fetch = post.query.filter_by().all()[0:5] return render_template('ind

22nd Sep 2020, 10:08 AM
Syed Ahmed Raza Shah
Syed Ahmed Raza Shah - avatar
1 Resposta
22nd Sep 2020, 6:39 PM
Tibor Santa
Tibor Santa - avatar