Any tipps for teaching flask for beginners without any preknowledge of python?
Hi y'all!
Soon I will give a little webdevelopment boot camp on Python / HTML / Flask. This is my current rough structure of what I wanna do:
1. Intro to Python, pip and virtualenv
2. Intro to HTML
3. Intro to SQL / Postgres
4. Flask:
* The Request-Response Cycle
* Creating a Homepage
* Templating
* Routes.py
* Static Files
* Creating a database (Postgres)
* Connecting Flask to Postgres
* Writing the User Model
* Creating, rendering and validating a form
* Saving a user to the Database
* Sessions / Sign In / Sign Out
​
Does anyone of you have experience with teaching python to group? I have some concerns, since this is the first time I will teach a rather complex topic to people without any preknowledge:
They will need to install Python, pip, virtualenv, a texteditor such as Brackets and Postgres. Since they will use their personal laptops, I am a little concerned, that there might occur some issues already with getting python running. Do you have some recommendations how to handle the setup? I am especially concerned since they will use
/r/flask
https://redd.it/c96ydp
Hi y'all!
Soon I will give a little webdevelopment boot camp on Python / HTML / Flask. This is my current rough structure of what I wanna do:
1. Intro to Python, pip and virtualenv
2. Intro to HTML
3. Intro to SQL / Postgres
4. Flask:
* The Request-Response Cycle
* Creating a Homepage
* Templating
* Routes.py
* Static Files
* Creating a database (Postgres)
* Connecting Flask to Postgres
* Writing the User Model
* Creating, rendering and validating a form
* Saving a user to the Database
* Sessions / Sign In / Sign Out
​
Does anyone of you have experience with teaching python to group? I have some concerns, since this is the first time I will teach a rather complex topic to people without any preknowledge:
They will need to install Python, pip, virtualenv, a texteditor such as Brackets and Postgres. Since they will use their personal laptops, I am a little concerned, that there might occur some issues already with getting python running. Do you have some recommendations how to handle the setup? I am especially concerned since they will use
/r/flask
https://redd.it/c96ydp
reddit
r/flask - Any tipps for teaching flask for beginners without any preknowledge of python?
9 votes and 6 comments so far on Reddit
How to structure my DRF endpoints
So I'm a newb here building my first webapp. The app is supposed to be a social media of the sort and I use React + Redux + Axios to communicate with my backend Django.
​
Now I need to build the search feature, with the option to filter. I want to type in the search bar, a small number of suggestions come up and if I hit the button, every result will appear and I can navigate through them. Of course, if I click on one of the items I'll have detailed information of that item. This is just a side project so no consequences, but I wanna follow the best practice.
​
What's the best way to structure my endpoints?
* One of the seniors in my place said I should give the frontend all the basic information when loading the site, including the item id/ url for later fetches, and let the frontend do the filtering + querying on that set. When the user requests item details, fetch again. Personally I'm not a fan, because even the basic info can be pretty huge and I have no idea how scalable this would be.
* Another way I'm thinking of would be to only
/r/django
https://redd.it/c9czki
So I'm a newb here building my first webapp. The app is supposed to be a social media of the sort and I use React + Redux + Axios to communicate with my backend Django.
​
Now I need to build the search feature, with the option to filter. I want to type in the search bar, a small number of suggestions come up and if I hit the button, every result will appear and I can navigate through them. Of course, if I click on one of the items I'll have detailed information of that item. This is just a side project so no consequences, but I wanna follow the best practice.
​
What's the best way to structure my endpoints?
* One of the seniors in my place said I should give the frontend all the basic information when loading the site, including the item id/ url for later fetches, and let the frontend do the filtering + querying on that set. When the user requests item details, fetch again. Personally I'm not a fan, because even the basic info can be pretty huge and I have no idea how scalable this would be.
* Another way I'm thinking of would be to only
/r/django
https://redd.it/c9czki
reddit
r/django - How to structure my DRF endpoints
6 votes and 6 comments so far on Reddit
Facebook Stock Prediction Using Python & Machine Learning
https://medium.com/p/bcfc676bc611
/r/Python
https://redd.it/c9d6bg
https://medium.com/p/bcfc676bc611
/r/Python
https://redd.it/c9d6bg
Medium
Facebook Stock Prediction Using Python & Machine Learning
Support Vector Regression
Django supporting Budapest Software House Needed
Hi there,
​
I need a few companies supporting Django in Budapest. No, remote is not an option.
BUDAPEST ONLY.
​
Thanx
/r/django
https://redd.it/c9f9kz
Hi there,
​
I need a few companies supporting Django in Budapest. No, remote is not an option.
BUDAPEST ONLY.
​
Thanx
/r/django
https://redd.it/c9f9kz
reddit
r/django - Django supporting Budapest Software House Needed
0 votes and 0 comments so far on Reddit
What are the free best platforms to learn data science libraries ( like pandas, numpy, matplotlib) ?????
/r/Python
https://redd.it/c9ej0u
/r/Python
https://redd.it/c9ej0u
reddit
r/Python - What are the free best platforms to learn data science libraries ( like pandas, numpy, matplotlib) ?????
12 votes and 13 comments so far on Reddit
queryset with multiple filters
I have a model with multiple projects and multiple categories, each category has updates, the site loops through the projects and displays them in a div block along with the latest update in each category.
I recently discovered "objects.distinct()" which nicely pulls the last items from each project category, which is great, but it pulls the data from the last project only and displays that for each project. Is there a way I can filter the query for project and then get the last item in each category?
​
I seem to be able to either filter for project and get a list of updates in the wrong order, or get the updates correct, but not for each project.
​
models.py
class Update(models.Model):
'''
Latest update must have a category from UpdateCategory
and be linked to a project, all updates are timestamped.
'''
project = models.ForeignKey(Project, on_delete=models.CASCADE)
category = models.ForeignKey(UpdateCategory, on_delete=models.PROTECT)
/r/djangolearning
https://redd.it/c94cw3
I have a model with multiple projects and multiple categories, each category has updates, the site loops through the projects and displays them in a div block along with the latest update in each category.
I recently discovered "objects.distinct()" which nicely pulls the last items from each project category, which is great, but it pulls the data from the last project only and displays that for each project. Is there a way I can filter the query for project and then get the last item in each category?
​
I seem to be able to either filter for project and get a list of updates in the wrong order, or get the updates correct, but not for each project.
​
models.py
class Update(models.Model):
'''
Latest update must have a category from UpdateCategory
and be linked to a project, all updates are timestamped.
'''
project = models.ForeignKey(Project, on_delete=models.CASCADE)
category = models.ForeignKey(UpdateCategory, on_delete=models.PROTECT)
/r/djangolearning
https://redd.it/c94cw3
reddit
r/djangolearning - queryset with multiple filters
4 votes and 1 comment so far on Reddit
Helping adding custom health check using django-health-check
https://github.com/KristianOellegaard/django-health-check
This seems like a really nice Django project. It was really easy to set it up to reporting on my Database. I'm using [Django Q](https://django-q.readthedocs.io/en/latest/) instead of the built in supported Celery, so I'd like to make my own health check.
The README gives an example of how to "Writing a custom health check". But being the Django noob that I am, I don't know where those code examples are supposed to go.
Where in the file structure does the `class MyHealthCheckBackend(BaseHealthCheckBackend):` go? Does it go in a view?
Where does the `class MyAppConfig(AppConfig):` go? Doing some research, I'm guessing I should have, or can add a file named 'my_app/apps.py'?
/r/djangolearning
https://redd.it/c9koea
https://github.com/KristianOellegaard/django-health-check
This seems like a really nice Django project. It was really easy to set it up to reporting on my Database. I'm using [Django Q](https://django-q.readthedocs.io/en/latest/) instead of the built in supported Celery, so I'd like to make my own health check.
The README gives an example of how to "Writing a custom health check". But being the Django noob that I am, I don't know where those code examples are supposed to go.
Where in the file structure does the `class MyHealthCheckBackend(BaseHealthCheckBackend):` go? Does it go in a view?
Where does the `class MyAppConfig(AppConfig):` go? Doing some research, I'm guessing I should have, or can add a file named 'my_app/apps.py'?
/r/djangolearning
https://redd.it/c9koea
GitHub
GitHub - revsys/django-health-check: a pluggable app that runs a full check on the deployment, using a number of plugins to check…
a pluggable app that runs a full check on the deployment, using a number of plugins to check e.g. database, queue server, celery processes, etc. - revsys/django-health-check
We Made a Rails Developer Write Django and a Django Developer Write Rails | Friday Afternoon Deploy: A Developer Podcast
https://fridayafternoondeploy.simplecast.com/episodes/we-made-a-rails-developer-write-django-and-a-django-developer-write-rails
/r/django
https://redd.it/c9gbk8
https://fridayafternoondeploy.simplecast.com/episodes/we-made-a-rails-developer-write-django-and-a-django-developer-write-rails
/r/django
https://redd.it/c9gbk8
Friday Afternoon Deploy: A Developer Podcast
Alex is a Rails developer who has come to build Django apps at Lofty. Alan is a Django developer who just inherited a Rails project for maintenance. Casey plays Dr. Phil and asks them to say nice things about the other's framework.
DeepNude is opensource now
https://github.com/deepinstruction/deepnude_official
/r/Python
https://redd.it/c9kneu
https://github.com/deepinstruction/deepnude_official
/r/Python
https://redd.it/c9kneu
[D] Is machine learning's killer app totalitarian surveillance and oppression?
listening to the planet money episode on the plight of the Uighur people:
[https://twitter.com/planetmoney/status/1147240518411309056](https://twitter.com/planetmoney/status/1147240518411309056)
​
In the Uighur region every home is bugged, every apartment building filled with cameras, every citizen's face recorded from every angle in every expression, all DNA recorded, every interaction recorded and NLP used to extract risk for being a dissident. These databases then restrict ability to do anything or go anywhere, and will put you in a concentration camp if your score is too bad.
​
Maybe google have done some cool things with ML, but my impression is that globally this is 90% being used for utter totalitarian evil.
/r/MachineLearning
https://redd.it/c9n1u2
listening to the planet money episode on the plight of the Uighur people:
[https://twitter.com/planetmoney/status/1147240518411309056](https://twitter.com/planetmoney/status/1147240518411309056)
​
In the Uighur region every home is bugged, every apartment building filled with cameras, every citizen's face recorded from every angle in every expression, all DNA recorded, every interaction recorded and NLP used to extract risk for being a dissident. These databases then restrict ability to do anything or go anywhere, and will put you in a concentration camp if your score is too bad.
​
Maybe google have done some cool things with ML, but my impression is that globally this is 90% being used for utter totalitarian evil.
/r/MachineLearning
https://redd.it/c9n1u2
Twitter
NPR's Planet Money
For more on what it’s like to be Uighur inside the Chinese surveillance state, take a look at @dtbyler’s account of “Ghost World.” https://t.co/PgYcaLWZrm. Our story: https://t.co/FU8uv0sU5e
Best method for uploading large files (>1GB) to server
i have created a flask application for uploading files to my media server but when i select files through mobile browser (firefox) its getting crashed
is it browser related problem or memory related
will sending files in chunks of data solve this problem ?
/r/flask
https://redd.it/c9fl33
i have created a flask application for uploading files to my media server but when i select files through mobile browser (firefox) its getting crashed
is it browser related problem or memory related
will sending files in chunks of data solve this problem ?
/r/flask
https://redd.it/c9fl33
reddit
r/flask - Best method for uploading large files (>1GB) to server
11 votes and 6 comments so far on Reddit
From Python script to Maintainable Package - podcast
https://testandcode.com/80
/r/Python
https://redd.it/c9oywh
https://testandcode.com/80
/r/Python
https://redd.it/c9oywh
Test & Code : Python Testing for Software Engineering
Test & Code : Python Testing for Software Engineering 80: From Python script to Maintainable Package
A story about packaging, and flit, tox, pytest, and coverage.
And an alternate solution to "using the src".
And an alternate solution to "using the src".
How to know the current Jupyter notebook theme and other customizations ?
I don't remember my customizations and every time I wish to change one setting I have to check my bash history. Is there a way to find the current settings (theme name, font,font size,etc)...
/r/JupyterNotebooks
https://redd.it/c9qnlj
I don't remember my customizations and every time I wish to change one setting I have to check my bash history. Is there a way to find the current settings (theme name, font,font size,etc)...
/r/JupyterNotebooks
https://redd.it/c9qnlj
reddit
r/JupyterNotebooks - How to know the current Jupyter notebook theme and other customizations ?
0 votes and 0 comments so far on Reddit
Best place to host my local django project
I've created a small django project on my local computer. It is basically a portfolio website with a landing page and a few links to my projects. I am new to django and web dev in general so forgive me for any dumb questions.
A while ago, I purchased a domain from Hostgator. After doing some research, it appears Hostgator is neither optimal or easy to use for Django. I'm now deciding between pythonanywhere, heroku and digitalocean.
Here are some conditions I hope can be met for my website:
1. I would like my site to be primarily based in Django, python and html/css. However, I wouldn't mind the flexibility for adding other tools/languages in the future. I plan to expand my site in an open-ended way but, at the end of the day, I want my site to look akin to this: [https://danielmiessler.com/](https://danielmiessler.com/).
2. I would like an email in my domain - the same domain as my website. Does either heroku or digitalocean provide easy-to-use and affordable email hosting services? I know hostgator does and pythonanywhere does not. If I go with pythonanywhere, can I just create an email domain using flaskmail, fastmail or protonmail? Would there be any
/r/django
https://redd.it/c9l6cy
I've created a small django project on my local computer. It is basically a portfolio website with a landing page and a few links to my projects. I am new to django and web dev in general so forgive me for any dumb questions.
A while ago, I purchased a domain from Hostgator. After doing some research, it appears Hostgator is neither optimal or easy to use for Django. I'm now deciding between pythonanywhere, heroku and digitalocean.
Here are some conditions I hope can be met for my website:
1. I would like my site to be primarily based in Django, python and html/css. However, I wouldn't mind the flexibility for adding other tools/languages in the future. I plan to expand my site in an open-ended way but, at the end of the day, I want my site to look akin to this: [https://danielmiessler.com/](https://danielmiessler.com/).
2. I would like an email in my domain - the same domain as my website. Does either heroku or digitalocean provide easy-to-use and affordable email hosting services? I know hostgator does and pythonanywhere does not. If I go with pythonanywhere, can I just create an email domain using flaskmail, fastmail or protonmail? Would there be any
/r/django
https://redd.it/c9l6cy
Danielmiessler
Daniel Miessler
SECURITY | AI | PURPOSE :: Building AI that upgrades humans. Cybersecurity and AI engineer, founder, writer, and creator based in San Francisco.
[R] mat2vec: Unsupervised word embeddings capture latent knowledge from materials science literature
From the abstract:
>Without any explicit insertion of chemical knowledge, these embeddings capture complex materials science concepts such as the underlying structure of the periodic table and structure– property relationships in materials. Furthermore, **we demonstrate that an unsupervised method can recommend materials for functional applications several years before their discovery.** This suggests that latent knowledge regarding future discoveries is to a large extent embedded in past publications. Our findings highlight the possibility of extracting knowledge and relationships from the massive body of scientific literature in a collective manner, and point towards a generalized approach to the mining of scientific literature.
​
Paper: [https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8](https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8)
Source Code: [https://github.com/materialsintelligence/mat2vec](https://github.com/materialsintelligence/mat2vec)
/r/MachineLearning
https://redd.it/c9nomk
From the abstract:
>Without any explicit insertion of chemical knowledge, these embeddings capture complex materials science concepts such as the underlying structure of the periodic table and structure– property relationships in materials. Furthermore, **we demonstrate that an unsupervised method can recommend materials for functional applications several years before their discovery.** This suggests that latent knowledge regarding future discoveries is to a large extent embedded in past publications. Our findings highlight the possibility of extracting knowledge and relationships from the massive body of scientific literature in a collective manner, and point towards a generalized approach to the mining of scientific literature.
​
Paper: [https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8](https://sci-hub.tw/https://www.nature.com/articles/s41586-019-1335-8)
Source Code: [https://github.com/materialsintelligence/mat2vec](https://github.com/materialsintelligence/mat2vec)
/r/MachineLearning
https://redd.it/c9nomk
GitHub
GitHub - materialsintelligence/mat2vec: Supplementary Materials for Tshitoyan et al. "Unsupervised word embeddings capture latent…
Supplementary Materials for Tshitoyan et al. "Unsupervised word embeddings capture latent knowledge from materials science literature", Nature (2019). - materialsintelligence/mat2vec
settings.AUTH_USER_MODEL returning null
I have a form uploading a file via CreateView and I'm trying to assign the id of the currently logged in user to a field in the model of the uploaded file.
No matter what method I try whether it be get\_user\_model() or anything else, it's just returning null.
producer = models.ForeignKey("users.CustomUser", on\_delete=models.CASCADE,)
​
I can select from a list of users, and the correct ID is assigned the value in the database, but this is obviously not the way it should work.
Here is my code with what's supposed to be the "best way"
​
I do have " AUTH\_USER\_MODEL = 'users.CustomUser' " in my [settings.py](https://settings.py)
​
[https://pastebin.com/XhM98fAy](https://pastebin.com/XhM98fAy)
​
​
Let me know what else you need. I just don't understand why it's so hard to get the value of the currently logged in user.
/r/django
https://redd.it/c9p66g
I have a form uploading a file via CreateView and I'm trying to assign the id of the currently logged in user to a field in the model of the uploaded file.
No matter what method I try whether it be get\_user\_model() or anything else, it's just returning null.
producer = models.ForeignKey("users.CustomUser", on\_delete=models.CASCADE,)
​
I can select from a list of users, and the correct ID is assigned the value in the database, but this is obviously not the way it should work.
Here is my code with what's supposed to be the "best way"
​
I do have " AUTH\_USER\_MODEL = 'users.CustomUser' " in my [settings.py](https://settings.py)
​
[https://pastebin.com/XhM98fAy](https://pastebin.com/XhM98fAy)
​
​
Let me know what else you need. I just don't understand why it's so hard to get the value of the currently logged in user.
/r/django
https://redd.it/c9p66g
[D] How do you think about use face embeddings in conjunction with Elasticsearch for face matching / face similarity application that same as Microsoft's celebslikeme.me ?
Now, my team is developing a application quite similarity as https://www.celebslike.me of Microsoft Corp before (2016).
We seperate the asual canonical pipeline of face recognition system into 3 phrase:
- Phase 1: Face Detection + Face Aligment
- Phase 2: Face Embedding
- Phase 3: Face matching / Face recognion or something like face similarity.
At (3) we use the technical that is the embedded vectors got from a given model that ours is from Facenet in this case to conjunct with Elasticsearch for similarity search.
We are still implementing above solution for now but personally I want to research some nice solutions (if any) for my knowledge also help to improve our product better.
How do you think about another solution(s) for this phase (3) ?
Any ideas are welcome !
/r/MachineLearning
https://redd.it/c9pci1
Now, my team is developing a application quite similarity as https://www.celebslike.me of Microsoft Corp before (2016).
We seperate the asual canonical pipeline of face recognition system into 3 phrase:
- Phase 1: Face Detection + Face Aligment
- Phase 2: Face Embedding
- Phase 3: Face matching / Face recognion or something like face similarity.
At (3) we use the technical that is the embedded vectors got from a given model that ours is from Facenet in this case to conjunct with Elasticsearch for similarity search.
We are still implementing above solution for now but personally I want to research some nice solutions (if any) for my knowledge also help to improve our product better.
How do you think about another solution(s) for this phase (3) ?
Any ideas are welcome !
/r/MachineLearning
https://redd.it/c9pci1
I present my first (bigger) program/app: A PyQt based app with a sqlite DB for a Raspberry Pi to create and control a Cocktail machine.
Hello everyone,
I proudly present my first 'real' app that I've created over the past months: A custom Cocktailmaker control interface for a self-designed Cocktail machine. It was quite a lot to learn (and failing at the beginning), since my background is less programming and more mechanical engineering. But it was quite fun to figure everything out and grow with it. Here is the link:
[https://github.com/AndreWohnsland/Cocktailmaker\_AW](https://github.com/AndreWohnsland/Cocktailmaker_AW)
And some pictures (also in the Github readme):
[Machine and preparing a Cocktail](https://imgur.com/a/Z4tfISx), [pictures of the UI](https://imgur.com/a/fbZ0WuS)
​
Now i am looking forward to learn more and more Python. Currently I am working a lot with Pandas and Matplotlib at my job as a scientific researcher in the renewable energies sector. For the long therm, I want to get a job in Programming (preferably Python). Can anyone recommend what are good next steps to learn/or improve? Currently I am reading and doing a lot of intermediate general Python Books/exercises to improve my overall knowledge of the language and Programming but I don't know if this is the best next step. Any advice would be highly appreciated.
Have a nice day :)
/r/Python
https://redd.it/c9shzs
Hello everyone,
I proudly present my first 'real' app that I've created over the past months: A custom Cocktailmaker control interface for a self-designed Cocktail machine. It was quite a lot to learn (and failing at the beginning), since my background is less programming and more mechanical engineering. But it was quite fun to figure everything out and grow with it. Here is the link:
[https://github.com/AndreWohnsland/Cocktailmaker\_AW](https://github.com/AndreWohnsland/Cocktailmaker_AW)
And some pictures (also in the Github readme):
[Machine and preparing a Cocktail](https://imgur.com/a/Z4tfISx), [pictures of the UI](https://imgur.com/a/fbZ0WuS)
​
Now i am looking forward to learn more and more Python. Currently I am working a lot with Pandas and Matplotlib at my job as a scientific researcher in the renewable energies sector. For the long therm, I want to get a job in Programming (preferably Python). Can anyone recommend what are good next steps to learn/or improve? Currently I am reading and doing a lot of intermediate general Python Books/exercises to improve my overall knowledge of the language and Programming but I don't know if this is the best next step. Any advice would be highly appreciated.
Have a nice day :)
/r/Python
https://redd.it/c9shzs
Python Flask REST API MongoDB CRUD Example - Roy Tutorials
https://www.roytuts.com/python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/c9rr4y
https://www.roytuts.com/python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/c9rr4y
Roytuts
Flask REST API MongoDB CRUD Example - Roy Tutorials
Flast REST API Mongo CRUD In this post I will implement Python flask REST API MongoDB CRUD example, where CRUD means Create, Read, Update, and Delete
ShouldnI store TZ information in a session or the User object?
I am working on a project that will have users in several different global time zones and time representation is important. I have defined my own user model by extending AbstractBaseUser. I’m using time zone aware datetime objects and would like to present these times to the users in their own selected time zone.
Reading through Django’s documentation, they provide an example of using middleware to activate the time zone based on data stored in the user’s session.
My question is, does it make a difference whether this data is stored in the session or simply read from the user object? The user object is already available in the request that the middleware has access to right? Or is this one of those situations where the user object will be queried multiple times as a result?
/r/django
https://redd.it/c9ntd7
I am working on a project that will have users in several different global time zones and time representation is important. I have defined my own user model by extending AbstractBaseUser. I’m using time zone aware datetime objects and would like to present these times to the users in their own selected time zone.
Reading through Django’s documentation, they provide an example of using middleware to activate the time zone based on data stored in the user’s session.
My question is, does it make a difference whether this data is stored in the session or simply read from the user object? The user object is already available in the request that the middleware has access to right? Or is this one of those situations where the user object will be queried multiple times as a result?
/r/django
https://redd.it/c9ntd7
reddit
r/django - ShouldnI store TZ information in a session or the User object?
2 votes and 2 comments so far on Reddit
This media is not supported in your browser
VIEW IN TELEGRAM
Simulating a source of light and a lens using Maxwell's Equations in Finite-difference time-domain method
/r/Python
https://redd.it/c9wetp
/r/Python
https://redd.it/c9wetp