Jupyter Map - A map with all the institutions using Jupyter
https://elc.github.io/jupyter-map/
/r/IPython
https://redd.it/8ixvf7
https://elc.github.io/jupyter-map/
/r/IPython
https://redd.it/8ixvf7
reddit
Jupyter Map - A map with all the institutions using... • r/IPython
6 points and 1 comments so far on reddit
2D CAD/vectors drawing library
Hey, I'm looking to draw some patterns in Python based on a set of inputs. Need to do things like lines, tangents, and arcs. Does anyone know of library I could use to draw on a canvas?
/r/Python
https://redd.it/8j0vr2
Hey, I'm looking to draw some patterns in Python based on a set of inputs. Need to do things like lines, tangents, and arcs. Does anyone know of library I could use to draw on a canvas?
/r/Python
https://redd.it/8j0vr2
reddit
2D CAD/vectors drawing library • r/Python
Hey, I'm looking to draw some patterns in Python based on a set of inputs. Need to do things like lines, tangents, and arcs. Does anyone know of...
Boilerplate code for using Django and React Already configured
https://github.com/idanwekhai/Django_React_boilerplate
/r/django
https://redd.it/8iznt6
https://github.com/idanwekhai/Django_React_boilerplate
/r/django
https://redd.it/8iznt6
GitHub
idanwekhai/Django_React_boilerplate
Django_React_boilerplate - Boiler-Plate code to Use Django with React
help to create a custom user form
Hi I would like to know how I can customize my user model, I haves this model:
from django.db import models
from django.contrib.auth.models import AbstractUser, UserManager
class CustomUserManager\(UserManager\):
pass
class CustomUser\(AbstractUser\):
objects = CustomUserManager\(\)
and I have this form
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import CustomUser
class CustomUserCreationForm\(UserCreationForm\):
class Meta\(UserCreationForm.Meta\):
model = CustomUser
fields = \('username', 'email'\)
class CustomUserChangeForm\(UserChangeForm\):
class Meta:
model = CustomUser
fields = UserChangeForm.Meta.fields
I need to know how I can add more fields to the model and how implement it in the form for example I want to add ID, adrees and Bday fields
/r/djangolearning
https://redd.it/8j1htl
Hi I would like to know how I can customize my user model, I haves this model:
from django.db import models
from django.contrib.auth.models import AbstractUser, UserManager
class CustomUserManager\(UserManager\):
pass
class CustomUser\(AbstractUser\):
objects = CustomUserManager\(\)
and I have this form
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import CustomUser
class CustomUserCreationForm\(UserCreationForm\):
class Meta\(UserCreationForm.Meta\):
model = CustomUser
fields = \('username', 'email'\)
class CustomUserChangeForm\(UserChangeForm\):
class Meta:
model = CustomUser
fields = UserChangeForm.Meta.fields
I need to know how I can add more fields to the model and how implement it in the form for example I want to add ID, adrees and Bday fields
/r/djangolearning
https://redd.it/8j1htl
reddit
help to create a custom user form • r/djangolearning
Hi I would like to know how I can customize my user model, I haves this model: from django.db import models from django.contrib.auth.models...
I'm working on this free tool for practicing Python (it's like Duolingo for learning to code)
https://edabit.com/explore?lang=python3
/r/Python
https://redd.it/8j3pnn
https://edabit.com/explore?lang=python3
/r/Python
https://redd.it/8j3pnn
edabit
Explore 675+ FREE Coding Challenges // Edabit
Edabit is like Duolingo for learning to code. Earn points for correct solutions, unlock achievements and level up. Our coding challenges make learning to code fun and easy.
[P] Introducing Deep Conversation feature of Dragonfire open-source virtual assistant
https://github.com/DragonComputer/Dragonfire#deep-conversation-examples
/r/MachineLearning
https://redd.it/8j3f1j
https://github.com/DragonComputer/Dragonfire#deep-conversation-examples
/r/MachineLearning
https://redd.it/8j3f1j
GitHub
GitHub - DragonComputer/Dragonfire: the open-source virtual assistant for Ubuntu based Linux distributions
the open-source virtual assistant for Ubuntu based Linux distributions - DragonComputer/Dragonfire
[Project] Tensorflow implementation of Generative Adversarial Networks for Extreme Learned Image Compression
https://github.com/Justin-Tan/generative-compression
/r/MachineLearning
https://redd.it/8j44cd
https://github.com/Justin-Tan/generative-compression
/r/MachineLearning
https://redd.it/8j44cd
GitHub
GitHub - Justin-Tan/generative-compression: TensorFlow Implementation of Generative Adversarial Networks for Extreme Learned Image…
TensorFlow Implementation of Generative Adversarial Networks for Extreme Learned Image Compression - Justin-Tan/generative-compression
[D] A good question I stumbled upon: Why doesn't regularization solve Deep Neural Nets hunger for data?
https://stats.stackexchange.com/questions/345737/why-doesnt-regularization-solve-deep-neural-nets-hunger-for-data
/r/MachineLearning
https://redd.it/8izegs
https://stats.stackexchange.com/questions/345737/why-doesnt-regularization-solve-deep-neural-nets-hunger-for-data
/r/MachineLearning
https://redd.it/8izegs
Cross Validated
Why doesn't regularization solve Deep Neural Nets hunger for data?
An issue I've seen frequently brought up in the context of Neural Networks in general, and Deep Neural Networks in particular, is that they're "data hungry" - that is they don't perform well unless...
PyCon 2018 Talk Videos
https://www.youtube.com/channel/UCsX05-2sVSH7Nx3zuk3NYuQ/featured
/r/Python
https://redd.it/8j4ep6
https://www.youtube.com/channel/UCsX05-2sVSH7Nx3zuk3NYuQ/featured
/r/Python
https://redd.it/8j4ep6
[AF] Updated website is causing problem for old users, possible cookie issues
To remove "server/main.cgi/" from example.com/server/main.cgi/mypage I changed
@app.route('/mypage/')
to
@app.route('/mypage')
But now, when my old users click the button to open /mypage, the url "example.com/server/main.cgi/mypage/" is requested, which is no longer used. Altough the button url says example.com/mypage.
I am not sure if this is caused by old cookies or cache, but there are no issues when i open the website in a private window.
Also, I am sure there must be some better way to remove that part of the url, because now, /mypage/ wont work.
My .htaccess file looks like this.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /home/www/server/main.cgi/$1 [L]
main.cgi
#!/usr/bin/python3
import sys
sys.path.insert(0, '/home/.local/lib/python3.4/site-packages')
from wsgiref.handlers import CGIHandler
from myapp import app
CGIHandler().run(app)
myapp.py
from flask import Flask, render_template
app = Flask(__name__, static_folder="../static",
template_folder="../templates")
@app.route('/mypage')
def mypage():
return render_template('mypage.html')
if __name__ == '__main__':
app.run()
I appreciate any help I can get on this issue.
Edit: All my imports are listed with for example "/server/main.cgi/static/js/bootstrap.bundle.js". Is it possible to change it to "/static/js/bootstrap.bundle.js"?
/r/flask
https://redd.it/8j349j
To remove "server/main.cgi/" from example.com/server/main.cgi/mypage I changed
@app.route('/mypage/')
to
@app.route('/mypage')
But now, when my old users click the button to open /mypage, the url "example.com/server/main.cgi/mypage/" is requested, which is no longer used. Altough the button url says example.com/mypage.
I am not sure if this is caused by old cookies or cache, but there are no issues when i open the website in a private window.
Also, I am sure there must be some better way to remove that part of the url, because now, /mypage/ wont work.
My .htaccess file looks like this.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /home/www/server/main.cgi/$1 [L]
main.cgi
#!/usr/bin/python3
import sys
sys.path.insert(0, '/home/.local/lib/python3.4/site-packages')
from wsgiref.handlers import CGIHandler
from myapp import app
CGIHandler().run(app)
myapp.py
from flask import Flask, render_template
app = Flask(__name__, static_folder="../static",
template_folder="../templates")
@app.route('/mypage')
def mypage():
return render_template('mypage.html')
if __name__ == '__main__':
app.run()
I appreciate any help I can get on this issue.
Edit: All my imports are listed with for example "/server/main.cgi/static/js/bootstrap.bundle.js". Is it possible to change it to "/static/js/bootstrap.bundle.js"?
/r/flask
https://redd.it/8j349j
linkedin/shiv: Shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441, but with all their dependencies included.
https://github.com/linkedin/shiv
/r/Python
https://redd.it/8j5xn8
https://github.com/linkedin/shiv
/r/Python
https://redd.it/8j5xn8
GitHub
GitHub - linkedin/shiv: shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441…
shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441, but with all their dependencies included. - linkedin/shiv
Should I use cron or celery for a task to be performed at the exact same time twice a month?
I need to perform a specific task at exactly 12:00 AM on the 1st and 16th day of the month. The task is pretty simple; it is setting a model IntegerField to 0.
I know the 2 major apps for this are cron and celery. I'm not experienced at all with either of them. Which one of them is optimal for my situation?
/r/django
https://redd.it/8j903y
I need to perform a specific task at exactly 12:00 AM on the 1st and 16th day of the month. The task is pretty simple; it is setting a model IntegerField to 0.
I know the 2 major apps for this are cron and celery. I'm not experienced at all with either of them. Which one of them is optimal for my situation?
/r/django
https://redd.it/8j903y
reddit
r/django - Should I use cron or celery for a task to be performed at the exact same time twice a month?
4 votes and 6 so far on reddit
Django formsets and additional custom fields
Here is my setup:
class MyParentForm(forms.ModelForm):
class Meta:
model = MyParentModel
fields = '__all__'
# my_extra is not a field on MyChildModel
# but it's data is stored in the database in MyExtraModel
# which has a OneToOne rel with MyChildModel
class MyChildForm(forms.ModelForm):
my_extra = forms.CharField(label='Extra', max_length=20)
def save(self, commit=True):
# this function includes (unshown) logic that facilitates
# the save of MyExtraModel with the data from my_extra
super(MyChildForm, self).save(commit)
class Meta:
model = MyChildModel
fields = ['name', 'age']
MyChildFormSet = forms.inlineformset_factory(parent_model=MyParentModel,
model=MyChildModel,
form=MyChildForm)
The formset and general form setup works perfectly fine when I use it in a CreateView.
My issue is that when I attempt to utilize an UpdateView, I don't know how to populate each formset's my_extra field with the data from the one-to-one relation.
class MyParentModelChange(UpdateView):
model = MyParentModel
form = MyParentForm
def get_context_data(self, **kwargs):
data = super(MyParentModelChange, self).get_context_data(**kwargs)
initial = self.request.POST if self.request.POST else None
data['child_formset'] = MyChildFormSet(initial, instance=self.object, prefix='children')
return data
You can see that I am passing the ParentModel instance object, and so it's children set are also being passed in to the formset. The formset populates `child.name` and `child.age` fine, but it does not know about the additional my_extra field.
Child also has a `child.extra` (from the `OneToOne` relationship with `MyExtraModel`) that the formset doesn't know to pull from to populate for the my_extra form field.
How can I go about fixing this?
Here is what I have thought of and tried:
* I thought perhaps the instance data is available on FormSet `__init__`, so I made a custom `BaseInlineFormSet` descendant. In the `__init__()` of my custom descendent, after the `super().__init__()` call, I tried to print `self.data` and `self.initial` and got empty values from both. This indicates that the formsets aren't populated with this information when I look at it in the UpdateView, so I need to look elsewhere.
* So would extending `formset.add_fields()` be the way I should go about it?
* Is there perhaps another method I should be overriding to accomplish this?
Thanks!
/r/django
https://redd.it/8j5mc0
Here is my setup:
class MyParentForm(forms.ModelForm):
class Meta:
model = MyParentModel
fields = '__all__'
# my_extra is not a field on MyChildModel
# but it's data is stored in the database in MyExtraModel
# which has a OneToOne rel with MyChildModel
class MyChildForm(forms.ModelForm):
my_extra = forms.CharField(label='Extra', max_length=20)
def save(self, commit=True):
# this function includes (unshown) logic that facilitates
# the save of MyExtraModel with the data from my_extra
super(MyChildForm, self).save(commit)
class Meta:
model = MyChildModel
fields = ['name', 'age']
MyChildFormSet = forms.inlineformset_factory(parent_model=MyParentModel,
model=MyChildModel,
form=MyChildForm)
The formset and general form setup works perfectly fine when I use it in a CreateView.
My issue is that when I attempt to utilize an UpdateView, I don't know how to populate each formset's my_extra field with the data from the one-to-one relation.
class MyParentModelChange(UpdateView):
model = MyParentModel
form = MyParentForm
def get_context_data(self, **kwargs):
data = super(MyParentModelChange, self).get_context_data(**kwargs)
initial = self.request.POST if self.request.POST else None
data['child_formset'] = MyChildFormSet(initial, instance=self.object, prefix='children')
return data
You can see that I am passing the ParentModel instance object, and so it's children set are also being passed in to the formset. The formset populates `child.name` and `child.age` fine, but it does not know about the additional my_extra field.
Child also has a `child.extra` (from the `OneToOne` relationship with `MyExtraModel`) that the formset doesn't know to pull from to populate for the my_extra form field.
How can I go about fixing this?
Here is what I have thought of and tried:
* I thought perhaps the instance data is available on FormSet `__init__`, so I made a custom `BaseInlineFormSet` descendant. In the `__init__()` of my custom descendent, after the `super().__init__()` call, I tried to print `self.data` and `self.initial` and got empty values from both. This indicates that the formsets aren't populated with this information when I look at it in the UpdateView, so I need to look elsewhere.
* So would extending `formset.add_fields()` be the way I should go about it?
* Is there perhaps another method I should be overriding to accomplish this?
Thanks!
/r/django
https://redd.it/8j5mc0
reddit
Django formsets and additional custom fields • r/django
Here is my setup: class MyParentForm(forms.ModelForm): class Meta: model = MyParentModel fields =...
[AF] The easiest way to deploy a small app in a LAN?
I just wrote a very small app (it doesn't even use a DB) and I need to deploy it in a LAN on a Debian 9 based server. It should run as a system service. It will only be used by a couple of users, and as of now I don't really care about security, performance, or logging. What is the fastest and easiest way to deploy it?
/r/flask
https://redd.it/8j74zq
I just wrote a very small app (it doesn't even use a DB) and I need to deploy it in a LAN on a Debian 9 based server. It should run as a system service. It will only be used by a couple of users, and as of now I don't really care about security, performance, or logging. What is the fastest and easiest way to deploy it?
/r/flask
https://redd.it/8j74zq
reddit
[AF] The easiest way to deploy a small app in a LAN? • r/flask
I just wrote a very small app (it doesn't even use a DB) and I need to deploy it in a LAN on a Debian 9 based server. It should run as a system...
Does anyone use DigitalOcean spaces?
I want to use object storage for one of my apps. DigitalOcean Spaces sounds interesting. I've never used S3 but I've heard that Spaces integrates nicely with existing S3 tools and libraries.
Does anyone have experience with DO spaces? Is it easy to use/setup? How do you use it with Flask?
UPDATE:
I discovered this: https://www.digitalocean.com/community/questions/how-to-use-digitalocean-spaces-with-the-aws-s3-sdks
I was able to create a bucket and upload a file so hopefully, I'll be able to integrate it into my app.
/r/flask
https://redd.it/8dl0nv
I want to use object storage for one of my apps. DigitalOcean Spaces sounds interesting. I've never used S3 but I've heard that Spaces integrates nicely with existing S3 tools and libraries.
Does anyone have experience with DO spaces? Is it easy to use/setup? How do you use it with Flask?
UPDATE:
I discovered this: https://www.digitalocean.com/community/questions/how-to-use-digitalocean-spaces-with-the-aws-s3-sdks
I was able to create a bucket and upload a file so hopefully, I'll be able to integrate it into my app.
/r/flask
https://redd.it/8dl0nv
Digitalocean
Question | DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
SQlite realistic for a small we app to practice SQL?
I love flask, with that out of the way I am starting to get into SQL for the first time by making a silly little app where users sign a guestbook (which gets written to the sqlite3 database) and then get rerouted to a page where it shows the complete guestbook in a table format. I am going to deploy this and show it to people. I expect traffic to be low, but I guess it is possible that two people might try to write at the exact same time, which is the issue with SQlite right? What exactly happens if two people try to write at the same time? Is this easy to dodge with error handling?
/r/flask
https://redd.it/8dgyd4
I love flask, with that out of the way I am starting to get into SQL for the first time by making a silly little app where users sign a guestbook (which gets written to the sqlite3 database) and then get rerouted to a page where it shows the complete guestbook in a table format. I am going to deploy this and show it to people. I expect traffic to be low, but I guess it is possible that two people might try to write at the exact same time, which is the issue with SQlite right? What exactly happens if two people try to write at the same time? Is this easy to dodge with error handling?
/r/flask
https://redd.it/8dgyd4
reddit
r/flask - SQlite realistic for a small we app to practice SQL?
2 votes and 5 so far on reddit
This media is not supported in your browser
VIEW IN TELEGRAM
Lucky Cat spinning-arm persistence of vision display, powered by MicroPython
/r/Python
https://redd.it/8javkt
/r/Python
https://redd.it/8javkt
Select Multiple Items with request.form?
http://loudev.com/#usage
I'm using this plugin to let my users select multiple items, for example the fruits they like, out of a fairly big list (40 or so elements).
However, when I do request.form['fruit_pick'] it only seems to return the first one they've picked, for example elem_1.
Is there any way to do what I want to do more efficiently?
/r/flask
https://redd.it/8dg237
http://loudev.com/#usage
I'm using this plugin to let my users select multiple items, for example the fruits they like, out of a fairly big list (40 or so elements).
However, when I do request.form['fruit_pick'] it only seems to return the first one they've picked, for example elem_1.
Is there any way to do what I want to do more efficiently?
/r/flask
https://redd.it/8dg237
Loudev
jQuery multiselect
This is an unobstrusive jQuery plugin which is a drop-in replacement for the standard <select> element with multiple attribute activated.
[D] Papers writing..."The code will be made available upon publications" should be held accountable to their statement...
https://twitter.com/AIActorCritic/status/995446507846320128
/r/MachineLearning
https://redd.it/8j8iu1
https://twitter.com/AIActorCritic/status/995446507846320128
/r/MachineLearning
https://redd.it/8j8iu1
Twitter
AI Actor-Critic
Papers writing in their manuscript explicitly "The code will be made available upon publications" should be held accountable to their statement. I've found at least four paper from ICLR just today who have not. @ICLR18 @icmlconf @NipsConference @CVPR @m_learningnews
Python Top 10 Articles for the Past Month (v.May 2018)
https://medium.com/@Mybridge/python-top-10-articles-for-the-past-month-v-may-2018-988773fe2cef
/r/Python
https://redd.it/8jbvxa
https://medium.com/@Mybridge/python-top-10-articles-for-the-past-month-v-may-2018-988773fe2cef
/r/Python
https://redd.it/8jbvxa
Medium
Python Top 10 Articles for the Past Month (v.May 2018)
For the past month, we ranked nearly 1,000 Python articles to pick the Top 10 stories that can help advance your career (1% chance).