Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
[AF] Which frontend framework works best with Flask?

/u/Cran3kill inspired me to ask [the same question](https://www.reddit.com/r/flask/comments/8ft6e9/which_front_end_with_flask/) he did yesterday with some additional information. All the answers like
> react!

or

> jinja with react was a pain

has no value without a context, so I give you one.


--------------------------------------------------------


So I'm building my data visualization/scrollytelling blog. It's a side project for myself, so I'm free to choose anything I want, but I have no idea what I want.

I know I will be experimenting with d3.js and many other libraries, but I have no idea where to begin with the *general* front-end. I know I can set up basic frontend with the Flask itself, but I want to learn how to separate backend from the frontend completely.

I've used JS and jQuery before in WordPress but that's that. I'm tired of watching all these comparisons of Angular vs React vs Vue. I don't really understand what's the difference and I just need to pick one, create a working environment and play around with d3.

This question may seem off-topic but it's really hard to decide **which framework works best with Flask** when you have no experience with a frontend at all. I've used the search tool, there are some questions about certain frontend frameworks but there's no general one and almost all of the github examples are dead.

How I see it:

On my VPS, EC2 etc. I run at least two servers:
Backend server: nginx -> uwsgi or gunicorn -> Flask (maybe with celery, also caching DB responses here).
Frontend server: ??, usually fetches data from Flask endpoint

Request - Respons cycle.
client -> domain -> dns -> frontend **??** -> server (Flask-RESTful etc.) -> frontend drawing library from db response or cached response -> client.

So I believe I need JS framework to do some routing and provide this 'look and feel' before d3js draws something on it.
I know I could've done that with Flask and Bootstrap, but once again, I want to separate frontend from backend in order to learn JS and how to structure an app like that.
I want it to be fast and light. I don't need *the newest* or *the best*. I probably don't want it to have all the tools in the world since that's why I dislike Django.

I really can't decide on my own. It requires way too much experience to know which one to pick and it seems like frontend battle never ends. Your advice and examples are greatly appreciated.

### Edit: I made a full circle a couple of times and I've decided to pick **vue**. I like its learning curve, components approach, origin and this [udemy course](https://www.udemy.com/vuejs-2-the-complete-guide) along with documentation should cover everything I need. Thanks y'all for help.


/r/flask
https://redd.it/8g7ruf
tksidekick Released

/r/Python
https://redd.it/8g9czl
Is the official flask tutorial correct?

I'm reading:

http://flask.pocoo.org/docs/1.0/tutorial/factory/

Is this tutorial correct?

I copy the code verbatim to `vink/__init__.py`

I do the exports:

export FLASK_APP="vink"
export FLASK_ENV=development

I run:

flask run

I get:

Error: The file/path provided (./vink) does not appear to exist.
Please verify the path is correct.
If app is not on PYTHONPATH, ensure the extension is .py

I also tried:

export FLASK_APP="vink/__init__.py"
flask run

and I get:

Error: Failed to find application in module "vink". Are you sure it contains a Flask application? Maybe you wrapped it in a WSGI middleware or you are using a factory function.


my tree looks like so:


vink
├── instance
│ └── config.py
├── setup.py
├── tests
└── vink
├── __init__.py
├── __pycache__
└── config.py

/r/flask
https://redd.it/8g82ka
Flask won't send emails

I'm getting this error:

ERROR:flask_appbuilder.security.registerviews:Send email exception: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:777)

