Authentication for Django Rest Framework

Dj-Rest-Auth Drop-in API endpoints for handling authentication securely in Django Rest Framework. Works especially well with SPAs (e.g React, Vue, Angular), and Mobile applications. Requirements Quick Setup Install package pip install dj-rest-auth Add dj_rest_auth app to INSTALLED_APPS in your django settings.py: INSTALLED_APPS = ( …, ‘rest_framework’, ‘rest_framework.authtoken’, …, ‘dj_rest_auth’ ) Add URL patterns urlpatterns = [ path(‘dj-rest-auth/’, include(‘dj_rest_auth.urls’)), ] (Optional) Use Http-Only cookies REST_USE_JWT = True JWT_AUTH_COOKIE = ‘jwt-auth’ Testing Install required modules with pip install -r dj_rest_auth/tests/requirements.pip To run […]

Read more

A Django App that adds Cross-Origin Resource Sharing headers to responses

A Django App that adds Cross-Origin Resource Sharing (CORS) headers to responses. This allows in-browser requests to your Django application from other origins. About CORS Adding CORS headers allows your resources to be accessed on other domains. It’s important you understand the implications before adding the headers, since you could be unintentionally opening up your site’s private data to others. Requirements Python 3.6 to 3.9 supported. Django 2.2 to 3.2 supported. Are your tests slow? Check out my book Speed […]

Read more

Tools for Optuna, MLflow and the integration of both

HPOflow Tools for Optuna, MLflow and the integration of both. The main components are: hpoflow.OptunaMLflow: A wrapper to use Optuna and log to MLflow at the same time. hpoflow.OptunaMLflowCallback: Class inheriting from transformers.TrainerCallback that integrates with OptunaMLflowto send the logs to MLflow and Optuna during model training. hpoflow.SignificanceRepeatedTrainingPruner: An Optuna prunerto use statistical significance (a t-test which serves as a heuristic) to stopunpromising trials early, avoiding unnecessary repeated training during cross validation. Installation HPOflow is available at the Python Package […]

Read more

A software manager for easy development and distribution of Python code

A software manager for easy development and distribution of Python code. The main features that Piper adds to Python are: Support for large-scale, multi-package projects Reproducibility (clear, transparent dependency management) Robust development-lifecycle, from blueprinting to distribution Piper is inspired by what Maven is for Java and uses Pip and Virtual Environments. Why Piper Python is great in many things, particularly for scripting. But it is powerful enough to create complex software too. Still, when doing so, it lacks some robustness […]

Read more

A lightweight command line interface library for creating commands

hype A lightweight command line interface library for creating cli commands. Hype CLI is an open source framework use for building command line applications easirer for cli applications that required different type of commands. It also comes with alot of different features that you may want to check out. Hype CLI was mainly built for Anglo ( a modern lightweight web framework for python 3. ). Because of Hype CLI’s capability it becomes easier to build command-line application. You can […]

Read more

A Python package to create, run, and post-process MODFLOW-based models

flopy FloPy includes support for MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, and MODFLOW-2000. Other supported MODFLOW-based models include MODPATH (version 6 and 7), MT3DMS, MT3D-USGS, and SEAWAT. For general modeling issues, please consult a modeling forum, such as the MODFLOW Users Group. Other MODFLOW resources are listed in the MODFLOW Resources section. Installation FloPy requires Python 3.5 (or higher) and NumPy 1.9 (or higher). Dependencies for optional FloPy methods are summarized here. To install FloPy type: conda install -c conda-forge flopy […]

Read more

A Python script that contains various functions

element_search with Selenium Just to mention, I’m a beginner to all this, so it it’s very possible to make some mistakes The idea is to create a Python script that contains various functions, that with the help of the Selenium library, searches for web elements, raising no errors, and in the same time writes automatically into a log file what is being searched and if the element was found. Important note: * you should already have selenium installed * along […]

Read more

Email Spam Detection – A Comparative Analysis of 4 Machine Learning Models

This article was published as a part of the Data Science Blogathon Introduction This article aims to compare four different deep learning and machine learning algorithms to build a spam detector and evaluate their performances. The dataset we used was from a shuffled sample of email subjects and bodies containing both spam and ham emails in numerous proportions, which we converted into lemmas. Email Spam Detection is one of the most effective projects of Deep learning but this is often also […]

Read more

Progressive Growing of GANs inference in PyTorch with CelebA training snapshot

prog_gans_pytorch_inference This is an inference sample written in PyTorch of the original Theano/Lasagne code. I recreated the network as described in the paper of Karras et al. Since some layers seemed to be missing in PyTorch, these were implemented as well. The network and the layers can be found in model.py. For the demo, a 100-celeb-hq-1024×1024-ours snapshot was used, which was made publicly available by the authors. Since I couldn’t find any model converter between Theano/Lasagne and PyTorch, I used […]

Read more

An Introduction to Deep Learning for the Physical Layer

radio-transformer-networks An Introduction to Deep Learning for the Physical Layer An usable PyTorch implementation of the noisy autoencoder infrastructure in the paper “An Introduction to Deep Learning for the Physical Layer” by Kenta Iwasaki on behalf of Gram.AI. Overall a fun experiment for constructing a communications system for the physical layer with transmitters/receivers in which the transmitter efficiently encodes a signal in a way such that the receiver can still, with minimal error, decode this encoded signal despite being inflicted […]

Read more
1 526 527 528 529 530 927