Is there a way to make radioField within for loop ? if possible how to set the values for them?
/r/flask
https://redd.it/8d81jw
/r/flask
https://redd.it/8d81jw
reddit
Is there a way to make radioField within for loop ? if... • r/flask
7 points and 7 comments so far on reddit
Adding a CMS solution to existing Django.
Can someone help me locate a CMS solution/add on the an existing standard Django system?
It seems everything I'm finding is a purely stand alone CMS system built on Django. What I have is an existing website that I want to add a managed blog to with a nice WYSIWYG editor for our marketing people.
If you can help point me in the right direction I greatly appreciate your time.
/r/django
https://redd.it/8d9b5w
Can someone help me locate a CMS solution/add on the an existing standard Django system?
It seems everything I'm finding is a purely stand alone CMS system built on Django. What I have is an existing website that I want to add a managed blog to with a nice WYSIWYG editor for our marketing people.
If you can help point me in the right direction I greatly appreciate your time.
/r/django
https://redd.it/8d9b5w
reddit
Adding a CMS solution to existing Django. • r/django
Can someone help me locate a CMS solution/add on the an existing standard Django system? It seems everything I'm finding is a purely stand alone...
[Ask Flask] Context_processor usage brings up a TypeError?
Hi, so I'm working on a website which allows users to make and delete posts. The delete function should be accessible using a link below said post, much like posts on Reddit, so I wrote this line in my index.html file:
<p><a href={{ delete_posts(post_id=post.id) }}>Delete</a><p>
The delete_posts function is here:
@app.context_processor
def utility_processor():
def delete_posts(post_id):
post = Post.query.filter_by(id=post_id).first()
if post != None: # This statement was added after the error was found, but it has no effect
db.session.delete(post)
db.session.commit()
When I run this I get the following error:
> TypeError: 'NoneType' object is not iterable
I was using the example on the flask website, so I'm expecting it has something to do with the database being used?
Here is a link to the full html file, and a .txt file containing the error.
https://gist.github.com/ModoUnreal/031741e6a8fe6277a786f11e6261c7f5
/r/flask
https://redd.it/8c1fiy
Hi, so I'm working on a website which allows users to make and delete posts. The delete function should be accessible using a link below said post, much like posts on Reddit, so I wrote this line in my index.html file:
<p><a href={{ delete_posts(post_id=post.id) }}>Delete</a><p>
The delete_posts function is here:
@app.context_processor
def utility_processor():
def delete_posts(post_id):
post = Post.query.filter_by(id=post_id).first()
if post != None: # This statement was added after the error was found, but it has no effect
db.session.delete(post)
db.session.commit()
When I run this I get the following error:
> TypeError: 'NoneType' object is not iterable
I was using the example on the flask website, so I'm expecting it has something to do with the database being used?
Here is a link to the full html file, and a .txt file containing the error.
https://gist.github.com/ModoUnreal/031741e6a8fe6277a786f11e6261c7f5
/r/flask
https://redd.it/8c1fiy
Gist
index file for question
How to integrate crawler in flask? I have python code but how to run it with flask.
/r/flask
https://redd.it/8bxsco
/r/flask
https://redd.it/8bxsco
reddit
How to integrate crawler in flask? I have python code... • r/flask
2 points and 7 comments so far on reddit
Robust Word2Vec Models with Gensim & Applying Word2Vec Features for Machine Learning Tasks
https://www.kdnuggets.com/2018/04/robust-word2vec-models-gensim.html
/r/Python
https://redd.it/8ddzxi
https://www.kdnuggets.com/2018/04/robust-word2vec-models-gensim.html
/r/Python
https://redd.it/8ddzxi
reddit
Robust Word2Vec Models with Gensim & Applying... • r/Python
2 points and 0 comments so far on reddit
Understanding how to write a custom middleware in Django
https://www.zeolearn.com/magazine/what-are-middlewares
/r/django
https://redd.it/8ddc54
https://www.zeolearn.com/magazine/what-are-middlewares
/r/django
https://redd.it/8ddc54
Zeolearn
Understanding how to write a custom middleware in Django | Setup custom Django Middleware
Learn how to Create a custom middleware component for Django.It gives you a better understanding how to write Django middleware.Explore how to process and modify Django middleware
[AF] SQLAlchemy: Converting a query object to raw SQL & parameters and then executing it
I hope that it is OK to post this question here, although it is not strictly related to Flask. I couldn't find a better place to post it.
Context: Flask, SQLAlchemy and MySQL
I am looking for a way to convert a query object to raw SQL and parameters and save this in a dictionary, in order to be able to pickle dump and load the dictionary before executing the query. How can I achieve converting the query and then executing the text and parameters with SQLAlcehmy?
I'd be eternally grateful if anyone could point me in the right direction.
/r/flask
https://redd.it/8dewj6
I hope that it is OK to post this question here, although it is not strictly related to Flask. I couldn't find a better place to post it.
Context: Flask, SQLAlchemy and MySQL
I am looking for a way to convert a query object to raw SQL and parameters and save this in a dictionary, in order to be able to pickle dump and load the dictionary before executing the query. How can I achieve converting the query and then executing the text and parameters with SQLAlcehmy?
I'd be eternally grateful if anyone could point me in the right direction.
/r/flask
https://redd.it/8dewj6
Reddit
reddit: the front page of the internet
r/flask: Flask is a Python micro-framework for web development. Flask is easy to get started and a great way to build web sites and web applications.
Add a Blog to Django project using Wagtail
In this tutorial, we'll add a blog to your Django project, using Wagtail.
After you follow this tutorial, you'll have:
1. An independent CMS admin for you to manage your blog, coexisting with your classic Django admin.
2. A standard blog using a Bootstrap theme, on a `/blog/` URL.
3. Blog posts which support Markdown and Latex syntax.
[Add a blog to your Django project, using Wagtail](https://wagtail.io/blog/add-wagtail-blog-to-django-app/)
/r/django
https://redd.it/8deohd
In this tutorial, we'll add a blog to your Django project, using Wagtail.
After you follow this tutorial, you'll have:
1. An independent CMS admin for you to manage your blog, coexisting with your classic Django admin.
2. A standard blog using a Bootstrap theme, on a `/blog/` URL.
3. Blog posts which support Markdown and Latex syntax.
[Add a blog to your Django project, using Wagtail](https://wagtail.io/blog/add-wagtail-blog-to-django-app/)
/r/django
https://redd.it/8deohd
Wagtail CMS
Add a Wagtail blog app to your Django project | Wagtail CMS
In this tutorial from guest author Michael Yin, we'll add a blog to your Django project, using Wagtail.
Beagle Scraper - open source low resource e-commerce category scraper
https://github.com/ChrisRoark/beagle_scraper
/r/Python
https://redd.it/8dfit0
https://github.com/ChrisRoark/beagle_scraper
/r/Python
https://redd.it/8dfit0
GitHub
ChrisRoark/beagle_scraper
beagle_scraper - Scraper for categories and lists on ecommerce and other listing websites
JavaScripthon 0.9 has been released
I'm pleased to announce the release of version 0.9 of JavaScripthon!
JavaScripthon is a small and unobtrusive yet powerful
Python-to-JavaScript compiler for Python 3.5+ that targets ES6+
syntax.
Changes since the previous version:
- add a --source-name options to be used together with
--inline-map when using -s;
- move main repository to gitlab.com/metapensiero;
- add support for default export and import;
- add documentation for the JS() marker function;
- refactor of the JS AST nodes;
- fix path splitting and joining on Windows (thanks to Roman Yakubuk);
There are some new contributions in this release:
- [BrainBacon](https://github.com/BrainBacon) has made a [JavaScripthon loader for WebPack](https://github.com/Beg-in/javascripthon-loader);
- [icarito](https://github.com/icarito) has contributed support for JavaScripthon to the [python-webpack-loader for WebPack](https://github.com/martim00/python-webpack-loader);
- [icarito](https://github.com/icarito) has also [integrated JavaScripthon with Nuxt.js and Vue.js](https://nuxt-python.surge.sh);
- [chfw](https://github.com/chfw) has [integrated JavaScripthon into pyecharts](https://github.com/pyecharts/pyecharts) to allow
Python function translation.
For more informations se the project homepage at https://gitlab.com/metapensiero/metapensiero.pj
It's also mirrored on github at https://github.com/metapensiero/metapensiero.pj
/r/Python
https://redd.it/8dgoct
I'm pleased to announce the release of version 0.9 of JavaScripthon!
JavaScripthon is a small and unobtrusive yet powerful
Python-to-JavaScript compiler for Python 3.5+ that targets ES6+
syntax.
Changes since the previous version:
- add a --source-name options to be used together with
--inline-map when using -s;
- move main repository to gitlab.com/metapensiero;
- add support for default export and import;
- add documentation for the JS() marker function;
- refactor of the JS AST nodes;
- fix path splitting and joining on Windows (thanks to Roman Yakubuk);
There are some new contributions in this release:
- [BrainBacon](https://github.com/BrainBacon) has made a [JavaScripthon loader for WebPack](https://github.com/Beg-in/javascripthon-loader);
- [icarito](https://github.com/icarito) has contributed support for JavaScripthon to the [python-webpack-loader for WebPack](https://github.com/martim00/python-webpack-loader);
- [icarito](https://github.com/icarito) has also [integrated JavaScripthon with Nuxt.js and Vue.js](https://nuxt-python.surge.sh);
- [chfw](https://github.com/chfw) has [integrated JavaScripthon into pyecharts](https://github.com/pyecharts/pyecharts) to allow
Python function translation.
For more informations se the project homepage at https://gitlab.com/metapensiero/metapensiero.pj
It's also mirrored on github at https://github.com/metapensiero/metapensiero.pj
/r/Python
https://redd.it/8dgoct
GitLab
metapensiero
An Azazel and Lele joint venture
Efficiently searching large databases?
One of my favorite things about databases is that you're able to search through tons of data and find things quickly, but I'm not really familiar with best practices.
On discord, there is a search feature that seems pretty comprehensive. It goes through all of the messages in a server and finds every message with the phrase given. How is this implemented? It seems like something like this might be a heavy operation if there are a lot of messages.
/r/django
https://redd.it/8dh2z0
One of my favorite things about databases is that you're able to search through tons of data and find things quickly, but I'm not really familiar with best practices.
On discord, there is a search feature that seems pretty comprehensive. It goes through all of the messages in a server and finds every message with the phrase given. How is this implemented? It seems like something like this might be a heavy operation if there are a lot of messages.
/r/django
https://redd.it/8dh2z0
reddit
Efficiently searching large databases? • r/django
One of my favorite things about databases is that you're able to search through tons of data and find things quickly, but I'm not really familiar...
Flask Live Webcast with Miguel Grinberg
Hi everyone! This Saturday at 9am US/Pacific time I will be hosting a 2nd Flask live streaming event, for those interested. The topic is going to be the Flask request and application contexts. If you ever got those obscure errors about working outside of a request or application context and did not understand what that means, I will try to solve the mystery for you, using easy to follow examples.
The webcast will be streamed on youtube at https://www.youtube.com/watch?v=Z4X5Oddhcc8.
Obviously you will be able to watch the recording later if you miss it, but the nice thing about watching it live is that you can post questions and vote on questions submitted by others. In the second portion of the webcast I will answer as many questions as I can starting from the most voted.
Hope to see you on Saturday! If you want to watch the first live stream, which I did about a month ago, it's [here](https://www.youtube.com/watch?v=fft6IvL-y1g).
/r/flask
https://redd.it/8dgro1
Hi everyone! This Saturday at 9am US/Pacific time I will be hosting a 2nd Flask live streaming event, for those interested. The topic is going to be the Flask request and application contexts. If you ever got those obscure errors about working outside of a request or application context and did not understand what that means, I will try to solve the mystery for you, using easy to follow examples.
The webcast will be streamed on youtube at https://www.youtube.com/watch?v=Z4X5Oddhcc8.
Obviously you will be able to watch the recording later if you miss it, but the nice thing about watching it live is that you can post questions and vote on questions submitted by others. In the second portion of the webcast I will answer as many questions as I can starting from the most voted.
Hope to see you on Saturday! If you want to watch the first live stream, which I did about a month ago, it's [here](https://www.youtube.com/watch?v=fft6IvL-y1g).
/r/flask
https://redd.it/8dgro1
YouTube
Flask Webcast #2: Request and Application Contexts
Join me for a live session in which I'll discuss the Flask contexts and the very confusing errors that these can cause when used incorrectly. After the session I will answer your questions and give away some books!
Is Coalesce a good practice ?
I am trying to get some statistics about my data, min, max, average etc and sometimes it's possible that there are no data to aggregate on, so the result should be 0.0
With no data aggregation returns None, so I have been doing something like below:
products.aggregate(total_profit=Coalesce(Sum("profit"), 0.0)).get("total_profit", 0.00)
Is this a good practice ?
/r/django
https://redd.it/8djdq8
I am trying to get some statistics about my data, min, max, average etc and sometimes it's possible that there are no data to aggregate on, so the result should be 0.0
With no data aggregation returns None, so I have been doing something like below:
products.aggregate(total_profit=Coalesce(Sum("profit"), 0.0)).get("total_profit", 0.00)
Is this a good practice ?
/r/django
https://redd.it/8djdq8
reddit
Is Coalesce a good practice ? • r/django
I am trying to get some statistics about my data, min, max, average etc and sometimes it's possible that there are no data to aggregate on, so the...
[template language] queryset indexing not working
hello,
here's my code
{% if entries %}
{% for entry in entries %}
<div>{{ entry }}</div>
<div>{{ entry.0 }}</div>
<div>{{ entry.1 }}</div>
{% endfor %}
{% endif %}
and here's what i'm getting
<QuerySet [<FichierCopie: FichierCopie object (1)>, <FichierCopie: FichierCopie object (2)>]>
<FichierCopie: FichierCopie object (2)>
<FichierCopie: FichierCopie object (2)>
-> entry.0 and entry.1 are giving the same element
what's is the problem here
/r/django
https://redd.it/8dl2nm
hello,
here's my code
{% if entries %}
{% for entry in entries %}
<div>{{ entry }}</div>
<div>{{ entry.0 }}</div>
<div>{{ entry.1 }}</div>
{% endfor %}
{% endif %}
and here's what i'm getting
<QuerySet [<FichierCopie: FichierCopie object (1)>, <FichierCopie: FichierCopie object (2)>]>
<FichierCopie: FichierCopie object (2)>
<FichierCopie: FichierCopie object (2)>
-> entry.0 and entry.1 are giving the same element
what's is the problem here
/r/django
https://redd.it/8dl2nm
reddit
[template language] queryset indexing not working • r/django
hello, here's my code {% if entries %} {% for entry in entries %} {{ entry }} {{ entry.0...
Advice on approach to research dashboard
Hi everyone. I'm currently working on a project, in which we're pulling from a server (json-format), based on user ids. The idea now, is to make somewhat of a research dashboard for people not familiar with python, where they can execute basic operations. Aside from actually retrieving the data and possibly converting it to a format that's more accessible (such as csv) for data-analytic purposes, I have several annotation scripts that may or not may be interesting for the researchers purpose. The dashboard's purpose, then, is to allow users to select the ids they want and export the data, and select which annotations they want to include, or load a local dataset and do annotations. My question is pretty simple: which python gui framework or other frontend method would you recommend for such an approach? I have a little experience with js on a fundamental level, that's about it.
/r/Python
https://redd.it/8dm99a
Hi everyone. I'm currently working on a project, in which we're pulling from a server (json-format), based on user ids. The idea now, is to make somewhat of a research dashboard for people not familiar with python, where they can execute basic operations. Aside from actually retrieving the data and possibly converting it to a format that's more accessible (such as csv) for data-analytic purposes, I have several annotation scripts that may or not may be interesting for the researchers purpose. The dashboard's purpose, then, is to allow users to select the ids they want and export the data, and select which annotations they want to include, or load a local dataset and do annotations. My question is pretty simple: which python gui framework or other frontend method would you recommend for such an approach? I have a little experience with js on a fundamental level, that's about it.
/r/Python
https://redd.it/8dm99a
reddit
Advice on approach to research dashboard • r/Python
Hi everyone. I'm currently working on a project, in which we're pulling from a server (json-format), based on user ids. The idea now, is to make...
Choosing VPS for relatively simple news site
Hi everyone.
What should I look for when choosing a vps for a longread-focused website? The stack is nginx+uwsgi+django+wagtail, with a few celery tasks and psql database. Would it be reasonable to expect it perform well (hold up to 1000 simultaneous users) on a setup with 4 vCPU and 8 Gb RAM? The project has no comments or other form of inter-user communication and all the content is entered through admin panel.
/r/django
https://redd.it/8dmfuu
Hi everyone.
What should I look for when choosing a vps for a longread-focused website? The stack is nginx+uwsgi+django+wagtail, with a few celery tasks and psql database. Would it be reasonable to expect it perform well (hold up to 1000 simultaneous users) on a setup with 4 vCPU and 8 Gb RAM? The project has no comments or other form of inter-user communication and all the content is entered through admin panel.
/r/django
https://redd.it/8dmfuu
reddit
Choosing VPS for relatively simple news site • r/django
Hi everyone. What should I look for when choosing a vps for a longread-focused website? The stack is nginx+uwsgi+django+wagtail, with a few...
PyTorch for Recommenders 101
http://blog.fastforwardlabs.com/2018/04/10/pytorch-for-recommenders-101.html
/r/Python
https://redd.it/8dmjgs
http://blog.fastforwardlabs.com/2018/04/10/pytorch-for-recommenders-101.html
/r/Python
https://redd.it/8dmjgs
Fastforwardlabs
PyTorch for Recommenders 101
Recommenders, generally associated with e-commerce, sift though a huge inventory of available items to find and recommend ones that a user will like. Different from search, recommenders rely on historical data to tease out user preference. How does a recommender…