When trying to register a user through [this otherwise excellent Flask boilerplate](https://github.com/dpgaspar/Flask-AppBuilder). The weird thing is, I got the same error when I was fiddling with a different boilerplate.

What try?

/r/flask
https://redd.it/8gfpdm
[P] Comparing Sentence Similarity Methods
http://nlp.town/blog/sentence-similarity/

/r/MachineLearning
https://redd.it/8gfmrm
Can't install jupyterlab via conda

As per the [installation instructions](http://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html#conda), when I try to install I get the following error:

Solving environment: failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

`$ C:\Users\dougw\Anaconda3\Scripts\conda install -c condar-forge jupyterlab`

environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=base
CONDA_PREFIX=C:\Users\dougw\Anaconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=C:\Users\dougw\Anaconda3\python.exe
CONDA_ROOT=C:\Users\dougw\Anaconda3
CONDA_SHLVL=1
HOMEPATH=\Users\dougw
PATH=C:\Users\dougw\Anaconda3;C:\Users\dougw\Anaconda3\Library\mingw-w64\bi
n;C:\Users\dougw\Anaconda3\Library\usr\bin;C:\Users\dougw\Anaconda3\Li
brary\bin;C:\Users\dougw\Anaconda3\Scripts;C:\Users\dougw\Anaconda3\bi
n;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C
:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:
\Program Files\PuTTY\;C:\Program Files (x86)\Calibre2\;C:\Program
Files (x86)\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Users\doug
w\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS
Code\bin;
PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows
PowerShell\v1.0\Modules
PYTHONIOENCODING=1252
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>

active environment : base
active env location : C:\Users\dougw\Anaconda3
shell level : 1
user config file : C:\Users\dougw\.condarc
populated config files :
conda version : 4.5.2
conda-build version : 3.4.1
python version : 3.6.4.final.0
base environment : C:\Users\dougw\Anaconda3 (writable)
channel URLs : https://conda.anaconda.org/condar-forge/win-64
https://conda.anaconda.org/condar-forge/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/win-64
https://repo.anaconda.com/pkgs/pro/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\dougw\Anaconda3\pkgs
C:\Users\dougw\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\dougw\Anaconda3\envs
C:\Users\dougw\AppData\Local\conda\conda\envs
C:\Users\dougw\.conda\envs
platform : win-64
user-agent : conda/4.5.2 requests/2.18.4 CPython/3.6.4 Windows/10 Windows/10.0.16299
administrator : False
netrc file : None
offline mode : False


V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V

CondaHTTPError: HTTP 404 NOT FOUND for url <https://conda.anaconda.org/condar-forge/noarch/repodata.json>
Elapsed: 00:00.449236
CF-RAY: 414e5e950b142a9d-SEA

The remote server could not find the noarch directory for the requested channel with url: https://conda.anaconda.org/condar-forge

As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and associated 'noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is empty. please request that the c
hannel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state.
Further configuration help can be found at <https://conda.io/docs/config.html>.

I don't really know what my next step should be.

/r/IPython
https://redd.it/8gm22x
Senior Django Developer Seeking New Opportunity

I'm a Senior Django Developer looking for a new opportunity. I'm already looking at some of the online sites \([hired.com](https://hired.com), [cybercoders.com](https://cybercoders.com), [remoteok.io](https://remoteok.io), etc.\) but, sometimes, there are opportunities that don't use such services.

Here's a summary of my experience I can bring to your project:

* \>20 years professional software development including Python, C, C\+\+, Java J2EE, PHP, JavaScript, CSS and others. US patent holder for a cryptographic smart card unlocking solution and another patent pending for a blockchain\-related process.
* 15\+ years experience in agile development environments;
* 8\+ years Full Stack Django/Python/JS/CSS/LESS/SCSS, Postgres, MySQL, Celery, Memcache, Haystack, Django REST Framework, more;
* 5\+ years of best\-practice development tools; git and Github; Automated Unit and Integration Testing; continuous development \(CI\), invoke, gulp, more;
* 5\+ years managing popular open source projects including feature planning and implementation, issue resolution, unit/integration testing; documentation, release management, community management and education; project evangelist;
* AWS \(CloudFormation, Route 53, DynamoDB, Lambda, EC2, S3\), Digital Ocean droplets,
* Regularly use Linux \(Ubuntu flavored\), MacOS \(primary workstation\);

I'm also an avid fan of blockchain and Ethereum. I have built a Django/Python\-based payment\-gateway for Ethereum and I have some initial experience with Truffle and Solidity and would love to continue to learn more.

I'm based on US East Coast and strongly prefer remote work \(recently bought a house and built an office for this purpose\).

Please PM me!

/r/django
https://redd.it/8gkiac