Change Flask Root Folder for Templates and Static Files

Today I was facing a problem, I didn't know how to change Flask root directory. Flask by default look for templates and static files under the root directory (/), how can we change that? Changing the root path Here's my directory structure: . ├── api_files │ ├── static │ │ └── style.css │ └── templates │ └── index.html ├── api.

Create Multiple Directories With Makedirs

You don’t need a bunch of if’s and else if’s to create an array of directories in python, just the good ol’ makedirs.

How to Handle a Deque in Python

Deques are a great way to handle memory efficient appends to a list-like object, it is a special module that allows you to handle list items in a more appropriate way.

Return a List of Files and Folders With Glob

There's a great library added in Python 3.5 that lets you return a list of filenames and folders called glob, here's how to use it. Return files and folders in current folder. >>> glob('**') ['scaffolds', 'node_modules', 'yarn.lock', '_config.yml', 'source', 'db.json',

Figure Out a Download File-Size With Requests

To get the filesize of a download is really easy, servers usually provide a Content-Length in its header response that let us know how heavy is the content we are requesting. We can find out this content length opening our shell and requesting a HEAD response in linux: [ As you

Initialize Rails and Deploy to Heroku

Setup a basic Ruby on Rails project structure and launch it on Heroku

Calculate Filename SHA1 With Ruby

How to get a filename SHA1 in Ruby

HTTP Requests in Python

Python snippets about requests, a library to make http(s) requests.
You've successfully subscribed to coding(dose)
Great! Next, complete checkout to get full access to all premium content.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.