Users, content, and scalability
Hi, I'm looking for some advice on how to go about creating models for, say, a site like reddit. All submitted content can have a number of fields that change over time - upvotes, downvotes, etc. If I try to imagine how that might work, just upvoting a submission and then refreshing the page incurs a number of queries already. How is something like this scalable without just throwing more silicon at the problem? Yes I know of caching but with so many updates, a page from 2 seconds ago is already old.
I guess my questions are: is there an efficient way to keep track of votes or will this inevitably cost many rows? How best to model and write views for scalability? Do sites ever cache pages for several minutes to help mitigate load? Thanks in advance
/r/django
https://redd.it/8rxi41
Hi, I'm looking for some advice on how to go about creating models for, say, a site like reddit. All submitted content can have a number of fields that change over time - upvotes, downvotes, etc. If I try to imagine how that might work, just upvoting a submission and then refreshing the page incurs a number of queries already. How is something like this scalable without just throwing more silicon at the problem? Yes I know of caching but with so many updates, a page from 2 seconds ago is already old.
I guess my questions are: is there an efficient way to keep track of votes or will this inevitably cost many rows? How best to model and write views for scalability? Do sites ever cache pages for several minutes to help mitigate load? Thanks in advance
/r/django
https://redd.it/8rxi41
reddit
r/django - Users, content, and scalability
1 votes and 1 so far on reddit
Is there a library for Shamir's Secret Sharing Scheme that is well documented and works with Python 3.x??
The closest I can find is [this](https://github.com/blockstack/secret-sharing) which doesn't work with python 3.x.
/r/django
https://redd.it/8rbsxc
The closest I can find is [this](https://github.com/blockstack/secret-sharing) which doesn't work with python 3.x.
/r/django
https://redd.it/8rbsxc
GitHub
GitHub - shea256/secret-sharing: A system for securely splitting secrets with Shamir's Secret Sharing Scheme
A system for securely splitting secrets with Shamir's Secret Sharing Scheme - shea256/secret-sharing
Looking for very basic django template repository
I'm doing a simple project and am looking for an open-source repo of templates to use, similar to the HTML and CSS the admin module uses.
Does something like this exist? I'm having trouble searching for it because I'm fixating on the word template, which confuses the search results.
Thanks!
/r/djangolearning
https://redd.it/8rwafs
I'm doing a simple project and am looking for an open-source repo of templates to use, similar to the HTML and CSS the admin module uses.
Does something like this exist? I'm having trouble searching for it because I'm fixating on the word template, which confuses the search results.
Thanks!
/r/djangolearning
https://redd.it/8rwafs
reddit
Looking for very basic django template repository • r/djangolearning
I'm doing a simple project and am looking for an open-source repo of templates to use, similar to the HTML and CSS the admin module uses. Does...
How to support 2 languages in a model CharField?
Suppose I have a Book model that has a Title CharField. I want it to display english and spanish title when the page is displayed in respective language. How to do this? Also is it supported in default admin panel? Thanks!
/r/django
https://redd.it/8ry2bd
Suppose I have a Book model that has a Title CharField. I want it to display english and spanish title when the page is displayed in respective language. How to do this? Also is it supported in default admin panel? Thanks!
/r/django
https://redd.it/8ry2bd
reddit
r/django - How to support 2 languages in a model CharField?
0 votes and 3 so far on reddit
Django with RabbitMQ
Is there a way to connect to RabbitMQ without constantly haveing to open and close the connection?
Now I have to open a new connection for every message.
/r/django
https://redd.it/8ryj8u
Is there a way to connect to RabbitMQ without constantly haveing to open and close the connection?
Now I have to open a new connection for every message.
/r/django
https://redd.it/8ryj8u
reddit
r/django - Django with RabbitMQ
1 votes and 6 so far on reddit
10 common security gotchas in Python and how to avoid them
https://medium.com/@anthonypjshaw/10-common-security-gotchas-in-python-and-how-to-avoid-them-e19fbe265e03
/r/Python
https://redd.it/8rxbab
https://medium.com/@anthonypjshaw/10-common-security-gotchas-in-python-and-how-to-avoid-them-e19fbe265e03
/r/Python
https://redd.it/8rxbab
Hacker Noon
10 common security gotchas in Python and how to avoid them
Writing secure code is hard. When you learn a language, a module or a framework, you learn how it supposed to be used. When thinking about…
Top 20 Python libraries for data science in 2018
https://www.activewizards.com/blog/top-20-python-libraries-for-data-science-in-2018/?utm_source=reddit&utm_medium=python&utm_campaign=python_2018
/r/Python
https://redd.it/8rzp6x
https://www.activewizards.com/blog/top-20-python-libraries-for-data-science-in-2018/?utm_source=reddit&utm_medium=python&utm_campaign=python_2018
/r/Python
https://redd.it/8rzp6x
ActiveWizards: data science and engineering lab
Top 20 Python libraries for data science | ActiveWizards: data science and engineering lab
An expanded list of best Python libraries for data science with a fresh look to the ones we already talked about.
The Ultimate List of Python YouTube Channels
https://realpython.com/python-youtube-channels/
/r/Python
https://redd.it/8s07vc
https://realpython.com/python-youtube-channels/
/r/Python
https://redd.it/8s07vc
Realpython
The Ultimate List of Python YouTube Channels – Real Python
We couldn't find a good and updated list of Python developer or Python programming YouTube channels online. So we created our own list with the best and most Pythonic YouTubers.
give an API key for REST flask api
Hello
I made my rest api using flask. and I am using flask-jwt-extended for tokens. each request will generate access and refresh tokens. While testing everything worked perfectly
HOWEVER
I started learning react for my frontend. I pretty much followed this \[modern react with redux by stephen\]([https://www.udemy.com/react-redux/](https://www.udemy.com/react-redux/learn/v4/)). He used api keys on different occasions: youtube api, googlemap api, a weather api and a costume api he made to demonstrate.
Now I have also dealt with twitter and reddit api before. all of them give an "access" key of some sort. This key does not expire and it doesn't need any refresh.
my question is, how to make an "api" key for consumers? or more technically for my front-end usage?
Thank you
/r/flask
https://redd.it/8s2rzu
Hello
I made my rest api using flask. and I am using flask-jwt-extended for tokens. each request will generate access and refresh tokens. While testing everything worked perfectly
HOWEVER
I started learning react for my frontend. I pretty much followed this \[modern react with redux by stephen\]([https://www.udemy.com/react-redux/](https://www.udemy.com/react-redux/learn/v4/)). He used api keys on different occasions: youtube api, googlemap api, a weather api and a costume api he made to demonstrate.
Now I have also dealt with twitter and reddit api before. all of them give an "access" key of some sort. This key does not expire and it doesn't need any refresh.
my question is, how to make an "api" key for consumers? or more technically for my front-end usage?
Thank you
/r/flask
https://redd.it/8s2rzu
Udemy
Modern React with Redux Training Course
Master React and Redux. Apply modern design patterns to build apps with React Router, TailwindCSS, Context, and Hooks!
pypi? Nope, never heard of that website before. Sorry.
https://github.com/google/diff-match-patch/issues/17
/r/Python
https://redd.it/8s0ktr
https://github.com/google/diff-match-patch/issues/17
/r/Python
https://redd.it/8s0ktr
GitHub
pypi release out of date · Issue #17 · google/diff-match-patch
Hi, The version of diff-match-patch on pypi is pretty out of date (2012-2013): https://pypi.org/project/diff-match-patch/ Do you have the ability to update this?
What's next after basic CRUD?
Hello guys,
It's me again with another dumb question.
I've "finished" few basic apps in my project. I have working CRUD for each app/model and I feel lost now. I'd like to add few things, but I'm not sure what's the best next step
\- Dashboard with charts, maybe few basic forms to add quickly object for specific model
\- Few simple "buttons" to do special actions eg. quickly increase/decrease amount in IntegerField
\- Ability to use custom script (It takes list of IDs and create pdfs of chosen ids), smth like form in which i could add ids and amounts of each id to pass it to the script
What should I do? Things like this require some frontend tools like react? Or can I do it with plain Django?
If I have to use frontend framework, which is better (for project and future job), react or vue?
If I use frontend framework, do I need to create REST API for each app in my project?
Thanks for any advices!
/r/djangolearning
https://redd.it/8s276j
Hello guys,
It's me again with another dumb question.
I've "finished" few basic apps in my project. I have working CRUD for each app/model and I feel lost now. I'd like to add few things, but I'm not sure what's the best next step
\- Dashboard with charts, maybe few basic forms to add quickly object for specific model
\- Few simple "buttons" to do special actions eg. quickly increase/decrease amount in IntegerField
\- Ability to use custom script (It takes list of IDs and create pdfs of chosen ids), smth like form in which i could add ids and amounts of each id to pass it to the script
What should I do? Things like this require some frontend tools like react? Or can I do it with plain Django?
If I have to use frontend framework, which is better (for project and future job), react or vue?
If I use frontend framework, do I need to create REST API for each app in my project?
Thanks for any advices!
/r/djangolearning
https://redd.it/8s276j
reddit
r/djangolearning - What's next after basic CRUD?
7 votes and 4 so far on reddit
Overiq Djangobin - A project based tutorial for Django 1.11
Hello everyone!
I have just finished writing Django 1.11 tutorial, where we will build a pastebin application called djangobin.
Tutorial link: https://overiq.com/django/1.11/intro-to-django/
Live Demo: http://overiq.pythonanywhere.com/
Github source: https://github.com/overiq/djangobin
/r/django
https://redd.it/8rz0h4
Hello everyone!
I have just finished writing Django 1.11 tutorial, where we will build a pastebin application called djangobin.
Tutorial link: https://overiq.com/django/1.11/intro-to-django/
Live Demo: http://overiq.pythonanywhere.com/
Github source: https://github.com/overiq/djangobin
/r/django
https://redd.it/8rz0h4
i have prebinned data. how can i use pandas and seaborn to display histograms based on those bins
see title.
I have csv files of this form
mass (g),count
0-499,600
500-999,2244
1000-1499,3245
...
4500-4999,2095
5000-8165,201
i have 6 such csv files and i'd like to see 6 histograms. the fact that the data is prebinned is giving me issues. i'd appreciate a hint! thanks for your time.
/r/pystats
https://redd.it/8s5tty
see title.
I have csv files of this form
mass (g),count
0-499,600
500-999,2244
1000-1499,3245
...
4500-4999,2095
5000-8165,201
i have 6 such csv files and i'd like to see 6 histograms. the fact that the data is prebinned is giving me issues. i'd appreciate a hint! thanks for your time.
/r/pystats
https://redd.it/8s5tty
reddit
r/pystats - i have prebinned data. how can i use pandas and seaborn to display histograms based on those bins
1 votes and 2 so far on reddit
MozartFlow: Doing analysis on audio like gender classification, instrument recognition, voice separation, genre classification | Not completed; If anyone interested, do collab.
https://github.com/techcentaur/MozartFlow
/r/Python
https://redd.it/8s6ll7
https://github.com/techcentaur/MozartFlow
/r/Python
https://redd.it/8s6ll7
GitHub
techcentaur/MozartFlow
MozartFlow - Using machine learning for the study of music.
Need help with chart.js and django.
Im using chart.js to display charts in my django website. I am also using an API call that then parses out JSON data for the chart using python. Does anyone then know how to use an axios call within javascript to call and display the data through my index.html file?
/r/django
https://redd.it/8s89tb
Im using chart.js to display charts in my django website. I am also using an API call that then parses out JSON data for the chart using python. Does anyone then know how to use an axios call within javascript to call and display the data through my index.html file?
/r/django
https://redd.it/8s89tb
reddit
r/django - Need help with chart.js and django.
0 votes and 1 so far on reddit
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/8s95kt
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/8s95kt
reddit
r/Python - What's everyone working on this week?
1 votes and 2 so far on reddit
queryset appears empty in debugger during testing, but not in console
Hello,
I'm testing REST APIs with `rest_framework.test.APITestCase`, using their client for making requests and `model_mommy` for creating objects in the `setUp()` method.
The general working is quite simple: the view is supposed to fetch a User and an object, and assign permissions for the former to the latter by means of django-guardian's `assign_perm`; the test creates a user and a group in the `setUp` method, then the actual test performs a POST passing their pk's as payload.
The issue I'm seeing, is that when the `User.objects.filter(pk__in=people_ids)` instruction is executed, the value I see in the debugger is that of an empty queryset, while if I type the exact same line in a console connected to the same session as the debugger I see the actual value being found.
Then the view gets to the `assign_perm` instruction, and it crashes with an `IndexError: list index out of range` error on the first evaluation of the queryset itself, which happens on the for loop at line 247 in the file core.py of the django-guardian library.
Is there something obvious that I should be looking at, because I really cannot wrap my head around this.
(django 1.11.13)
Thanks
/r/django
https://redd.it/8s9y48
Hello,
I'm testing REST APIs with `rest_framework.test.APITestCase`, using their client for making requests and `model_mommy` for creating objects in the `setUp()` method.
The general working is quite simple: the view is supposed to fetch a User and an object, and assign permissions for the former to the latter by means of django-guardian's `assign_perm`; the test creates a user and a group in the `setUp` method, then the actual test performs a POST passing their pk's as payload.
The issue I'm seeing, is that when the `User.objects.filter(pk__in=people_ids)` instruction is executed, the value I see in the debugger is that of an empty queryset, while if I type the exact same line in a console connected to the same session as the debugger I see the actual value being found.
Then the view gets to the `assign_perm` instruction, and it crashes with an `IndexError: list index out of range` error on the first evaluation of the queryset itself, which happens on the for loop at line 247 in the file core.py of the django-guardian library.
Is there something obvious that I should be looking at, because I really cannot wrap my head around this.
(django 1.11.13)
Thanks
/r/django
https://redd.it/8s9y48
reddit
r/django - queryset appears empty in debugger during testing, but not in console
1 votes and 0 so far on reddit