Django-Channels: DLL load failed: %1 is not a valid Win32 application
Hi All!
After adding channels app on my project, I started having this error when running [manage.py](https://manage.py) runserver:
​
\---------------------------------------------------------------------------------
File "D:\\Python37\\lib\\site-packages\\channels\\[apps.py](https://apps.py)", line 6, in <module>
import daphne.server
File "D:\\Python37\\lib\\site-packages\\daphne\\[server.py](https://server.py)", line 27, in <module>
from twisted.internet.endpoints import serverFromString
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\[endpoints.py](https://endpoints.py)", line 41, in <module>
from twisted.internet.stdio import StandardIO, PipeAddress
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\[stdio.py](https://stdio.py)", line 30, in <module>
from twisted.internet import \_win32stdio
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\\_win32stdio.py", line 9, in <module>
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application
\-----------------------------------------------------
​
It lookslike this error is raised by twisted, which is apparently changing the work directory after importing daphne server.
I had a previous installation of Python on this location, which is not active anymore.
​
Does any of you know how to correct this?
/r/django
https://redd.it/aogucs
Hi All!
After adding channels app on my project, I started having this error when running [manage.py](https://manage.py) runserver:
​
\---------------------------------------------------------------------------------
File "D:\\Python37\\lib\\site-packages\\channels\\[apps.py](https://apps.py)", line 6, in <module>
import daphne.server
File "D:\\Python37\\lib\\site-packages\\daphne\\[server.py](https://server.py)", line 27, in <module>
from twisted.internet.endpoints import serverFromString
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\[endpoints.py](https://endpoints.py)", line 41, in <module>
from twisted.internet.stdio import StandardIO, PipeAddress
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\[stdio.py](https://stdio.py)", line 30, in <module>
from twisted.internet import \_win32stdio
File "C:\\Users\\...\\AppData\\Roaming\\Python\\Python37\\site-packages\\twisted\\internet\\\_win32stdio.py", line 9, in <module>
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application
\-----------------------------------------------------
​
It lookslike this error is raised by twisted, which is apparently changing the work directory after importing daphne server.
I had a previous installation of Python on this location, which is not active anymore.
​
Does any of you know how to correct this?
/r/django
https://redd.it/aogucs
Jupyter complains of no anaconda3 when anaconda3 was never on my system
I'm trying to set up Jupyter, and for the most part it works fine. However, I'm getting this error:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/tornado/web.py", line 1592, in _execute
result = yield result
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
/r/IPython
https://redd.it/aogr33
I'm trying to set up Jupyter, and for the most part it works fine. However, I'm getting this error:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/tornado/web.py", line 1592, in _execute
result = yield result
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
/r/IPython
https://redd.it/aogr33
reddit
r/IPython - Jupyter complains of no anaconda3 when anaconda3 was never on my system
2 votes and 0 comments so far on Reddit
Only allow a route to be accessed from within the flask app
I followed a couple of tutorials and now have a form and a /create-user route which accepts the data and creates a user in the database.
What is the correct way to protect this route so that it only accepts a call from within the flask app?
otherwise, can't people just post directly to it and create users using postman or insomnia.?
/r/flask
https://redd.it/aohws1
I followed a couple of tutorials and now have a form and a /create-user route which accepts the data and creates a user in the database.
What is the correct way to protect this route so that it only accepts a call from within the flask app?
otherwise, can't people just post directly to it and create users using postman or insomnia.?
/r/flask
https://redd.it/aohws1
reddit
r/flask - Only allow a route to be accessed from within the flask app
1 vote and 0 comments so far on Reddit
Web GUI for Apache logs parser with Flask for beginners
Hi, everyone!
​
I made a video on how to make a Web GUI with Flask framework for a Python script using the Apache log parser example.
Detailed explanation for beginners.
​
Covered topics:
\- Tools for regular expressions validation
\- What is 'if \_\_name\_\_ == '\_\_main\_\_' and \_\_name\_\_ attribute
\- Creating a Flask application
\- Flask template inheritance
\- Sending data from a Flask app to a HTML template and reverse - from HTML form to the Flask app.
\- Bootsrap 4 layout (a bit)
\- and more
​
Youtube video: [https://www.youtube.com/watch?v=4v3NEGfeff4](https://www.youtube.com/watch?v=4v3NEGfeff4)
​
Thanks for watching.
/r/Python
https://redd.it/aofwx5
Hi, everyone!
​
I made a video on how to make a Web GUI with Flask framework for a Python script using the Apache log parser example.
Detailed explanation for beginners.
​
Covered topics:
\- Tools for regular expressions validation
\- What is 'if \_\_name\_\_ == '\_\_main\_\_' and \_\_name\_\_ attribute
\- Creating a Flask application
\- Flask template inheritance
\- Sending data from a Flask app to a HTML template and reverse - from HTML form to the Flask app.
\- Bootsrap 4 layout (a bit)
\- and more
​
Youtube video: [https://www.youtube.com/watch?v=4v3NEGfeff4](https://www.youtube.com/watch?v=4v3NEGfeff4)
​
Thanks for watching.
/r/Python
https://redd.it/aofwx5
YouTube
Python Flask Web UI Tutorial: Simple web GUI/UI for Python script with Flask | Flask project
This Python Flask Web UI Tutorial is about how to create a simple web user interface (web ui) for a Python script using Flask framework. In this Python Flask Web UI tutorial we'll create an Apache logs parser with Python and then create a Web UI for it.
A…
A…
DjangoCon US 2018 - Auto-generating an API using PostgreSQL by Mjumbe Poe
https://www.youtube.com/watch?v=fNXpQ14LKfk
/r/django
https://redd.it/aoh983
https://www.youtube.com/watch?v=fNXpQ14LKfk
/r/django
https://redd.it/aoh983
YouTube
DjangoCon US 2018 - Auto-generating an API using PostgreSQL... by Mjumbe Poe
DjangoCon US 2018 - Auto-generating an API using PostgreSQL, Django, and Django REST Framework by Mjumbe Poe
We have an API whose database schema changes constantly with no need for changes to our code that exposes the data. This is an extremely powerful…
We have an API whose database schema changes constantly with no need for changes to our code that exposes the data. This is an extremely powerful…
Best practice for home page and authentication?
I'd like to create an app that displays certain information on the home page if a user is logged in. Take GitHub for example. If you are logged in, [GitHub.com](https://GitHub.com) is your profile. But if you're not logged in, it's a sign up form.
I guess I'm asking what the best practices are for displaying different information at the same route depending on whether a user is logged in? Would I use a conditional to return different templates depending on authentication status? Or is there a better/more secure way?
Thanks for any help you all can provide.
/r/flask
https://redd.it/aojg3c
I'd like to create an app that displays certain information on the home page if a user is logged in. Take GitHub for example. If you are logged in, [GitHub.com](https://GitHub.com) is your profile. But if you're not logged in, it's a sign up form.
I guess I'm asking what the best practices are for displaying different information at the same route depending on whether a user is logged in? Would I use a conditional to return different templates depending on authentication status? Or is there a better/more secure way?
Thanks for any help you all can provide.
/r/flask
https://redd.it/aojg3c
GitHub
GitHub · Change is constant. GitHub keeps you ahead.
Join the world's most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.
New to python, wanted to show my first 2 proper projects
I am not sure if this is the right place to post this, but I have been practicing python and wanted to show off my recent projects which I worked hard on getting working (And thanks to someone at r/learnpython for helping me with the first)
​
The first program is a timer, using tkinter for a GUI. I really prefer having a GUI for all my programs, it makes it very nice to use.
[https://steamuserimages-a.akamaihd.net/ugc/939467109946388671/5F61D994F94187E3F6A4DD3C6FF8130CEF7E91E6/](https://steamuserimages-a.akamaihd.net/ugc/939467109946388671/5F61D994F94187E3F6A4DD3C6FF8130CEF7E91E6/)
My second program uses TURTLE Graphics and Tkinter to make a worse-paint program.
[https://steamuserimages-a.akamaihd.net/ugc/939467109946391937/890D58664BB2D587ACDB39B649129A95489DC540/](https://steamuserimages-a.akamaihd.net/ugc/939467109946391937/890D58664BB2D587ACDB39B649129A95489DC540/)
The arrows allow you to turn and move the the turtle, you can change the values it moves by in the boxes and there is a toggle to lift and drop the pen.
​
Thanks for reading!
/r/Python
https://redd.it/aoircd
I am not sure if this is the right place to post this, but I have been practicing python and wanted to show off my recent projects which I worked hard on getting working (And thanks to someone at r/learnpython for helping me with the first)
​
The first program is a timer, using tkinter for a GUI. I really prefer having a GUI for all my programs, it makes it very nice to use.
[https://steamuserimages-a.akamaihd.net/ugc/939467109946388671/5F61D994F94187E3F6A4DD3C6FF8130CEF7E91E6/](https://steamuserimages-a.akamaihd.net/ugc/939467109946388671/5F61D994F94187E3F6A4DD3C6FF8130CEF7E91E6/)
My second program uses TURTLE Graphics and Tkinter to make a worse-paint program.
[https://steamuserimages-a.akamaihd.net/ugc/939467109946391937/890D58664BB2D587ACDB39B649129A95489DC540/](https://steamuserimages-a.akamaihd.net/ugc/939467109946391937/890D58664BB2D587ACDB39B649129A95489DC540/)
The arrows allow you to turn and move the the turtle, you can change the values it moves by in the boxes and there is a toggle to lift and drop the pen.
​
Thanks for reading!
/r/Python
https://redd.it/aoircd
Flask website example
Hello all,
Has anyone found a good resource for flask based websites? I mean pages created with flask that one can download and then modify for learning purposes. I am looking to learning a bit of flask to build a small page to use as a control for a homemade thermostat.
I find that following a tutorial from the beginning takes a really long time and I think it would be helpful to have a working example that one can modify while reading the documentation.
Cheers
/r/Python
https://redd.it/aogxbe
Hello all,
Has anyone found a good resource for flask based websites? I mean pages created with flask that one can download and then modify for learning purposes. I am looking to learning a bit of flask to build a small page to use as a control for a homemade thermostat.
I find that following a tutorial from the beginning takes a really long time and I think it would be helpful to have a working example that one can modify while reading the documentation.
Cheers
/r/Python
https://redd.it/aogxbe
reddit
r/Python - Flask website example
72 votes and 22 comments so far on Reddit
PyCon 2020-2021 location announced - Pittsburgh!
https://pycon.blogspot.com/2019/02/pycon-2020-2021-location.html?
/r/Python
https://redd.it/aom1dp
https://pycon.blogspot.com/2019/02/pycon-2020-2021-location.html?
/r/Python
https://redd.it/aom1dp
Blogspot
PyCon 2020-2021 Location
Now that registration and planning are well underway for PyCon 2019 in Cleveland, the PSF is pleased to announce that the home for PyCon 202...
len("😂") crashes IDLE
Kinda cool, I guess.
(Latest release (3.7.2) for Windows.)
/r/Python
https://redd.it/aolz00
Kinda cool, I guess.
(Latest release (3.7.2) for Windows.)
/r/Python
https://redd.it/aolz00
reddit
r/Python - len("😂") crashes IDLE
12 votes and 2 comments so far on Reddit
[N] University of Toronto is offering a course on Quantum Machine Learning through edX!
The course has just started a few days ago: [https://www.edx.org/course/quantum-machine-learning](https://www.edx.org/course/quantum-machine-learning)
>By the end of this course, you will be able to:
· Distinguish between quantum computing paradigms relevant for machine learning
· Assess expectations for quantum devices on various time scales
· Identify opportunities in machine learning for using quantum resources
· Implement learning algorithms on quantum computers in Python
/r/MachineLearning
https://redd.it/aodpek
The course has just started a few days ago: [https://www.edx.org/course/quantum-machine-learning](https://www.edx.org/course/quantum-machine-learning)
>By the end of this course, you will be able to:
· Distinguish between quantum computing paradigms relevant for machine learning
· Assess expectations for quantum devices on various time scales
· Identify opportunities in machine learning for using quantum resources
· Implement learning algorithms on quantum computers in Python
/r/MachineLearning
https://redd.it/aodpek
Is BeeWare reliable at the moment ?
hello , I have several months to complete a school project and PyBee is exactly what I am looking for , considering python for building cross-platform apps for mobile phones only, has anyone succeeded in making an App using BeeWare ? Or is it better to learn C# and consider Xamarin ?
P.s: I have fairly good knowledge in C,C++ and several other basic langs.
Thank You, Have a nice day ahead.
/r/Python
https://redd.it/aok052
hello , I have several months to complete a school project and PyBee is exactly what I am looking for , considering python for building cross-platform apps for mobile phones only, has anyone succeeded in making an App using BeeWare ? Or is it better to learn C# and consider Xamarin ?
P.s: I have fairly good knowledge in C,C++ and several other basic langs.
Thank You, Have a nice day ahead.
/r/Python
https://redd.it/aok052
reddit
r/Python - Is BeeWare reliable at the moment ?
16 votes and 2 comments so far on Reddit
Best date time picker for meeting / event scheduled app
Hi all,
I’m need some inspirations for date time pickers to implement for web django app similar to doodle.
The logic I proposed is users can either create events with fixed date / time settings or more dynamic date/ time settings.
Further explanation:
Select availability?
a. Date
b. Set time
i. Start time
ii. End time
*Both optional, in most cases users will have a start and end time
I would be grateful for any recommendations that work well with bootstrap 4 and django.
/r/django
https://redd.it/aonb70
Hi all,
I’m need some inspirations for date time pickers to implement for web django app similar to doodle.
The logic I proposed is users can either create events with fixed date / time settings or more dynamic date/ time settings.
Further explanation:
Select availability?
a. Date
b. Set time
i. Start time
ii. End time
*Both optional, in most cases users will have a start and end time
I would be grateful for any recommendations that work well with bootstrap 4 and django.
/r/django
https://redd.it/aonb70
reddit
r/django - Best date time picker for meeting / event scheduled app
2 votes and 2 comments so far on Reddit
Run a tensorflow.js program using flask
Im new to both flask and tensorflow, so its probably not surprising that i have no idea what i am doing
What i want to do, however is this: run a tensorflow demo ([https://github.com/tensorflow/tfjs-examples/tree/master/webcam-transfer-learning](https://github.com/tensorflow/tfjs-examples/tree/master/webcam-transfer-learning)) with flask.
Problem: when i run it, the demo, which should use the webcam, says it cannot find a webcam.
(webcam is there, live demo works as expected, but the locally run demo cannot turn on or even find the webcam)
Is there even a known way to solve this? Or will i have to butcher the demo to accept the webcam frames sent from the server side (like this: [https://github.com/log0/video\_streaming\_with\_flask\_example](https://github.com/log0/video_streaming_with_flask_example))
​
/r/flask
https://redd.it/aor0u2
Im new to both flask and tensorflow, so its probably not surprising that i have no idea what i am doing
What i want to do, however is this: run a tensorflow demo ([https://github.com/tensorflow/tfjs-examples/tree/master/webcam-transfer-learning](https://github.com/tensorflow/tfjs-examples/tree/master/webcam-transfer-learning)) with flask.
Problem: when i run it, the demo, which should use the webcam, says it cannot find a webcam.
(webcam is there, live demo works as expected, but the locally run demo cannot turn on or even find the webcam)
Is there even a known way to solve this? Or will i have to butcher the demo to accept the webcam frames sent from the server side (like this: [https://github.com/log0/video\_streaming\_with\_flask\_example](https://github.com/log0/video_streaming_with_flask_example))
​
/r/flask
https://redd.it/aor0u2
GitHub
tfjs-examples/webcam-transfer-learning at master · tensorflow/tfjs-examples
Examples built with TensorFlow.js. Contribute to tensorflow/tfjs-examples development by creating an account on GitHub.
Best book or resources for mastering django 2.2 ?
I learned basics of Django and i want to master django in-depth step by step.
/r/django
https://redd.it/aorv3w
I learned basics of Django and i want to master django in-depth step by step.
/r/django
https://redd.it/aorv3w
reddit
r/django - Best book or resources for mastering django 2.2 ?
1 vote and 1 comment so far on Reddit
Is there a way to use the django_extensions shell_plus --notebook as the shell for debugging a view using ipdb.set_trace()?
It's an esoteric use case, but basically, stepping through the code in ipdb is great for debugging, but it would be even better to step through the view code in an jupyter notebook.
/r/django
https://redd.it/aotoll
It's an esoteric use case, but basically, stepping through the code in ipdb is great for debugging, but it would be even better to step through the view code in an jupyter notebook.
/r/django
https://redd.it/aotoll
reddit
r/django - Is there a way to use the django_extensions shell_plus --notebook as the shell for debugging a view using ipdb.set_trace()?
5 votes and 3 comments so far on Reddit
Looking for Machine Learning Course recommendation.
Hi guys,
​
Have a pretty good experience in Python and want to build a new ML skill.
​
What would you recommend for me? Books, courses, videos etc
​
Thank you.
​
PS: Since a lot of people give a very good recommendation here, I would like to summarize something in the topic:
* [scikit-learn documentation](https://scikit-learn.org/stable/index.html) has a lot of good examples.
* [Coursera Machine Learning by Andrew NG (Stanford)](https://www.coursera.org/learn/machine-learning) \- it is more theoretical course, ±3month long. Without using Python, but Octave/Matlab . Python assignments for the machine learning class can be found in [this github repo](https://github.com/dibgerge/ml-coursera-python-assignments).
* [Coursera Applied Machine Learning in Python (University of Michigan)](https://www.coursera.org/learn/python-machine-learning) \- smaller course in terms of time, 4 weeks, but with using Python
* [Sentdex series of Machine learning](https://pythonprogramming.net/machine-learning-tutorial-python-introduction/) \- he is a very active YouTube Python Blogger, so with 72 videos in the course he covered quite a lot. They also have they own Discord chat for questions.
* [course.fast.ai](https://course.fast.ai) \- Practical Deep Learning for Coders, v3, this is a third version of this course, which means this guy has some experience in teaching. The course itself is using [fast.ai](https://fast.ai) (his own lib) and PyTorch
* [Stanford Course on YouTube](https://www.youtube.com/playlist?list=PL3FW7Lu3i5JvHM8ljYj-zLfQRF3EO8sYv)
* [MIT 6.S094: Deep Learning for Self-Driving Cars](https://selfdrivingcars.mit.edu/)
* [Google's Machine Learning Crash Course with
/r/Python
https://redd.it/aoriqo
Hi guys,
​
Have a pretty good experience in Python and want to build a new ML skill.
​
What would you recommend for me? Books, courses, videos etc
​
Thank you.
​
PS: Since a lot of people give a very good recommendation here, I would like to summarize something in the topic:
* [scikit-learn documentation](https://scikit-learn.org/stable/index.html) has a lot of good examples.
* [Coursera Machine Learning by Andrew NG (Stanford)](https://www.coursera.org/learn/machine-learning) \- it is more theoretical course, ±3month long. Without using Python, but Octave/Matlab . Python assignments for the machine learning class can be found in [this github repo](https://github.com/dibgerge/ml-coursera-python-assignments).
* [Coursera Applied Machine Learning in Python (University of Michigan)](https://www.coursera.org/learn/python-machine-learning) \- smaller course in terms of time, 4 weeks, but with using Python
* [Sentdex series of Machine learning](https://pythonprogramming.net/machine-learning-tutorial-python-introduction/) \- he is a very active YouTube Python Blogger, so with 72 videos in the course he covered quite a lot. They also have they own Discord chat for questions.
* [course.fast.ai](https://course.fast.ai) \- Practical Deep Learning for Coders, v3, this is a third version of this course, which means this guy has some experience in teaching. The course itself is using [fast.ai](https://fast.ai) (his own lib) and PyTorch
* [Stanford Course on YouTube](https://www.youtube.com/playlist?list=PL3FW7Lu3i5JvHM8ljYj-zLfQRF3EO8sYv)
* [MIT 6.S094: Deep Learning for Self-Driving Cars](https://selfdrivingcars.mit.edu/)
* [Google's Machine Learning Crash Course with
/r/Python
https://redd.it/aoriqo
Coursera
Supervised Machine Learning: Regression and Classification
In the first course of the Machine Learning ... Enroll for free.
Anyone able to help resolve this Jupyter-lab error?
https://bbs.archlinux.org/viewtopic.php?id=244078
/r/IPython
https://redd.it/aosxgk
https://bbs.archlinux.org/viewtopic.php?id=244078
/r/IPython
https://redd.it/aosxgk
Example app that uses testing framework
I’ve developed using Django for awhile now, but admittedly have never built an app that used unit tests or the built in testing framework. I’d like to change this in 2019, but tend to learn best by examining working code rather than from books/videos.
Does anyone have a good, preferably small-ish/simple project using Django that incorporates unit tests they could recommend as an example that is open source?
/r/django
https://redd.it/aoyhzh
I’ve developed using Django for awhile now, but admittedly have never built an app that used unit tests or the built in testing framework. I’d like to change this in 2019, but tend to learn best by examining working code rather than from books/videos.
Does anyone have a good, preferably small-ish/simple project using Django that incorporates unit tests they could recommend as an example that is open source?
/r/django
https://redd.it/aoyhzh
reddit
r/django - Example app that uses testing framework
8 votes and 7 comments so far on Reddit
How to deploy Gunicorn behind Nginx in a shared instance
https://medium.com/@RafaelBattesti/how-to-deploy-gunicorn-behind-nginx-in-a-shared-instance-f336d2ba4519
/r/Python
https://redd.it/aox99q
https://medium.com/@RafaelBattesti/how-to-deploy-gunicorn-behind-nginx-in-a-shared-instance-f336d2ba4519
/r/Python
https://redd.it/aox99q
ITNEXT
How to deploy Gunicorn behind Nginx in a shared instance
Use a cloud instance to deploy 2 environments for Flask API.