Hey, here's a very active discord server based around python and coding help, and many other tech topics. Come join our python and raspberry pi discord server! 2.6k members.
https://discord.gg/bB5vZSy
/r/Python
https://redd.it/7cqhu6
https://discord.gg/bB5vZSy
/r/Python
https://redd.it/7cqhu6
Discord
Discord - Free voice and text chat for gamers
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
Tutorial: User Authentication with Django REST Framework
https://michaelwashburnjr.com/django-user-authentication/
/r/django
https://redd.it/7cv7kl
https://michaelwashburnjr.com/django-user-authentication/
/r/django
https://redd.it/7cv7kl
Michael Washburn Jr
User Authentication with Django REST Framework
User Authentication is a simple concept, but when it comes to properly implementing it in Django, things can get complicated. Learn how to do it right.
Flask Beginner
I've started to read Flask Web Development by Miguel Grinberg. I am on part two where we create a social blogging website. I feel somewhat uncomfortable with the information. It feels quite over whelming. Is this book a fast pace book or is flask from a beginner still quite complicated?
/r/flask
https://redd.it/7crxog
I've started to read Flask Web Development by Miguel Grinberg. I am on part two where we create a social blogging website. I feel somewhat uncomfortable with the information. It feels quite over whelming. Is this book a fast pace book or is flask from a beginner still quite complicated?
/r/flask
https://redd.it/7crxog
reddit
Flask Beginner • r/flask
I've started to read Flask Web Development by Miguel Grinberg. I am on part two where we create a social blogging website. I feel somewhat...
Maintain Production Server
I recently moved my Django app from Heroku to DigitalOcean to save some $$$. In my reading prior to making the switch, people noted that managing your own server on DO is more work than Heroku. They mentioned security patches and other maintenance that is required.
My question is, now that my app is up and running on DO, what ongoing maintenance should I be doing to keep it secure and running smoothly?
/r/django
https://redd.it/7cw24q
I recently moved my Django app from Heroku to DigitalOcean to save some $$$. In my reading prior to making the switch, people noted that managing your own server on DO is more work than Heroku. They mentioned security patches and other maintenance that is required.
My question is, now that my app is up and running on DO, what ongoing maintenance should I be doing to keep it secure and running smoothly?
/r/django
https://redd.it/7cw24q
reddit
Maintain Production Server • r/django
I recently moved my Django app from Heroku to DigitalOcean to save some $$$. In my reading prior to making the switch, people noted that managing...
Which mobile app dev. framework do you recommend for use w/flask?
As far as user auth, i am using flask-login.
Any u guys recommend that's fast, easy, and cross platform? Was thinking react native..
/r/flask
https://redd.it/7cwzg6
As far as user auth, i am using flask-login.
Any u guys recommend that's fast, easy, and cross platform? Was thinking react native..
/r/flask
https://redd.it/7cwzg6
reddit
Which mobile app dev. framework do you recommend for use... • r/flask
As far as user auth, i am using flask-login. Any u guys recommend that's fast, easy, and cross platform? Was thinking react native..
Scaling out your Django Multi-tenant App
https://www.citusdata.com/blog/2017/11/14/scale-out-your-django-app-with-django-multi-tenant/
/r/django
https://redd.it/7cx7tn
https://www.citusdata.com/blog/2017/11/14/scale-out-your-django-app-with-django-multi-tenant/
/r/django
https://redd.it/7cx7tn
Citusdata
Scaling out your Django Multi-tenant App
All about the django-multitenant Python library from Citus Data, that enables easy scale out of applications built on top of Django that use a multi-tenant data model. This multi tenant Python library has evolved from experience working with SaaS developers…
How does Reddit implement its upvote/downvote system?
I'm building a nearly identical system, except there is no downvote, only upvote. You can only vote once for each post/comment.
How is their upvote system implemented? Do they use AJAX or some asynchronous system to make it so that making a vote does not refresh the page?
Sorry for the semi-broad question.
/r/django
https://redd.it/7czebj
I'm building a nearly identical system, except there is no downvote, only upvote. You can only vote once for each post/comment.
How is their upvote system implemented? Do they use AJAX or some asynchronous system to make it so that making a vote does not refresh the page?
Sorry for the semi-broad question.
/r/django
https://redd.it/7czebj
reddit
How does Reddit implement its upvote/downvote system? • r/django
I'm building a nearly identical system, except there is no downvote, only upvote. You can only vote once for each post/comment. How is their...
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/7cvtc5
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/7cvtc5
reddit
What's everyone working on this week? • r/Python
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your...
NumPy announces timeline for dropping Python 2 support
https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst
/r/Python
https://redd.it/7d128x
https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst
/r/Python
https://redd.it/7d128x
Does IPyLua actually work?
It seems like [the IPyLua project](https://github.com/pakozm/IPyLua) on GitHub ought to work, but the instructions to make it actually work seem to be out of date. In particular, it says to
* Create a profile with IPython:
ipython profile create IPyLua
* Modify the profile's `ipython_config.py` to use IPyLua. This
will be at either `~/.config/ipython/profile_IPyLua/ipython_config.py` or
`~/.ipython/profile_IPyLua/ipython_config.py`:
# Configuration file for ipython.
c = get_config()
c.KernelManager.kernel_cmd = [
"luajit", # select your Lua interpreter here (lua5.2, lua5.1, luajit)
"IPyLua/IPyLuaKernel.lua", # probably need full path
"{connection_file}"
]
# Disable authentication.
c.Session.key = b''
c.Session.keyfile = b''
which doesn't seem to match up with current config file layout and options.
It would be cool to have working Lua, even if it's a bit simplistic and not offering much more than the command-line repl.
/r/IPython
https://redd.it/7d0v8o
It seems like [the IPyLua project](https://github.com/pakozm/IPyLua) on GitHub ought to work, but the instructions to make it actually work seem to be out of date. In particular, it says to
* Create a profile with IPython:
ipython profile create IPyLua
* Modify the profile's `ipython_config.py` to use IPyLua. This
will be at either `~/.config/ipython/profile_IPyLua/ipython_config.py` or
`~/.ipython/profile_IPyLua/ipython_config.py`:
# Configuration file for ipython.
c = get_config()
c.KernelManager.kernel_cmd = [
"luajit", # select your Lua interpreter here (lua5.2, lua5.1, luajit)
"IPyLua/IPyLuaKernel.lua", # probably need full path
"{connection_file}"
]
# Disable authentication.
c.Session.key = b''
c.Session.keyfile = b''
which doesn't seem to match up with current config file layout and options.
It would be cool to have working Lua, even if it's a bit simplistic and not offering much more than the command-line repl.
/r/IPython
https://redd.it/7d0v8o
GitHub
pakozm/IPyLua
IPython Kernel for Lua. Contribute to pakozm/IPyLua development by creating an account on GitHub.
milksnake: Integrating Rust with Python
https://blog.sentry.io/2017/11/14/evolving-our-rust-with-milksnake
/r/Python
https://redd.it/7cxty0
https://blog.sentry.io/2017/11/14/evolving-our-rust-with-milksnake
/r/Python
https://redd.it/7cxty0
Product Blog • Sentry
Evolving Our Rust With Milksnake
Sharing our new approach to using Rust in Python.
for loop with range in template
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do something like:
{{a.0.data}} {{b.0.data}} {{c.0.data}}
on the first loop, and on the second loop:
{{a.1.data}} {{b.1.data}} {{c.1.data}}
a,b,c are lists and the 0's are indexes that iterate.
In my views.py I added
{"range": range(10) to the context.}
Now if I do
{% for i in range %}
<p>{{i}}</p>
{% endfor %}
It works fine, but If I try something like:
{% for i in range %}
{{a.i.data}} {{b.i.data}} {{c.i.data}}
{% endfor %}
to try to iterate through the indexes It doesn't seem to work. Is there a proper way to go about this?
edit: formatting
/r/djangolearning
https://redd.it/7d1b04
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do something like:
{{a.0.data}} {{b.0.data}} {{c.0.data}}
on the first loop, and on the second loop:
{{a.1.data}} {{b.1.data}} {{c.1.data}}
a,b,c are lists and the 0's are indexes that iterate.
In my views.py I added
{"range": range(10) to the context.}
Now if I do
{% for i in range %}
<p>{{i}}</p>
{% endfor %}
It works fine, but If I try something like:
{% for i in range %}
{{a.i.data}} {{b.i.data}} {{c.i.data}}
{% endfor %}
to try to iterate through the indexes It doesn't seem to work. Is there a proper way to go about this?
edit: formatting
/r/djangolearning
https://redd.it/7d1b04
reddit
for loop with range in template • r/djangolearning
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do...
Model inheritance: Can you access a child object from the parent object?
* I have 2 classes : Class A & Class B.
* Class B inherits from Class A. Example:: **Class B(A)**
* Class A is not Abstract
* When I create a Class B object, it also creates a Class A object
Can you access the Class B object from the corresponding Class A object? Example: **classa_object.classb_object** ?
I'm trying to reference the Class B objects from a Class A queryset.
EDIT:
Here is [the code](https://gist.github.com/emilepetrone/40469ea24f4b365473cf57e44320affa) I'm reffering to. I broke the class Transaction up into child models of the various status options.
"The problem I thought I had was a class starting to have too many fields only being used when the object was in certain states. 6 different states, different fields used in different states. I was thinking I should break that up into Parent (the fields they all use), and then Children models for the subset each uses.
Maybe I'm thinking about it wrong?
The example:
class Transaction
states: buy, sold, dividend, withdrawl etc"
/r/django
https://redd.it/7d0fn6
* I have 2 classes : Class A & Class B.
* Class B inherits from Class A. Example:: **Class B(A)**
* Class A is not Abstract
* When I create a Class B object, it also creates a Class A object
Can you access the Class B object from the corresponding Class A object? Example: **classa_object.classb_object** ?
I'm trying to reference the Class B objects from a Class A queryset.
EDIT:
Here is [the code](https://gist.github.com/emilepetrone/40469ea24f4b365473cf57e44320affa) I'm reffering to. I broke the class Transaction up into child models of the various status options.
"The problem I thought I had was a class starting to have too many fields only being used when the object was in certain states. 6 different states, different fields used in different states. I was thinking I should break that up into Parent (the fields they all use), and then Children models for the subset each uses.
Maybe I'm thinking about it wrong?
The example:
class Transaction
states: buy, sold, dividend, withdrawl etc"
/r/django
https://redd.it/7d0fn6
Gist
gist:40469ea24f4b365473cf57e44320affa
Return only the form in the UpdateView class ?
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form.
Until now I use this view:
@login_required
def edit_sale_view(request, id):
instance = get_object_or_404(Sale, id=id)
form = EditSaleForm(instance=instance)
if request.method == "POST":
form = EditSaleForm(request.POST, instance=instance)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
return JsonResponse({'msg': 'Data saved'})
else:
return JsonResponse({'msg': 'Data not saved'})
return HttpResponse(form.as_p())
The form.as_p() is important because it is used in the form that is displayed in a modal window.
So, I think that I need to find out how to return only the form and not the whole template.
/r/django
https://redd.it/7d3gwy
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form.
Until now I use this view:
@login_required
def edit_sale_view(request, id):
instance = get_object_or_404(Sale, id=id)
form = EditSaleForm(instance=instance)
if request.method == "POST":
form = EditSaleForm(request.POST, instance=instance)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
return JsonResponse({'msg': 'Data saved'})
else:
return JsonResponse({'msg': 'Data not saved'})
return HttpResponse(form.as_p())
The form.as_p() is important because it is used in the form that is displayed in a modal window.
So, I think that I need to find out how to return only the form and not the whole template.
/r/django
https://redd.it/7d3gwy
reddit
Return only the form in the UpdateView class ? • r/django
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form. Until...
scikit-video: all-in-one video processing solution for Python
http://www.scikit-video.org/stable/
/r/Python
https://redd.it/7cxhoo
http://www.scikit-video.org/stable/
/r/Python
https://redd.it/7cxhoo
reddit
scikit-video: all-in-one video processing solution for... • r/Python
40 points and 3 comments so far on reddit
Microservices with Docker, Flask, and React
https://testdriven.io/part-four-e2e-test-setup/
/r/flask
https://redd.it/7d3a7y
https://testdriven.io/part-four-e2e-test-setup/
/r/flask
https://redd.it/7d3a7y
reddit
Microservices with Docker, Flask, and React • r/flask
4 points and 1 comments so far on reddit
Automating the Boring Search for an iPhone X
http://anthonyfox.io/iphone
/r/Python
https://redd.it/7d4b91
http://anthonyfox.io/iphone
/r/Python
https://redd.it/7d4b91
Anthony Fox
For reasons I still don’t understand, T-Mobile effectively prevented me from preordering the iPhone X. This had something to do with Apples payment plans and T-Mobile’s stipulations. It ultimately meant that if I wanted an iPhone X I’d have to go in store…
Simple way to navigate a JSON object?
Is there a simple way to navigate a large JSON object in jupyter notebook?
For example in https://jsonformatter.curiousconcept.com I can paste in a json object and then minimize/expand different layers. This is much more productive than reading through a printed json object.
I could just paste in the json object I get into the above site, but I would like a solution with the notebook so I can have a simpler workflow.
/r/JupyterNotebooks
https://redd.it/7d4zrh
Is there a simple way to navigate a large JSON object in jupyter notebook?
For example in https://jsonformatter.curiousconcept.com I can paste in a json object and then minimize/expand different layers. This is much more productive than reading through a printed json object.
I could just paste in the json object I get into the above site, but I would like a solution with the notebook so I can have a simpler workflow.
/r/JupyterNotebooks
https://redd.it/7d4zrh
Curiousconcept
JSON Formatter & Validator
Format and validate JSON data so that it can easily be read by human beings.
What's up with Shuup (previously Shoop)?
TL;DR: Is Shuup about to go subscription/enterprise mode with a limited CE edition?
Asking because:
* Search for shoop/shuup on r/django turns up ONE result,
* 2 months ago shoop was renamed shuup with a new github repo, it has ONE commit since then,
* shuup.com menu for "Products" only lists "Entersprise" and "Why shuup?",
* Download page goes to typical marketing signup-before-download page,
* Only mention of github is in the footer,
* Install docs for latest version doesn't work, requires multiple tweaks to even get to the migration.
Longer version:
I'm evaluating CMS+eCommerce options for a freelance project I've been asked to send a proposal for. I wished to try something different than the wordpress swamp this time, preferably python since I dunno, I like it?
My search first lead me to Saleor (not customizable enough for my client) -> Django-CMS+Django-Shop (couldn't get the apphooks to work easily) -> Django-Oscar (too basic, tight deadline) -> Mezzanine+Cartridge (my weapon of choice, everything just worked). But another team member suggested I check shuup as well, because they seemed to have more features (demo page looks very nice: https://demo2.shuup.com/), but the more I read and check about shuup the less I feel for it. All the activity graphs of their repos are equally dead. I mean, they have more stars, followers and forks than Cartridge, but no commits in 2 months?
Am I missing something obvious here? To me it seems like they've been bought and are in a hush-hush phase of commercializing the product and mainly focus on an enterprise version.
I just don't want to be stuck with a non-supported and/or costly framework for this project...
EDIT: Typo
/r/django
https://redd.it/7d5t15
TL;DR: Is Shuup about to go subscription/enterprise mode with a limited CE edition?
Asking because:
* Search for shoop/shuup on r/django turns up ONE result,
* 2 months ago shoop was renamed shuup with a new github repo, it has ONE commit since then,
* shuup.com menu for "Products" only lists "Entersprise" and "Why shuup?",
* Download page goes to typical marketing signup-before-download page,
* Only mention of github is in the footer,
* Install docs for latest version doesn't work, requires multiple tweaks to even get to the migration.
Longer version:
I'm evaluating CMS+eCommerce options for a freelance project I've been asked to send a proposal for. I wished to try something different than the wordpress swamp this time, preferably python since I dunno, I like it?
My search first lead me to Saleor (not customizable enough for my client) -> Django-CMS+Django-Shop (couldn't get the apphooks to work easily) -> Django-Oscar (too basic, tight deadline) -> Mezzanine+Cartridge (my weapon of choice, everything just worked). But another team member suggested I check shuup as well, because they seemed to have more features (demo page looks very nice: https://demo2.shuup.com/), but the more I read and check about shuup the less I feel for it. All the activity graphs of their repos are equally dead. I mean, they have more stars, followers and forks than Cartridge, but no commits in 2 months?
Am I missing something obvious here? To me it seems like they've been bought and are in a hush-hush phase of commercializing the product and mainly focus on an enterprise version.
I just don't want to be stuck with a non-supported and/or costly framework for this project...
EDIT: Typo
/r/django
https://redd.it/7d5t15