Lot of Django posts I see on Reddit
Hey I just started learning Django and Python. I need some help with how to do this.
‘Posts some complicated shit that makes me think why the hell am I not on this level when I just started learning Django too?’
/r/django
https://redd.it/8hgbol
Hey I just started learning Django and Python. I need some help with how to do this.
‘Posts some complicated shit that makes me think why the hell am I not on this level when I just started learning Django too?’
/r/django
https://redd.it/8hgbol
reddit
Lot of Django posts I see on Reddit • r/django
Hey I just started learning Django and Python. I need some help with how to do this. ‘Posts some complicated shit that makes me think why the...
[R][Neuroscience] Emergence of grid-like representations by training recurrent neural networks to perform spatial localization
https://arxiv.org/abs/1803.07770
/r/MachineLearning
https://redd.it/8hhcx4
https://arxiv.org/abs/1803.07770
/r/MachineLearning
https://redd.it/8hhcx4
reddit
r/MachineLearning - [R][Neuroscience] Emergence of grid-like representations by training recurrent neural networks to perform spatial…
9 votes and 1 so far on reddit
Reddit Bot Introduction - Programming Reddit Bot with PRAW in Python
https://www.youtube.com/watch?v=BaqvfTuHCJk
/r/Python
https://redd.it/8heweg
https://www.youtube.com/watch?v=BaqvfTuHCJk
/r/Python
https://redd.it/8heweg
YouTube
Reddit Bot Introduction - Programming Reddit Bot with PRAW in Python
For this video we will explore building a Bot in Reddit. Links: PycharmEDU - https://www.jetbrains.com/pycharm/ Github Reddit Examples - https://github.com/R...
What workflows are people automating?
I do financial + campaign analytics at my company and lately I’ve been at work building a full campaign forecasting + expensing + ROI calculating pipeline with several other teams. It’s exciting work but it’s mostly just procedural programming with pandas. I’m curious what others are up to. What business processes are you automating, improving or making more efficient?
/r/Python
https://redd.it/8hfx9w
I do financial + campaign analytics at my company and lately I’ve been at work building a full campaign forecasting + expensing + ROI calculating pipeline with several other teams. It’s exciting work but it’s mostly just procedural programming with pandas. I’m curious what others are up to. What business processes are you automating, improving or making more efficient?
/r/Python
https://redd.it/8hfx9w
reddit
What workflows are people automating? • r/Python
I do financial + campaign analytics at my company and lately I’ve been at work building a full campaign forecasting + expensing + ROI calculating...
The time before a page is loaded in the browser is very slow on list views with around 400 objects, what can I do to improve that and there what tools do you suggest to profile where the bottlenecks lie?
I can paginate generic list views, and that does improve the time for the page to be served.
But I have some other list views which use FilterSet from django-filter, and those can't be paginated(well, out of the box, at least)
They can take around 16 secs to fully send the page to the browser, and that's just for around 400 objects. I know the problem is not database related, because according to django-debug-toolbar the SQL quiries finish around 150 ms.
Are these serving times normal?
/r/djangolearning
https://redd.it/8hjgp4
I can paginate generic list views, and that does improve the time for the page to be served.
But I have some other list views which use FilterSet from django-filter, and those can't be paginated(well, out of the box, at least)
They can take around 16 secs to fully send the page to the browser, and that's just for around 400 objects. I know the problem is not database related, because according to django-debug-toolbar the SQL quiries finish around 150 ms.
Are these serving times normal?
/r/djangolearning
https://redd.it/8hjgp4
reddit
The time before a page is loaded in the browser... • r/djangolearning
I can paginate generic list views, and that does improve the time for the page to be served. But I have some other list views which use FilterSet...
[AF] Getting error 404 when using search bar?
Hi, so I want to make a search-bar which searches the database for posts with the same name as the query.
Here is the current code I have in my routes.py file:
@app.route('/search_result/<search_str>', methods=['GET'])
def search_result(search_str):
post_query = Post.query.filter_by(title=search_str).all()
topic_query = Topic.query.filter_by(tag_name=search_str).all()
return render_template('search_result.html', post_query=post_query, topic_query=topic_query)
@app.route('/search', methods=['GET', 'POST'])
def search():
form = SearchForm()
if request.method == 'POST' and form.validate_on_submit():
search_str = form.search_str.data
return redirect(url_for('search_result', search_str=str(search_str)))
return redirect(url_for('search_result', search_str=form.search_str.data))
And here is the code for the base.html file:
<div class="searchbar">
<form action="{{ url_for('search') }}" method=post>
<input type="text" name="search" placeholder="Search...">
</form>
</div>
So my problem is this. Whenever I make a search using the input, for some reason it is never saved and an error 404 is made. What should happen is that the search() function would take the inputs from the form and redirect to the search_result route.
What exactly is going on?
Here is my github repo for it if you need more context:
https://www.github.com/ModoUnreal/dopenet
/r/flask
https://redd.it/8gruit
Hi, so I want to make a search-bar which searches the database for posts with the same name as the query.
Here is the current code I have in my routes.py file:
@app.route('/search_result/<search_str>', methods=['GET'])
def search_result(search_str):
post_query = Post.query.filter_by(title=search_str).all()
topic_query = Topic.query.filter_by(tag_name=search_str).all()
return render_template('search_result.html', post_query=post_query, topic_query=topic_query)
@app.route('/search', methods=['GET', 'POST'])
def search():
form = SearchForm()
if request.method == 'POST' and form.validate_on_submit():
search_str = form.search_str.data
return redirect(url_for('search_result', search_str=str(search_str)))
return redirect(url_for('search_result', search_str=form.search_str.data))
And here is the code for the base.html file:
<div class="searchbar">
<form action="{{ url_for('search') }}" method=post>
<input type="text" name="search" placeholder="Search...">
</form>
</div>
So my problem is this. Whenever I make a search using the input, for some reason it is never saved and an error 404 is made. What should happen is that the search() function would take the inputs from the form and redirect to the search_result route.
What exactly is going on?
Here is my github repo for it if you need more context:
https://www.github.com/ModoUnreal/dopenet
/r/flask
https://redd.it/8gruit
GitHub
ModoUnreal/dopenet
dopenet - The ideal template to make websites in 2018!!!! (I'm kidding of course)
How to Create and Manage Menus of Wagtail CMS
I wrote a blog post talking about how to create and manage menus in Wagtail CMS. It would help you understand how the menu in Wagtail works, and it would also introduce you wagtailmenus, a powerful menu plugin for Wagtail.
[How to Create and Manage Menus of Wagtail CMS](https://blog.michaelyin.info/2018/05/06/wagtail-tutorial-12-how-create-and-manage-menus-wagtail-application/)
BTW, if you have question about Wagtail, feel free to ask.
/r/django
https://redd.it/8hmamp
I wrote a blog post talking about how to create and manage menus in Wagtail CMS. It would help you understand how the menu in Wagtail works, and it would also introduce you wagtailmenus, a powerful menu plugin for Wagtail.
[How to Create and Manage Menus of Wagtail CMS](https://blog.michaelyin.info/2018/05/06/wagtail-tutorial-12-how-create-and-manage-menus-wagtail-application/)
BTW, if you have question about Wagtail, feel free to ask.
/r/django
https://redd.it/8hmamp
blog.michaelyin.info
Wagtail Tutorial #12: How to Create and Manage Menus of Wagtail application
In this Wagtail tutorial, we would learn how menu in Wagtail works, and how to create a powerful menu using wagtailmenus package.
The other (great) benefit of Python type annotations
https://medium.com/@shamir.stav_83310/the-other-great-benefit-of-python-type-annotations-896c7d077c6b
/r/Python
https://redd.it/8hmjq9
https://medium.com/@shamir.stav_83310/the-other-great-benefit-of-python-type-annotations-896c7d077c6b
/r/Python
https://redd.it/8hmjq9
Medium
The other (great) benefit of Python type annotations
This story was originally published in my blog.
Glowscript in JupyterLab
I believe I read that currently there are no plans to have JavaScript implemented in JupyterLab. This would mean that Glowscript would no longer be supported. Am I reading this wrong, or are glowscript’s days numbered with Jupiter? Or perhaps Jupyter notebooks will be around for the foreseeable future? I think many physics educators would be interested in knowing if glowscript will still be supported.
/r/IPython
https://redd.it/8hgavu
I believe I read that currently there are no plans to have JavaScript implemented in JupyterLab. This would mean that Glowscript would no longer be supported. Am I reading this wrong, or are glowscript’s days numbered with Jupiter? Or perhaps Jupyter notebooks will be around for the foreseeable future? I think many physics educators would be interested in knowing if glowscript will still be supported.
/r/IPython
https://redd.it/8hgavu
reddit
r/IPython - Glowscript in JupyterLab
2 votes and 1 so far on reddit
Pyception - Nerdy parody for Inception ( Love the creativity )
https://www.youtube.com/watch?v=UXd0EDy7aTY
/r/Python
https://redd.it/8hodmx
https://www.youtube.com/watch?v=UXd0EDy7aTY
/r/Python
https://redd.it/8hodmx
YouTube
2018 AnacondaCON
Pyception
[AF] It's 2018 - how do you document your REST APIs in Flask?
Hey everyone, I'm currently using Flask as a RESTful API endpoint using Flask-RESTful. At the moment I'm just writing the API without any sort of documentation at all. I have no idea where to turn to learn about building documentation for my APIs, or if Flask-RESTful is still even the consensus king for setting up REST endpoints in Flask. Most documentation I can find on this subject is years old.
So my question: it's 2018 - what is everyone using for RESTful API endpoints + documentation in Flask?
/r/flask
https://redd.it/8hqj5r
Hey everyone, I'm currently using Flask as a RESTful API endpoint using Flask-RESTful. At the moment I'm just writing the API without any sort of documentation at all. I have no idea where to turn to learn about building documentation for my APIs, or if Flask-RESTful is still even the consensus king for setting up REST endpoints in Flask. Most documentation I can find on this subject is years old.
So my question: it's 2018 - what is everyone using for RESTful API endpoints + documentation in Flask?
/r/flask
https://redd.it/8hqj5r
reddit
[AF] It's 2018 - how do you document your REST APIs in... • r/flask
Hey everyone, I'm currently using Flask as a RESTful API endpoint using Flask-RESTful. At the moment I'm just writing the API without any sort of...
Keeping data integrity with Django migrations
https://cheesecakelabs.com/br/blog/keeping-data-integrity-django-migrations/
/r/django
https://redd.it/8hqa4k
https://cheesecakelabs.com/br/blog/keeping-data-integrity-django-migrations/
/r/django
https://redd.it/8hqa4k
Cheesecake Labs
Keeping data integrity with Django migrations | Cheesecake Labs
Django built-in migrations were designed as a way of propagating the changes you make on the models to the database. Migrations exist mostly to keep your code in sync with your schema and to provide a good way of versioning it. We just need a couple of commands…
Running a python script together with django - best practice question
Hi, this is very tangential to regular python programming, but maybe you guys have encountered the same problem!
I'm building a web-app that needs support from a script, or other application running on the server. The function of the script is to match entries from an order model.
Short-code: matcher.py
from app.models import item1model, item2model, madematchmodel
import time
While True:
item1=item1model.objects.get(identifier='id')
item2=item2model.objects.get(identifier='id')
if match:
match=madematchmodel(item1=item1, item2=item2)
match.save()
else:
pass
time.sleep(5)
As you might notice I'm a novice at both django and programming in general, am I breaking any major rules by having a constantly running While True:-script here?
What is a better way to accomplish this?
/r/django
https://redd.it/8hr5jz
Hi, this is very tangential to regular python programming, but maybe you guys have encountered the same problem!
I'm building a web-app that needs support from a script, or other application running on the server. The function of the script is to match entries from an order model.
Short-code: matcher.py
from app.models import item1model, item2model, madematchmodel
import time
While True:
item1=item1model.objects.get(identifier='id')
item2=item2model.objects.get(identifier='id')
if match:
match=madematchmodel(item1=item1, item2=item2)
match.save()
else:
pass
time.sleep(5)
As you might notice I'm a novice at both django and programming in general, am I breaking any major rules by having a constantly running While True:-script here?
What is a better way to accomplish this?
/r/django
https://redd.it/8hr5jz
reddit
r/django - Running a python script together with django - best practice question
1 votes and 3 so far on reddit
Where is Django's under the hood stuff located?
Watching the command line drift by I notice references to files that aren't in y project files, and when I get errors also. I am wondering where these files are? I' just curious as to how things work under the hood.
/r/djangolearning
https://redd.it/8hppvf
Watching the command line drift by I notice references to files that aren't in y project files, and when I get errors also. I am wondering where these files are? I' just curious as to how things work under the hood.
/r/djangolearning
https://redd.it/8hppvf
reddit
r/djangolearning - Where is Django's under the hood stuff located?
5 votes and 3 so far on reddit
Raspberry Pi, Camera Motion detection. Security surveillance for your room.
https://github.com/WillPhillipsCVdemo/Raspberry-Pi-Camera-Motion-Detection./blob/master/PIR_Motion_Camera_Email.py
/r/Python
https://redd.it/8hrfyy
https://github.com/WillPhillipsCVdemo/Raspberry-Pi-Camera-Motion-Detection./blob/master/PIR_Motion_Camera_Email.py
/r/Python
https://redd.it/8hrfyy
GitHub
Raspberry-Pi-Camera-Motion-Detection./PIR_Motion_Camera_Email.py at master · WillPhillipsCVdemo/Raspberry-Pi-Camera-Motion-Detection.
Using Python code with a Raspberry-Pi, PIR motion and a Picamera, you can create a device which will email you a snapshot image when someone enters your room. - Raspberry-Pi-Camera-Motion-Detection...
Mobile App Creation
I'm wondering, would the following be a viable strategy for a mobile application? use Python Kivy cross\-platform for front\-end; some sort of Distributed D.B like NoSQL with Python queries for Backend; and REST or SOCKET or some sort of messaging\-bus for Front\-end to back\-end interactions?
/r/Python
https://redd.it/8hsn8k
I'm wondering, would the following be a viable strategy for a mobile application? use Python Kivy cross\-platform for front\-end; some sort of Distributed D.B like NoSQL with Python queries for Backend; and REST or SOCKET or some sort of messaging\-bus for Front\-end to back\-end interactions?
/r/Python
https://redd.it/8hsn8k
reddit
Mobile App Creation • r/Python
I'm wondering, would the following be a viable strategy for a mobile application? use Python Kivy cross\-platform for front\-end; some sort of...