Linking Python to C with CFFI
https://tmarkovich.github.io//articles/2017-08/linking-python-to-c-with-cffi
/r/Python
https://redd.it/6ur42g
https://tmarkovich.github.io//articles/2017-08/linking-python-to-c-with-cffi
/r/Python
https://redd.it/6ur42g
tmarkovich.github.io
Linking Python to C with CFFI
Why link Python to C?I hope that it is uncontroversial to state that Python is a great language that can suffer from occasional performance issues. This is e...
IPython magic command to profile and view your Python code as a heat map.
https://github.com/csurfer/pyheatmagic
/r/IPython
https://redd.it/6umjge
https://github.com/csurfer/pyheatmagic
/r/IPython
https://redd.it/6umjge
GitHub
GitHub - csurfer/pyheatmagic: IPython magic command to profile and view your python code as a heat map.
IPython magic command to profile and view your python code as a heat map. - csurfer/pyheatmagic
Secure Flask API
I made a REST api to be used in an iOS app I created. Currently you can go to api.mysite.com/featured and it will display the JSON. How can I reject all requests that do not come from my iOS app?
/r/flask
https://redd.it/6umdwq
I made a REST api to be used in an iOS app I created. Currently you can go to api.mysite.com/featured and it will display the JSON. How can I reject all requests that do not come from my iOS app?
/r/flask
https://redd.it/6umdwq
Best way to learn Python as a beginner?
Hey guys, have been shortly working through some tutorials on Python, but have never really gotten past the first hump.
Where should i turn to, being a complete beginner wanting to learn python?
/r/Python
https://redd.it/6uruoh
Hey guys, have been shortly working through some tutorials on Python, but have never really gotten past the first hump.
Where should i turn to, being a complete beginner wanting to learn python?
/r/Python
https://redd.it/6uruoh
reddit
Best way to learn Python as a beginner? • r/Python
Hey guys, have been shortly working through some tutorials on Python, but have never really gotten past the first hump. Where should i turn to,...
Run python & have better GPU support for OpenGL applications
https://github.com/cprogrammer1994/optimuspy
/r/Python
https://redd.it/6uomo4
https://github.com/cprogrammer1994/optimuspy
/r/Python
https://redd.it/6uomo4
GitHub
cprogrammer1994/optimuspy
optimuspy - Python Launcher with Optimus Enablement
[P] Machine Learning for Humans: A Beginner's Guide to AI/ML
https://medium.com/machine-learning-for-humans/why-machine-learning-matters-6164faf1df12
/r/MachineLearning
https://redd.it/6upvf2
https://medium.com/machine-learning-for-humans/why-machine-learning-matters-6164faf1df12
/r/MachineLearning
https://redd.it/6upvf2
Medium
A Beginner’s Guide to AI/ML 🤖👶
The ultimate guide to machine learning. Simple, plain-English explanations accompanied by math, code, and real-world examples.
A Python cheat sheet about security
https://github.com/crazyguitar/pysheeet/blob/master/docs/notes/python-crypto.rst
/r/Python
https://redd.it/6utwyn
https://github.com/crazyguitar/pysheeet/blob/master/docs/notes/python-crypto.rst
/r/Python
https://redd.it/6utwyn
Django Autoreloader: hot reload files in browser for development (Linux)
The [django-autoreloader](https://github.com/synw/django-autoreloader) module is a simple management command that watch directories for file change and reloads the browser when a file changes. A list of directories to watch is declared in settings as well as some paths to exclude from reloading.
Limitation: it works only for Linux.
This has just been released. It was tested on python 2.7 / 3.5 with Django 1.11 and Firefox / Chromium. I would appreciate some feedback to ensure that it works as expected for other configurations than mine. I also share because this module is pretty useful to me and might help some other Django devs.
/r/django
https://redd.it/6up23j
The [django-autoreloader](https://github.com/synw/django-autoreloader) module is a simple management command that watch directories for file change and reloads the browser when a file changes. A list of directories to watch is declared in settings as well as some paths to exclude from reloading.
Limitation: it works only for Linux.
This has just been released. It was tested on python 2.7 / 3.5 with Django 1.11 and Firefox / Chromium. I would appreciate some feedback to ensure that it works as expected for other configurations than mine. I also share because this module is pretty useful to me and might help some other Django devs.
/r/django
https://redd.it/6up23j
GitHub
synw/django-autoreloader
Autoreload files in browser for Django development - synw/django-autoreloader
[N] Microsoft is attempting to patent Active Machine Learning
https://www.google.com/patents/US20160162802
/r/MachineLearning
https://redd.it/6uqdgp
https://www.google.com/patents/US20160162802
/r/MachineLearning
https://redd.it/6uqdgp
Google Books
Patent US20160162802 - Active Machine Learning
Technologies are described herein for active machine learning. An active machine learning method can include initiating active machine learning through an active machine learning system configured to train an auxiliary machine learning model to produce at…
A simple Discord-Bot written with discord.py to protocol member actions on a server
https://github.com/LordDRuffi/connecteroonie
/r/Python
https://redd.it/6ut4ko
https://github.com/LordDRuffi/connecteroonie
/r/Python
https://redd.it/6ut4ko
GitHub
LordDRuffi/connecteroonie
connecteroonie - A simple Discord-Bot written with discord.py to protocol member actions on a server
[D] what happened with Distill? is it dead?
https://distill.pub/ was a great idea to innovate research publishing, however, it seems that the community never ended up adopting it.
Does anybody know if more publications will be published from the initial ones or is this project officially abandoned?
/r/MachineLearning
https://redd.it/6usqhc
https://distill.pub/ was a great idea to innovate research publishing, however, it seems that the community never ended up adopting it.
Does anybody know if more publications will be published from the initial ones or is this project officially abandoned?
/r/MachineLearning
https://redd.it/6usqhc
Distill
Distill — Latest articles about machine learning
[AF][Flask-Login] Refreshing page causes is_authenticated to fail
I'm setting up a login system with Flask-Login, and I set up an if statement in Jinja to write to the HTML if a user is logged in, and write "Not logged in." otherwise.
{% if current_user.is_authenticated %}
You are logged in as {{ current_user.get_username() }}.
{% else %}
You are not logged in.
{% endif %}
However, when I log in, it will show that it is logged in, but then when I refresh the page, it will sometimes say that it is not logged in, but upon another refresh, say that it is logged in. If I spam refreshes, it will be about 50/50 chance of being either. My suspicion is that its not actually logging me out, but the is_authenticated is resolving to false which might be causing the problem, but I am somewhat new to Flask so I don't know if I am missing something. Any help would be appreciated!
/r/flask
https://redd.it/6uubmb
I'm setting up a login system with Flask-Login, and I set up an if statement in Jinja to write to the HTML if a user is logged in, and write "Not logged in." otherwise.
{% if current_user.is_authenticated %}
You are logged in as {{ current_user.get_username() }}.
{% else %}
You are not logged in.
{% endif %}
However, when I log in, it will show that it is logged in, but then when I refresh the page, it will sometimes say that it is not logged in, but upon another refresh, say that it is logged in. If I spam refreshes, it will be about 50/50 chance of being either. My suspicion is that its not actually logging me out, but the is_authenticated is resolving to false which might be causing the problem, but I am somewhat new to Flask so I don't know if I am missing something. Any help would be appreciated!
/r/flask
https://redd.it/6uubmb
reddit
[AF][Flask-Login] Refreshing page causes... • r/flask
I'm setting up a login system with Flask-Login, and I set up an if statement in Jinja to write to the HTML if a user is logged in, and write "Not...
DjangoCon help update!
Hello everyone!
You may remember I posted here a [about a month ago](https://www.reddit.com/r/django/comments/6fl9ml/hello_im_speaking_at_djangocon_this_year_and_want/) asking for your opinion on what I should do in my [DjangoCon talk](https://2017.djangocon.us/tutorials/from-0-to-100-in-django/). Well I am happy to say I collected a ton of information and opinions from everyone, and I wanted to thank the community as a whole for making my talk so successful!
A few different people had asked if the talk would be posted online at a later date, at the time I was unsure of this myself as DjangoCon has done some tutorials in the past, but not always. I found out this week that they will not be posting my tutorial (or any of the 2017 tutorials) this year. Rest assured that all of the talks will be posted as normal though!
---
Regardless the tutorial was a huge success and many of the people who came were incredibly happy to have a more detailed look at Django, instead of the usual "copy/paste this code and type this command" that some talks and tutorials provide. I have been asked by multiple different attendee's if I would be willing to release my slides and code (which I will be doing in a few days), however the largest part of the tutorial was a live coding and q/a section. This cannot really be replicated with a github repo. Instead I want to try and do the next best thing. Over the next few weeks I plan on release a series of blog posts (2 a week) called "0-100 in Django." These blog posts will cover everything I covered in the tutorial. It will be an indepth look at the polls tutorial, that goes even further than the DjangoProject website takes it.
We will talk about Models, Managers, Querysets, Migrations, CBV vs Functional Views, and even best practices for code. We will also add user authentication, unit testing, and so much more!
So if you were one of the people who wanted to go to DjangoCon, but just couldn't afford it please come by! The [first post is already available](https://medium.com/@jeremytiki/0-100-in-django-introduction-75a182637462), and number 2 will be up Monday and cover setting up the best Django environment possible.
/r/django
https://redd.it/6ullat
Hello everyone!
You may remember I posted here a [about a month ago](https://www.reddit.com/r/django/comments/6fl9ml/hello_im_speaking_at_djangocon_this_year_and_want/) asking for your opinion on what I should do in my [DjangoCon talk](https://2017.djangocon.us/tutorials/from-0-to-100-in-django/). Well I am happy to say I collected a ton of information and opinions from everyone, and I wanted to thank the community as a whole for making my talk so successful!
A few different people had asked if the talk would be posted online at a later date, at the time I was unsure of this myself as DjangoCon has done some tutorials in the past, but not always. I found out this week that they will not be posting my tutorial (or any of the 2017 tutorials) this year. Rest assured that all of the talks will be posted as normal though!
---
Regardless the tutorial was a huge success and many of the people who came were incredibly happy to have a more detailed look at Django, instead of the usual "copy/paste this code and type this command" that some talks and tutorials provide. I have been asked by multiple different attendee's if I would be willing to release my slides and code (which I will be doing in a few days), however the largest part of the tutorial was a live coding and q/a section. This cannot really be replicated with a github repo. Instead I want to try and do the next best thing. Over the next few weeks I plan on release a series of blog posts (2 a week) called "0-100 in Django." These blog posts will cover everything I covered in the tutorial. It will be an indepth look at the polls tutorial, that goes even further than the DjangoProject website takes it.
We will talk about Models, Managers, Querysets, Migrations, CBV vs Functional Views, and even best practices for code. We will also add user authentication, unit testing, and so much more!
So if you were one of the people who wanted to go to DjangoCon, but just couldn't afford it please come by! The [first post is already available](https://medium.com/@jeremytiki/0-100-in-django-introduction-75a182637462), and number 2 will be up Monday and cover setting up the best Django environment possible.
/r/django
https://redd.it/6ullat
reddit
Hello! I'm speaking at DjangoCon this year and want... • r/django
Good morning everyone! I was selected to speak at DjangoCon this year for the talk "Going from 0-100 with Django". It is going to be a 3-3.5 hour...
Can't get errors when using crispy-forms
https://stackoverflow.com/questions/45698989/cant-get-form-errors-when-using-crispy-forms
/r/django
https://redd.it/6upezu
https://stackoverflow.com/questions/45698989/cant-get-form-errors-when-using-crispy-forms
/r/django
https://redd.it/6upezu
Stackoverflow
Can't get form errors when using crispy forms
I'm using django-crispy-forms, a third party library, in a Django project, I would like to customize a form to get the errors at top of the form, but I can't.
This is a snippet of the code:
{% ext...
This is a snippet of the code:
{% ext...
Sending Emails with Django - Setting Up. Recently started a blog with this tutorial
http://www.sunnyville.co/sending-emails-django-setting-up/
/r/django
https://redd.it/6unnoz
http://www.sunnyville.co/sending-emails-django-setting-up/
/r/django
https://redd.it/6unnoz
Running the Seedstars django-react-redux-base boilerplate project on Heroku
http://dopeboy.github.io/django-react-redux-heroku-base/
/r/django
https://redd.it/6ux7lz
http://dopeboy.github.io/django-react-redux-heroku-base/
/r/django
https://redd.it/6ux7lz
[Discussion] How do you label your data? Does anyone have any experience using services like Crowdflower to label or gather training data?
See above. I'm really curious how people in industry, especially smaller startups, are able to acquire so much labeled data, or training data in general.
/r/MachineLearning
https://redd.it/6uvdor
See above. I'm really curious how people in industry, especially smaller startups, are able to acquire so much labeled data, or training data in general.
/r/MachineLearning
https://redd.it/6uvdor
reddit
[Discussion] How do you label your data? Does... • r/MachineLearning
See above. I'm really curious how people in industry, especially smaller startups, are able to acquire so much labeled data, or training data in...
Django + django-nyt + channels (redis backend) + ubuntu 16.04
I have an application currently running on a server with ubuntu 16.04, with uwsgi, postgres and nginx and now I want to implement django-nyt to have facebook like notifications. The problem is there are really poor documentation on how to deploy correctly channels alongside uwsgi, letting nginx filter everything. Can anybody give advices? The notifications work perfectly in my local machine but I don't know where to start to deply it to my server. Please help.
/r/djangolearning
https://redd.it/6uqbci
I have an application currently running on a server with ubuntu 16.04, with uwsgi, postgres and nginx and now I want to implement django-nyt to have facebook like notifications. The problem is there are really poor documentation on how to deploy correctly channels alongside uwsgi, letting nginx filter everything. Can anybody give advices? The notifications work perfectly in my local machine but I don't know where to start to deply it to my server. Please help.
/r/djangolearning
https://redd.it/6uqbci
reddit
Django + django-nyt + channels (redis backend)... • r/djangolearning
I have an application currently running on a server with ubuntu 16.04, with uwsgi, postgres and nginx and now I want to implement django-nyt to...
flask-allows 0.3.1 released
https://pypi.org/project/flask-allows/
flask-allows is an authorization toolkit along the lines of DRF's permissions and the extension to that called rest conditional (which allows modifying permissions with and/or/not).
It supports loading identities from whatever manager you use, as well as explicitly providing them when the permission is checked in most instances.
It's also configurable as to what exception unfulfilled requirements throw. By default it's werkzeug's Forbidden.
The main conceit is the concept of a Requirement. A Requirement may be a simple permission check or more complicated like "Is this object owned by the current user, or does the current user has access rights to it anyways?"
A Requirement can either be an implementation of the abstract Requirement class, or any callable that accepts the current user and request and returns a boolean.
The actual extension class provides a `fulfill` method which accepts requirements and optionally an explicit identity and sees if the identity meets the requirements. `fulfill` returns a boolean.
There is also a decorator form called `requires` that only accepts requirements and defers to the identity loader. On a failure, it throws the configured exception.
Built on that are helpers like a standalone requires decorator and the Permission class. The decorator defers to the Permission class.
Permission accepts any number of requirements and needs an active application context and the extension to be loaded to instantiate. Optionally, it can accept an identity or an exception to throw, otherwise it defers to the currently loaded app's extension.
Once created, it can be used as either a boolean or a context manager.
When used as a boolean, it simply returns if the provided requirements are met. If used as a context manager, it'll throw immediately if the requirements aren't met.
Happy to answer any questions.
Preemptively: Why not Flask Principal? Principal seems to be unmaintained, with no commits in two years and no activity on the issues or pull requests on the repo.
Additionally, Flask Principal takes a different view of authorization. In Principal, Identities are expected to explicitly enumerate their claims. With Allows, the onus is on Requirements to verify.
The Principal route works well until you need to load hundreds of a claims into memory on each request, it also forces you to move permissioning code inside the route handler for dynamic cases - does this user own this resource? Which is jarring to me.
/r/flask
https://redd.it/6uy1sn
https://pypi.org/project/flask-allows/
flask-allows is an authorization toolkit along the lines of DRF's permissions and the extension to that called rest conditional (which allows modifying permissions with and/or/not).
It supports loading identities from whatever manager you use, as well as explicitly providing them when the permission is checked in most instances.
It's also configurable as to what exception unfulfilled requirements throw. By default it's werkzeug's Forbidden.
The main conceit is the concept of a Requirement. A Requirement may be a simple permission check or more complicated like "Is this object owned by the current user, or does the current user has access rights to it anyways?"
A Requirement can either be an implementation of the abstract Requirement class, or any callable that accepts the current user and request and returns a boolean.
The actual extension class provides a `fulfill` method which accepts requirements and optionally an explicit identity and sees if the identity meets the requirements. `fulfill` returns a boolean.
There is also a decorator form called `requires` that only accepts requirements and defers to the identity loader. On a failure, it throws the configured exception.
Built on that are helpers like a standalone requires decorator and the Permission class. The decorator defers to the Permission class.
Permission accepts any number of requirements and needs an active application context and the extension to be loaded to instantiate. Optionally, it can accept an identity or an exception to throw, otherwise it defers to the currently loaded app's extension.
Once created, it can be used as either a boolean or a context manager.
When used as a boolean, it simply returns if the provided requirements are met. If used as a context manager, it'll throw immediately if the requirements aren't met.
Happy to answer any questions.
Preemptively: Why not Flask Principal? Principal seems to be unmaintained, with no commits in two years and no activity on the issues or pull requests on the repo.
Additionally, Flask Principal takes a different view of authorization. In Principal, Identities are expected to explicitly enumerate their claims. With Allows, the onus is on Requirements to verify.
The Principal route works well until you need to load hundreds of a claims into memory on each request, it also forces you to move permissioning code inside the route handler for dynamic cases - does this user own this resource? Which is jarring to me.
/r/flask
https://redd.it/6uy1sn
PyPI
flask-allows
Impose authorization requirements on Flask routes