Deploying a flask app
Im currently building a small flask app.
Ive got it running locally while im building it. just running it on a development server using flask run.
I plan to deploy it to something like pythonanywhere.
Ive seen people online say to use something like Gunicorn since you should use development servers for production.
Im trying to wrap my head around it, but do i need to use a production ready server? wont that be handled by pythonanywhere once i launch it?
/r/flask
https://redd.it/1cdiwys
Im currently building a small flask app.
Ive got it running locally while im building it. just running it on a development server using flask run.
I plan to deploy it to something like pythonanywhere.
Ive seen people online say to use something like Gunicorn since you should use development servers for production.
Im trying to wrap my head around it, but do i need to use a production ready server? wont that be handled by pythonanywhere once i launch it?
/r/flask
https://redd.it/1cdiwys
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
I made a Python app that turns your Figma design into code
Link: https://github.com/Axorax/tkforge
Hey, my name is Axorax. I have been programming for a few years now. I started making a lot more projects in Python recently and this is one of them. I decided to call the project TkForge.
What My Project Does TkForge allows you to turn your Figma design into code. So, you can make the UI for an app in Figma and add input fields, buttons and much more and name them properly then you can run TkForge to convert your Figma design into code. The names need to be the element that you want. For example; if you want a button element then you can name it "button" or "button Hello World!". The "Hello World!" portion will just get ignored. All of the text after the first space is ignored. However, for some elements, they matter. Like, if you want a textbox element with the placeholder text of "Hello" then you need to name it "textbox Hello".
Target Audience It is meant for anyone who wants to create a GUI in Python easily. Dealing with Tkinter can be a pain a lot of times and it also
/r/Python
https://redd.it/1cdo8uj
Link: https://github.com/Axorax/tkforge
Hey, my name is Axorax. I have been programming for a few years now. I started making a lot more projects in Python recently and this is one of them. I decided to call the project TkForge.
What My Project Does TkForge allows you to turn your Figma design into code. So, you can make the UI for an app in Figma and add input fields, buttons and much more and name them properly then you can run TkForge to convert your Figma design into code. The names need to be the element that you want. For example; if you want a button element then you can name it "button" or "button Hello World!". The "Hello World!" portion will just get ignored. All of the text after the first space is ignored. However, for some elements, they matter. Like, if you want a textbox element with the placeholder text of "Hello" then you need to name it "textbox Hello".
Target Audience It is meant for anyone who wants to create a GUI in Python easily. Dealing with Tkinter can be a pain a lot of times and it also
/r/Python
https://redd.it/1cdo8uj
GitHub
GitHub - Axorax/tkforge: Drag & drop in Figma to create a Python GUI with ease
Drag & drop in Figma to create a Python GUI with ease - Axorax/tkforge
terminal not working
Cannot open Local
Failed to start [powershell.exe, -NoExit, -ExecutionPolicy, Bypass, -File, C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\plugins\\terminal\\shell-integrations\\powershell\\powershell-integration.ps1\] in C:\\Users\\RT\\PycharmProjects\\pythonProject1, [columns=151, rows=8\], envs={PROCESSOR_IDENTIFIER=>AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD, CommonProgramFiles=>C:\\Program Files\\Common Files, APPDATA=>C:\\Users\\RT\\AppData\\Roaming, =::=>::\\, LOCALAPPDATA=>C:\\Users\\RT\\AppData\\Local, ProgramData=>C:\\ProgramData, COMPUTERNAME=>BYSASNET, SystemDrive=>C:, USERDOMAIN=>BYSASNET, TMP=>C:\\Users\\RT\\AppData\\Local\\Temp, CommonProgramFiles(x86)=>C:\\Program Files (x86)\\Common Files, SystemRoot=>C:\\Windows, HOMEPATH=>\\Users\\RT, TEMP=>C:\\Users\\RT\\AppData\\Local\\Temp, JEDITERM_SOURCE=>C:/Users/RT/PycharmProjects/pythonProject1/.venv/Scripts/activate.ps1, TERMINAL_EMULATOR=>JetBrains-JediTerm, LOGONSERVER=>\\\\BYSASNET, SESSIONNAME=>Console, PUBLIC=>C:\\Users\\Public, HOMEDRIVE=>C:, ProgramFiles=>C:\\Program Files, windir=>C:\\Windows, USERDOMAIN_ROAMINGPROFILE=>BYSASNET, PyCharm Community Edition=>C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\bin;, Path=>C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\dotnet\\;C:\\Program Files\\PowerShell\\7\\;C:\\Users\\RT\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\;C:\\Users\\RT\\AppData\\Local\\Programs\\Python\\Python312\\;C:\\Users\\RT\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\bin;;C:\\Users\\RT\\.dotnet\\tools;C:\\Users\\RT\\AppData\\Local\\Programs\\Microsoft VS Code\\bin, PROCESSOR_LEVEL=>25, POWERSHELL_DISTRIBUTION_CHANNEL=>MSI:Windows 10 Pro, ComSpec=>C:\\Windows\\system32\\cmd.exe, NUMBER_OF_PROCESSORS=>6, IDEA_INITIAL_DIRECTORY=>C:\\Users\\RT\\Desktop, PROCESSOR_ARCHITECTURE=>AMD64, PROCESSOR_REVISION=>5000, OS=>Windows_NT, JETBRAINS_INTELLIJ_COMMAND_END_MARKER=>ukbCYHEYKqV5YqsolTRdkxYLo4Ec1DMXFE78Tz7xGYcq1VltE50mw15ptRTwwOEM, USERPROFILE=>C:\\Users\\RT, ALLUSERSPROFILE=>C:\\ProgramData, USERNAME=>RT, ProgramW6432=>C:\\Program Files, CommonProgramW6432=>C:\\Program Files\\Common Files, TERM_SESSION_ID=>668cf38d-70fb-463c-a1ed-b592339c0d12, ProgramFiles(x86)=>C:\\Program Files (x86), PSModulePath=>C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules, PATHEXT=>.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC}
See IDE log (Help | Show Log in Explorer) for the details.
i'm getting this problem , i tried reinstalling PowerShell and pycharm itself , i also tried changing the shell path to cmd.exe , nothing worked
/r/Python
https://redd.it/1cds24v
Cannot open Local
Failed to start [powershell.exe, -NoExit, -ExecutionPolicy, Bypass, -File, C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\plugins\\terminal\\shell-integrations\\powershell\\powershell-integration.ps1\] in C:\\Users\\RT\\PycharmProjects\\pythonProject1, [columns=151, rows=8\], envs={PROCESSOR_IDENTIFIER=>AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD, CommonProgramFiles=>C:\\Program Files\\Common Files, APPDATA=>C:\\Users\\RT\\AppData\\Roaming, =::=>::\\, LOCALAPPDATA=>C:\\Users\\RT\\AppData\\Local, ProgramData=>C:\\ProgramData, COMPUTERNAME=>BYSASNET, SystemDrive=>C:, USERDOMAIN=>BYSASNET, TMP=>C:\\Users\\RT\\AppData\\Local\\Temp, CommonProgramFiles(x86)=>C:\\Program Files (x86)\\Common Files, SystemRoot=>C:\\Windows, HOMEPATH=>\\Users\\RT, TEMP=>C:\\Users\\RT\\AppData\\Local\\Temp, JEDITERM_SOURCE=>C:/Users/RT/PycharmProjects/pythonProject1/.venv/Scripts/activate.ps1, TERMINAL_EMULATOR=>JetBrains-JediTerm, LOGONSERVER=>\\\\BYSASNET, SESSIONNAME=>Console, PUBLIC=>C:\\Users\\Public, HOMEDRIVE=>C:, ProgramFiles=>C:\\Program Files, windir=>C:\\Windows, USERDOMAIN_ROAMINGPROFILE=>BYSASNET, PyCharm Community Edition=>C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\bin;, Path=>C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\dotnet\\;C:\\Program Files\\PowerShell\\7\\;C:\\Users\\RT\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\;C:\\Users\\RT\\AppData\\Local\\Programs\\Python\\Python312\\;C:\\Users\\RT\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2024.1\\bin;;C:\\Users\\RT\\.dotnet\\tools;C:\\Users\\RT\\AppData\\Local\\Programs\\Microsoft VS Code\\bin, PROCESSOR_LEVEL=>25, POWERSHELL_DISTRIBUTION_CHANNEL=>MSI:Windows 10 Pro, ComSpec=>C:\\Windows\\system32\\cmd.exe, NUMBER_OF_PROCESSORS=>6, IDEA_INITIAL_DIRECTORY=>C:\\Users\\RT\\Desktop, PROCESSOR_ARCHITECTURE=>AMD64, PROCESSOR_REVISION=>5000, OS=>Windows_NT, JETBRAINS_INTELLIJ_COMMAND_END_MARKER=>ukbCYHEYKqV5YqsolTRdkxYLo4Ec1DMXFE78Tz7xGYcq1VltE50mw15ptRTwwOEM, USERPROFILE=>C:\\Users\\RT, ALLUSERSPROFILE=>C:\\ProgramData, USERNAME=>RT, ProgramW6432=>C:\\Program Files, CommonProgramW6432=>C:\\Program Files\\Common Files, TERM_SESSION_ID=>668cf38d-70fb-463c-a1ed-b592339c0d12, ProgramFiles(x86)=>C:\\Program Files (x86), PSModulePath=>C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules, PATHEXT=>.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC}
See IDE log (Help | Show Log in Explorer) for the details.
i'm getting this problem , i tried reinstalling PowerShell and pycharm itself , i also tried changing the shell path to cmd.exe , nothing worked
/r/Python
https://redd.it/1cds24v
Reddit
From the Python community on Reddit: terminal not working
Posted by cg_bro3d - No votes and 2 comments
What is the standard around using number vs UUID for primary field?
I understand using primary key as number sequence might not be best thing to do as it makes it easy to guess url but using uuid can be slow to index and search. I used slug filed before with name and last 8 characters or so from uuid. The easiest to implement common fields like this and created by, created at fields is using inheritance but not all models have name .
Wondering how is everyone handling this? Also want is the best way to get current user here?
/r/django
https://redd.it/1cde0ug
I understand using primary key as number sequence might not be best thing to do as it makes it easy to guess url but using uuid can be slow to index and search. I used slug filed before with name and last 8 characters or so from uuid. The easiest to implement common fields like this and created by, created at fields is using inheritance but not all models have name .
Wondering how is everyone handling this? Also want is the best way to get current user here?
/r/django
https://redd.it/1cde0ug
Reddit
From the django community on Reddit
Explore this post and more from the django community
Weird NOT NULL constraint error
Hi all
I'm new to Django, but have been coding for a long time.
I have a simple model with very few fields in one table. There are no foreign keys. I am using SQLite as the DB as I'm learning all this out. I have Django auto-creating the ID field for my model.
From what I have discovered reading online, this should work:
However, that throws a not null constraint on the name field. What is confusing to me is, isn't this deleting the entire row? Why would a constraint issue appear here?
When I go directly to the DB from the python command line, I have no issues:
For completeness, here is the relevant portion of models.py
Any ideas what I'm messing up?
/r/django
https://redd.it/1cdwz59
Hi all
I'm new to Django, but have been coding for a long time.
I have a simple model with very few fields in one table. There are no foreign keys. I am using SQLite as the DB as I'm learning all this out. I have Django auto-creating the ID field for my model.
From what I have discovered reading online, this should work:
def delete(request, goal_id): g = Goals.objects.get(pk=goal_id) g.delete()However, that throws a not null constraint on the name field. What is confusing to me is, isn't this deleting the entire row? Why would a constraint issue appear here?
When I go directly to the DB from the python command line, I have no issues:
>>> conn = sqlite3.connect('....../db.sqlite3') >>> cur = conn.cursor() >>> sql = 'delete from pps_goals where id = 10' >>> rs = cur.execute(sql) >>> conn.commit() For completeness, here is the relevant portion of models.py
class Goals(models.Model): objects = models.Manager() name = models.CharField(max_length=50) total_duration = models.DecimalField("total_duration","total_duration",5,3)Any ideas what I'm messing up?
/r/django
https://redd.it/1cdwz59
Reddit
From the django community on Reddit
Explore this post and more from the django community
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1ce0l10
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1ce0l10
YouTube
Data Structures and Algorithms in Python - Full Course for Beginners
A beginner-friendly introduction to common data structures (linked lists, stacks, queues, graphs) and algorithms (search, sorting, recursion, dynamic programming) in Python. This course will help you prepare for coding interviews and assessments.
🔗 Course…
🔗 Course…
American Airlines scraper made in Python with only http requests
Hello wonderful community,
Today I'll present to you pyaair, a scraper made pure on Python https://github.com/johnbalvin/pyaair
Easy instalation
` ` `pip install pyaair ` ` `
Easy Usage
` ` ` airports=pyaair.airports("miami","") ` ` `
Always remember, only use selenium, puppeteer, playwright etc when it's strictly necesary
Let me know what you think,
thanks
About me:
I'm full stack developer specialized on web scraping and backend, with 6-7 years of experience
/r/Python
https://redd.it/1ce1qi4
Hello wonderful community,
Today I'll present to you pyaair, a scraper made pure on Python https://github.com/johnbalvin/pyaair
Easy instalation
` ` `pip install pyaair ` ` `
Easy Usage
` ` ` airports=pyaair.airports("miami","") ` ` `
Always remember, only use selenium, puppeteer, playwright etc when it's strictly necesary
Let me know what you think,
thanks
About me:
I'm full stack developer specialized on web scraping and backend, with 6-7 years of experience
/r/Python
https://redd.it/1ce1qi4
GitHub
GitHub - johnbalvin/pyaair: American Airlines scraper in Python
American Airlines scraper in Python. Contribute to johnbalvin/pyaair development by creating an account on GitHub.
I am getting a error when I try to verify the password with argon2. It always come back as False.
What am I doing wrong? Here are the docs https://argon2-cffi.readthedocs.io/en/stable/howto.html Put simply
always returns
Here is the code.
​
routes.py
from argon2 import PasswordHasher, exceptions
from flask import flash
def comparehashedpasswords(hashedpassworddb, plaintextpasswordform):
'''
The code runs in the /login route.
Compares the hashedpassword in the db and plaintext password form.
ph.verify(...) returns True if it matches and returns False if it doesn't match.
'''
ph = PasswordHasher()
try:
verifypassword = ph.verify(hashedpassworddb, plaintextpasswordform)
flash(verifypassword)
return verifypassword
except
/r/flask
https://redd.it/1cdua6b
What am I doing wrong? Here are the docs https://argon2-cffi.readthedocs.io/en/stable/howto.html Put simply
ph.verifyalways returns
argon2.exceptions.VerifyMismatchError: The password does not match the supplied hashph = PasswordHasher() ph.verify(...)Here is the code.
​
routes.py
from argon2 import PasswordHasher, exceptions
from flask import flash
def comparehashedpasswords(hashedpassworddb, plaintextpasswordform):
'''
The code runs in the /login route.
Compares the hashedpassword in the db and plaintext password form.
ph.verify(...) returns True if it matches and returns False if it doesn't match.
'''
ph = PasswordHasher()
try:
verifypassword = ph.verify(hashedpassworddb, plaintextpasswordform)
flash(verifypassword)
return verifypassword
except
/r/flask
https://redd.it/1cdua6b
I am trying to gather some feedback and criticism for a flask project of mine and would really appreciate some responses to my short survey.
https://forms.gle/CidTEguZJB5mJkzN6
/r/flask
https://redd.it/1cdqpvb
https://forms.gle/CidTEguZJB5mJkzN6
/r/flask
https://redd.it/1cdqpvb
Google Docs
Feedback on Interface Design and Usability
Welcome to this survey on evaluating the first prototype for a cashless tipping app. The purpose of the web app is to facilitate transactions between restaurant and bar staff with customers wishing to tip them for their services. An employee is able to set…
Ideas required for a dataset I've gathered.
I have a dataset of reddit cross posts I've gathered.
Link:
https://www.kaggle.com/datasets/albertg30/reddit-cross-posts-dataset
I need some interesting & challenging project/research ideas I can do using this.
I'll note any idea! Thank you!
/r/Python
https://redd.it/1ce7qii
I have a dataset of reddit cross posts I've gathered.
Link:
https://www.kaggle.com/datasets/albertg30/reddit-cross-posts-dataset
I need some interesting & challenging project/research ideas I can do using this.
I'll note any idea! Thank you!
/r/Python
https://redd.it/1ce7qii
Kaggle
Reddit Cross Posts Dataset
Reddit Cross Posts Data gathered using PRAW. Contains Source-Target Pairs.
ASCII plot backend package for matplotlib
Hi
I've made a package called mpl_ascii which is a backend for matplotlib. You can find it here: https://github.com/chriscave/mpl\_ascii
I would love to share it with others and see what you guys think
What it is
It is a backend for matplotlib that converts your plots into ASCII characters.
At the moment I have only made support for: bar charts, scatter plots and line plots but if there's demand for more then I would love to keep working on it.
Target Audience:
Anyone using matplotlib to create plots who might also want to track how their plots change with their codebase (i.e. version control).
Comparison:
There are a few plotting libraries that produce ASCII plots but I have only come across this one that is a backend for matplotlib: https://github.com/gooofy/drawilleplot. I think it's a great package and it is really clever code but I found it a little lacking when you have multiple colours in a plot. Let me know if you know of other matploblib backends that does similar things.
Use case:
A use case I can think of is for version controlling your plots. Having your plot as a txt format means it can be much easier to see the diff and the files you are committing are much
/r/Python
https://redd.it/1ce9a2t
Hi
I've made a package called mpl_ascii which is a backend for matplotlib. You can find it here: https://github.com/chriscave/mpl\_ascii
I would love to share it with others and see what you guys think
What it is
It is a backend for matplotlib that converts your plots into ASCII characters.
At the moment I have only made support for: bar charts, scatter plots and line plots but if there's demand for more then I would love to keep working on it.
Target Audience:
Anyone using matplotlib to create plots who might also want to track how their plots change with their codebase (i.e. version control).
Comparison:
There are a few plotting libraries that produce ASCII plots but I have only come across this one that is a backend for matplotlib: https://github.com/gooofy/drawilleplot. I think it's a great package and it is really clever code but I found it a little lacking when you have multiple colours in a plot. Let me know if you know of other matploblib backends that does similar things.
Use case:
A use case I can think of is for version controlling your plots. Having your plot as a txt format means it can be much easier to see the diff and the files you are committing are much
/r/Python
https://redd.it/1ce9a2t
GitHub
GitHub - chriscave/mpl_ascii: A matplotlib backend that produces plots using only ASCII characters
A matplotlib backend that produces plots using only ASCII characters - chriscave/mpl_ascii
Project ideas for internship
Hello everyone I have done with models and now I want to start making project to get internship. Please suggest me some idea so that I can practice my skill and showcase my project for internship.
Please help me out thank you in anticipation.
/r/djangolearning
https://redd.it/1ced7j8
Hello everyone I have done with models and now I want to start making project to get internship. Please suggest me some idea so that I can practice my skill and showcase my project for internship.
Please help me out thank you in anticipation.
/r/djangolearning
https://redd.it/1ced7j8
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
I Made a Short Tutorial About How to Create Custom Management Commands In Django
Hello 👋,
A few months ago, I started making videos about coding because I found that it helps me retain concepts and it is a great way to share something I love with the world, which often feels really nice. My latest video is about 4 minutes long and it is about Custom Management Commands!
When I started learning Django, I was super excited about Custom Commands, and I still am. 😅 I really hope that by sharing it here, some one will find it useful.
Here is the link:
https://youtu.be/4qIK6cxkJts
If you watch the video, I would love to hear you thoughts!
Happy coding!
/r/djangolearning
https://redd.it/1cds35q
Hello 👋,
A few months ago, I started making videos about coding because I found that it helps me retain concepts and it is a great way to share something I love with the world, which often feels really nice. My latest video is about 4 minutes long and it is about Custom Management Commands!
When I started learning Django, I was super excited about Custom Commands, and I still am. 😅 I really hope that by sharing it here, some one will find it useful.
Here is the link:
https://youtu.be/4qIK6cxkJts
If you watch the video, I would love to hear you thoughts!
Happy coding!
/r/djangolearning
https://redd.it/1cds35q
YouTube
Quick Django Tip: How to write Custom Management Commands [ Quick Guide ]
In this video we'll see how easy it is to create custom commands in Django.
It can be tiring to type "python manage.py makemigrations" then "python manage.py migrate" then "python manage.py runserver". The good news is we can just combine those commands…
It can be tiring to type "python manage.py makemigrations" then "python manage.py migrate" then "python manage.py runserver". The good news is we can just combine those commands…
In what way do you try out small things when developing?
I've noticed at work that my coworkers and I try out small things in different ways. Small things like if you want to try that adding two datetimes together behaves in the way you expect. Some people use jupyter notebook for this and others run python interactively in a separate command prompt.
I usually run debug in whatever IDE I'm using and then letting it stop at the code I'm currently developing and then using the debug console to test things out. Sometimes this means just leaving the debugger at a breakpoint for half an hour while I continue writing code. Is my way of doing it weird or does it have any disadvantages? How do you usually test out things on the go in a good way?
/r/Python
https://redd.it/1cegl14
I've noticed at work that my coworkers and I try out small things in different ways. Small things like if you want to try that adding two datetimes together behaves in the way you expect. Some people use jupyter notebook for this and others run python interactively in a separate command prompt.
I usually run debug in whatever IDE I'm using and then letting it stop at the code I'm currently developing and then using the debug console to test things out. Sometimes this means just leaving the debugger at a breakpoint for half an hour while I continue writing code. Is my way of doing it weird or does it have any disadvantages? How do you usually test out things on the go in a good way?
/r/Python
https://redd.it/1cegl14
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
I found nice bootstrap theme
I stumbled accidentally while googling and found this theme based on bootstrap. Seems newish, started in 2022 according to github. Bootstrap is still going strong. I want share in case you would like to change default bootstrap theme
https://fastbootstrap.com/
PS. If you still want to get change bootstrap colors super easy and generates sass variables try my tool https://palettolithic.com/
/r/django
https://redd.it/1ceh3r5
I stumbled accidentally while googling and found this theme based on bootstrap. Seems newish, started in 2022 according to github. Bootstrap is still going strong. I want share in case you would like to change default bootstrap theme
https://fastbootstrap.com/
PS. If you still want to get change bootstrap colors super easy and generates sass variables try my tool https://palettolithic.com/
/r/django
https://redd.it/1ceh3r5
Fastbootstrap
Awesome Bootstrap Theme with Atlassian Design - FastBootstrap
Beautiful Bootstrap UI components designed with Atlassian Design.
Djagno Advanced Roadmap
hi! I started learning django about a year ago I've covered all the basics I also learned DRF with a few advanced topics models, views, cbv, fbv etc... I want to reach the point where I qualify to apply for jobs in companies I want a complete and comprehensive roadmap for Django so that I can evaluate my level through it I learned node js , react & react native also as a matter of knowledge So that I will be aware of how the frontend works specifically, which will contribute to raising my level
​
I have already completed several projects as a freelancer
The last one was an ecommerce shop
But I could not determine whether my code was clean and of a high level of quality
any help?
​
iam thinking about switching to node js - express - mongoose
i feel like iam lost rn :)
/r/django
https://redd.it/1cej5ct
hi! I started learning django about a year ago I've covered all the basics I also learned DRF with a few advanced topics models, views, cbv, fbv etc... I want to reach the point where I qualify to apply for jobs in companies I want a complete and comprehensive roadmap for Django so that I can evaluate my level through it I learned node js , react & react native also as a matter of knowledge So that I will be aware of how the frontend works specifically, which will contribute to raising my level
​
I have already completed several projects as a freelancer
The last one was an ecommerce shop
But I could not determine whether my code was clean and of a high level of quality
any help?
​
iam thinking about switching to node js - express - mongoose
i feel like iam lost rn :)
/r/django
https://redd.it/1cej5ct
Reddit
From the django community on Reddit
Explore this post and more from the django community
Pure Python Physics Engine
What My Project Does The Physics Engine Called PhysEng, provides an easy to use environment and visualization combo in which to try out different physics or even provide a template to design your own accelleration/velocity fields. Besides the visualization aspect and numpy the basic functions of the Engine are written completely in 100% python. The features included in the Engine are:
Particles, Soft Bodies, Anchor points
Built in Fields: Drag, Uniform Force Fields, Gravity Between Particles, Octree Gravity etc
Make your own: There are standard templates included in the Examples to design your own fields
Springs - Construct Soft Bodies using Springs. (Built in soft bodies: Cloth and ball
Target Audience PhysEng is made for people who just want to try out different simple simulations or want to design their own physics.
Comparison Looking through github I could never really find a simple and easy-to-use library that did not require me to install some weird libraries or that felt like it was hiding some process from me through using packages. This package is a solution to this since everything is written in python nothing is a secret and can be directed easily.
Get PhysEng There is full documentation available in the Github repo: https://github.com/levi2234/PhysEng
/r/Python
https://redd.it/1cemmxv
What My Project Does The Physics Engine Called PhysEng, provides an easy to use environment and visualization combo in which to try out different physics or even provide a template to design your own accelleration/velocity fields. Besides the visualization aspect and numpy the basic functions of the Engine are written completely in 100% python. The features included in the Engine are:
Particles, Soft Bodies, Anchor points
Built in Fields: Drag, Uniform Force Fields, Gravity Between Particles, Octree Gravity etc
Make your own: There are standard templates included in the Examples to design your own fields
Springs - Construct Soft Bodies using Springs. (Built in soft bodies: Cloth and ball
Target Audience PhysEng is made for people who just want to try out different simple simulations or want to design their own physics.
Comparison Looking through github I could never really find a simple and easy-to-use library that did not require me to install some weird libraries or that felt like it was hiding some process from me through using packages. This package is a solution to this since everything is written in python nothing is a secret and can be directed easily.
Get PhysEng There is full documentation available in the Github repo: https://github.com/levi2234/PhysEng
/r/Python
https://redd.it/1cemmxv
GitHub
GitHub - levi2234/PhysEng: A 95% python physics engine
A 95% python physics engine. Contribute to levi2234/PhysEng development by creating an account on GitHub.
How to automatically order M2M relations
Hi, I have a M2M relation as such:
class Outfit(models.Model):
clothes = models.ManyToManyField(Clothing)
class Clothing(models.Model):
itemcategory = models.ForeignKey("ClothingCategory", ondelete=models.CASCADE)
class ClothingCategory(models.Model):
subcategory = models.CharField(
choices=ClothingSubcategory.choices,
maxlength=10,
default=ClothingSubcategory.TSHIRT,
unique=True,
)
category = models.CharField(
choices=ClothingType.choices, maxlength=10, default=ClothingType.TOP
)
weight = models.IntegerField()
Whenever I am using the Outfit queryset, I want the Clothing relation of each entity to be sorted with respect to the "item_category__weight". Is there a way for me to make this the default behaviour of the Outfit model. If
/r/django
https://redd.it/1ceokar
Hi, I have a M2M relation as such:
class Outfit(models.Model):
clothes = models.ManyToManyField(Clothing)
class Clothing(models.Model):
itemcategory = models.ForeignKey("ClothingCategory", ondelete=models.CASCADE)
class ClothingCategory(models.Model):
subcategory = models.CharField(
choices=ClothingSubcategory.choices,
maxlength=10,
default=ClothingSubcategory.TSHIRT,
unique=True,
)
category = models.CharField(
choices=ClothingType.choices, maxlength=10, default=ClothingType.TOP
)
weight = models.IntegerField()
Whenever I am using the Outfit queryset, I want the Clothing relation of each entity to be sorted with respect to the "item_category__weight". Is there a way for me to make this the default behaviour of the Outfit model. If
/r/django
https://redd.it/1ceokar
Reddit
From the django community on Reddit
Explore this post and more from the django community
Sunday Daily Thread: What's everyone working on this week?
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1cestbe
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1cestbe
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Are PEP 744 goals very modest?
Pypy has been able to speee up pure python code by a factor of 5 or more for a number of years. The only disadvantage it has is the difficulty in handling non python mistakes which are very commonly used in practice.
https://peps.python.org/pep-0744 seems to be talking about speed ups of 5-10%. Why are the goals so much more modest than what pypy can already achieve?
/r/Python
https://redd.it/1ceow5j
Pypy has been able to speee up pure python code by a factor of 5 or more for a number of years. The only disadvantage it has is the difficulty in handling non python mistakes which are very commonly used in practice.
https://peps.python.org/pep-0744 seems to be talking about speed ups of 5-10%. Why are the goals so much more modest than what pypy can already achieve?
/r/Python
https://redd.it/1ceow5j
Python Enhancement Proposals (PEPs)
PEP 744 – JIT Compilation | peps.python.org
Earlier this year, an experimental “just-in-time” compiler was merged into CPython’s main development branch. While recent CPython releases have included other substantial internal changes, this addition represents a particularly significant departure f...