I created a script that predicts Premier League football (soccer) results
Hi everyone,
I had a script that I made a while ago to predict football (soccer) results in the Premier League, and I've just made it into a webpage so everyone can use it.
Page: https://jimmyrustles.pythonanywhere.com/football
Github: https://github.com/sgriffin53/footballpredictorflask
It uses a Gaussian Naive Bayes model to predict results based on past data. It uses the data from the 2021-2024 seasons.
What My Project Does
It shows predictions for the next 30 days of football matches in the Premier League with predictions for scores for each match. The predictions are based on a probability model based on past performance. You can also input custom teams to see what the result would be in a match between them.
Target Audience (e.g., Is it meant for production, just a toy project, etc.
This is originally just for myself and my friend Jay. We've been using it to place accumulators on Premier League matches based on the predictions, only small longshot bets that would result in big payouts. We haven't won any money, but the bot has got a few 1 - 0 and 0 - 0 results correct in the time we've been using it. I made it into a Flask page so that everyone can use the predictions. It's intended
/r/Python
https://redd.it/1e8ym80
Hi everyone,
I had a script that I made a while ago to predict football (soccer) results in the Premier League, and I've just made it into a webpage so everyone can use it.
Page: https://jimmyrustles.pythonanywhere.com/football
Github: https://github.com/sgriffin53/footballpredictorflask
It uses a Gaussian Naive Bayes model to predict results based on past data. It uses the data from the 2021-2024 seasons.
What My Project Does
It shows predictions for the next 30 days of football matches in the Premier League with predictions for scores for each match. The predictions are based on a probability model based on past performance. You can also input custom teams to see what the result would be in a match between them.
Target Audience (e.g., Is it meant for production, just a toy project, etc.
This is originally just for myself and my friend Jay. We've been using it to place accumulators on Premier League matches based on the predictions, only small longshot bets that would result in big payouts. We haven't won any money, but the bot has got a few 1 - 0 and 0 - 0 results correct in the time we've been using it. I made it into a Flask page so that everyone can use the predictions. It's intended
/r/Python
https://redd.it/1e8ym80
Help: I am new to Django and I feel lost
I want to progress in my Python programming using Django. I feel stuck because I don't know where to source learning materials and there aren't many Django lovers where I am coming from and YouTube didn't offer much help.
I would appreciate it if I could get help and ideas here
/r/django
https://redd.it/1e90dax
I want to progress in my Python programming using Django. I feel stuck because I don't know where to source learning materials and there aren't many Django lovers where I am coming from and YouTube didn't offer much help.
I would appreciate it if I could get help and ideas here
/r/django
https://redd.it/1e90dax
Reddit
From the django community on Reddit
Explore this post and more from the django community
DRF Giveaway
https://www.udemy.com/course/the-complete-django-rest-framework-bootcamp-2024-latest/?couponCode=WEEKENDOFFER
/r/djangolearning
https://redd.it/1e8p2w4
https://www.udemy.com/course/the-complete-django-rest-framework-bootcamp-2024-latest/?couponCode=WEEKENDOFFER
/r/djangolearning
https://redd.it/1e8p2w4
Udemy
The Complete Django Rest Framework Bootcamp 2024 [Latest]
Master Django Rest Framework in 2024: A Comprehensive Bootcamp for Building Powerful APIs with Python
Protean - Opensource DDD/CQRS/ES Python Framework
**Protean is an open-source Python framework designed to build ambitious applications that scale and evolve.**
Sourcecode: [https://github.com/proteanhq/protean/](https://github.com/proteanhq/protean/)
Documentation is under construction and available at [https://docs.proteanhq.com/](https://docs.proteanhq.com/).
# What My Project Does
**Protean offers CQRS and Event-Sourcing tools and patterns for creating sustainable, domain-driven codebases.** It aims to tackle complexity in high-stakes domains and keep the codebase sustainable and maintainable.
At its core, Protean adopts a Domain-Driven Design (DDD) approach to development, supporting patterns to succinctly and precisely express your domain.
A Protean domain model sits at the center of the application. Infrastructure concerns like ORMs, API frameworks, and message brokers are plugged into it via configuration.
Protean has a ports-and-adapters architecture. When ready, developers can seamlessly plug technologies like databases, message brokers, and caches, and Protean will take care of the rest.
# Comparison
Protean is an alternative to Django but without the constraints that come with a monolithic system or full-stack frameworks. One can start with one domain hosted as one service but fragment the domain into multiple bounded contexts over time, deployed as microservices. Each piece of technology/infrastructure can be plugged in or swapped out with configuration.
# Target Audience
Protean is an ideal framework for:
* **Startups**: because they start small and want to get to market fast, and still want
/r/Python
https://redd.it/1e8v29e
**Protean is an open-source Python framework designed to build ambitious applications that scale and evolve.**
Sourcecode: [https://github.com/proteanhq/protean/](https://github.com/proteanhq/protean/)
Documentation is under construction and available at [https://docs.proteanhq.com/](https://docs.proteanhq.com/).
# What My Project Does
**Protean offers CQRS and Event-Sourcing tools and patterns for creating sustainable, domain-driven codebases.** It aims to tackle complexity in high-stakes domains and keep the codebase sustainable and maintainable.
At its core, Protean adopts a Domain-Driven Design (DDD) approach to development, supporting patterns to succinctly and precisely express your domain.
A Protean domain model sits at the center of the application. Infrastructure concerns like ORMs, API frameworks, and message brokers are plugged into it via configuration.
Protean has a ports-and-adapters architecture. When ready, developers can seamlessly plug technologies like databases, message brokers, and caches, and Protean will take care of the rest.
# Comparison
Protean is an alternative to Django but without the constraints that come with a monolithic system or full-stack frameworks. One can start with one domain hosted as one service but fragment the domain into multiple bounded contexts over time, deployed as microservices. Each piece of technology/infrastructure can be plugged in or swapped out with configuration.
# Target Audience
Protean is an ideal framework for:
* **Startups**: because they start small and want to get to market fast, and still want
/r/Python
https://redd.it/1e8v29e
GitHub
GitHub - proteanhq/protean: Pragmatic Framework for Ambitious Applications
Pragmatic Framework for Ambitious Applications. Contribute to proteanhq/protean development by creating an account on GitHub.
Want to contribute and learn from some django based mid sized projects.
I have been working in django DRF and react for couple of years. I hvae used vultr and aws for the deployments. However I am interestd to see how mid size projects are organized where there are more than 5-6 devs working on the same project. Would love to know if there is any open source project or if anyone want to let me see how they organize their code.
/r/django
https://redd.it/1e95rkk
I have been working in django DRF and react for couple of years. I hvae used vultr and aws for the deployments. However I am interestd to see how mid size projects are organized where there are more than 5-6 devs working on the same project. Would love to know if there is any open source project or if anyone want to let me see how they organize their code.
/r/django
https://redd.it/1e95rkk
Reddit
From the django community on Reddit
Explore this post and more from the django community
AWS EC2 Auto Scaling vs AWS ECS Fargate for Django
Which one would be more suitable for a site that has 2000 active users? and how much would it cost to use EC2 Auto Scaling vs ECS Fargate? please share your experience. I'm using Supbase database.
/r/django
https://redd.it/1e95eq4
Which one would be more suitable for a site that has 2000 active users? and how much would it cost to use EC2 Auto Scaling vs ECS Fargate? please share your experience. I'm using Supbase database.
/r/django
https://redd.it/1e95eq4
Reddit
From the django community on Reddit
Explore this post and more from the django community
no able to log-in after migration
hey guys, i have a doubt...
i am building a signup-login form, with user, admin, and a manager
I am using Werkzeug to hash password.
2 tables in use are:
1) Employees (consisting of admins and employees)
2) Users
now let's say, an admin logs in.
Admin changes manager's role to an user's.
I then restart the server (in order to migrate manager from Employee table to user's table)
now when I am logging in with the managers credentials, the hashed password isn't been read, and i can't log in. Whats with this error?
if i am migrating employee's password to user's password (even if as a script), shouldn't it read the hashed password using check_password_hash?
what else can i do?
/r/flask
https://redd.it/1e9aa14
hey guys, i have a doubt...
i am building a signup-login form, with user, admin, and a manager
I am using Werkzeug to hash password.
2 tables in use are:
1) Employees (consisting of admins and employees)
2) Users
now let's say, an admin logs in.
Admin changes manager's role to an user's.
I then restart the server (in order to migrate manager from Employee table to user's table)
now when I am logging in with the managers credentials, the hashed password isn't been read, and i can't log in. Whats with this error?
if i am migrating employee's password to user's password (even if as a script), shouldn't it read the hashed password using check_password_hash?
what else can i do?
/r/flask
https://redd.it/1e9aa14
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
What is the safest way to secure env variables?
Is it OK if I create a separate service with independent database and store everything there and call it via api?
Or is there any other approach that has more potential for keeping it safe?
Asking because my vps is constantly getting attacked with ssh bruteforce bots. I have banned more than 1800 IP addresses so far but they are not fudging.
/r/django
https://redd.it/1e99rea
Is it OK if I create a separate service with independent database and store everything there and call it via api?
Or is there any other approach that has more potential for keeping it safe?
Asking because my vps is constantly getting attacked with ssh bruteforce bots. I have banned more than 1800 IP addresses so far but they are not fudging.
/r/django
https://redd.it/1e99rea
Reddit
From the django community on Reddit
Explore this post and more from the django community
Defining a Custom Unknown Type in Python
I wrote up a short blog post based on an interesting workaround mentioned in this StackOverflow post for simulating an
If you have a better solution, feel free to share it!
/r/Python
https://redd.it/1e942fx
I wrote up a short blog post based on an interesting workaround mentioned in this StackOverflow post for simulating an
unknown type in Python.If you have a better solution, feel free to share it!
/r/Python
https://redd.it/1e942fx
Michael Uloth
Defining a Custom Unknown Type in Python
How to replicate TypeScript's unknown type with a generic type variable.
What are people's experience with Celery?
I thought I had a good use case for Celery but I found myself struggling and getting nowhere with it after several hours even to get a basic setup working. I eventually went back to using Cron jobs. Has anyone else got a basic example of a simple working project with Django using Celery? I had a devil of a time getting even a very simple example to work with it apparently not being able to find my celery.py file or complain about circular imports. I say apparently because it doesn't show errors to that effect but it appears not to execute that file. I am just after a basic minimal getting started example. I spent hours on this and got nowhere.
Are people still using Celery for new projects or something else?
/r/djangolearning
https://redd.it/1e8db7t
I thought I had a good use case for Celery but I found myself struggling and getting nowhere with it after several hours even to get a basic setup working. I eventually went back to using Cron jobs. Has anyone else got a basic example of a simple working project with Django using Celery? I had a devil of a time getting even a very simple example to work with it apparently not being able to find my celery.py file or complain about circular imports. I say apparently because it doesn't show errors to that effect but it appears not to execute that file. I am just after a basic minimal getting started example. I spent hours on this and got nowhere.
Are people still using Celery for new projects or something else?
/r/djangolearning
https://redd.it/1e8db7t
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Mypy 1.11 Released
https://mypy-lang.blogspot.com/2024/07/mypy-111-released.html
Features include:
Support Python 3.12 Syntax for Generics (PEP 695)
Support for functools.partial
Stricter Checks for Untyped Overrides
Type Inference Improvements
Improvements to Detection of Overlapping Overloads
Better Support for Type Hints in Expressions
Mypyc Improvements
etc.
/r/Python
https://redd.it/1e9fh4r
https://mypy-lang.blogspot.com/2024/07/mypy-111-released.html
Features include:
Support Python 3.12 Syntax for Generics (PEP 695)
Support for functools.partial
Stricter Checks for Untyped Overrides
Type Inference Improvements
Improvements to Detection of Overlapping Overloads
Better Support for Type Hints in Expressions
Mypyc Improvements
etc.
/r/Python
https://redd.it/1e9fh4r
Blogspot
Mypy 1.11 Released
Mypy 1.11 Released We’ve just uploaded mypy 1.11 to the Python Package Index ( PyPI ). Mypy is a static type checker for Python. This r...
Unable to create .db file with flask SQLAlchemy
I am trying to create a .db file where the login and signup details of the user will be stored, but i am unable to. Here is my __init__.py file:
from flask import Flask
from flasksqlalchemy import SQLAlchemy
from flasklogin import LoginManager
from app.models import DBNAME
from app.models import User, ElderlyUser, Volunteer
db = SQLAlchemy()
loginmanager = LoginManager()
loginmanager.loginview = 'main.login'
def createapp():
app = Flask(name)
app.config['SECRETKEY'] = 'secretkey'
app.config['SQLALCHEMYDATABASEURI'] = f'sqlite:///{DBNAME}'
db.initapp(app)
loginmanager.initapp(app)
from app.routes import main
app.registerblueprint(main)
return app
@loginmanager.userloader
/r/flask
https://redd.it/1e9gmg8
I am trying to create a .db file where the login and signup details of the user will be stored, but i am unable to. Here is my __init__.py file:
from flask import Flask
from flasksqlalchemy import SQLAlchemy
from flasklogin import LoginManager
from app.models import DBNAME
from app.models import User, ElderlyUser, Volunteer
db = SQLAlchemy()
loginmanager = LoginManager()
loginmanager.loginview = 'main.login'
def createapp():
app = Flask(name)
app.config['SECRETKEY'] = 'secretkey'
app.config['SQLALCHEMYDATABASEURI'] = f'sqlite:///{DBNAME}'
db.initapp(app)
loginmanager.initapp(app)
from app.routes import main
app.registerblueprint(main)
return app
@loginmanager.userloader
/r/flask
https://redd.it/1e9gmg8
Reddit
Unable to create .db file with flask SQLAlchemy : r/flask
86K subscribers in the flask community. Flask is a Python micro-framework for web development. Flask is easy to get started with and a great way to…
CSRF not being sent when in Xframe
My application runs smoothly when working through my own url, including logging in and other form activities. However, when x-frame’d in another site, I run into csrf verification issues and get the 403 forbidden when sending forms. In the dev tools, I can see that no request cookies are being sent, however, my csrf token and 4 other cookies are included in the ‘filtered out request cookies’ section of the cookies tab, so it appears for some reason they just aren't being passed. I have the below values set in my settings. Note that I have tried setting my cookie secure settings to False just to see if procore’s x-frame was maybe operating in a non-HTTPS manner, however, that did nothing to change the issue.
I have done the following to try and fix this: 1) changed the CSRF_COOKIE_SECURE, SESSION_COOKIE_SECURE, CSRF_COOKIE_SAMESITE, and SESSION_COOKIE_SAMESITE to their least secure settings 2) Updated my CSRF_TRUSTED_ORIGINS 3) Double checked all CSRF/security and middleware (I have all the default) 4) added the url to my ALLOWED_HOSTS 5) added custom CSP where I added the host url to my frame-src and frame-ancestors. 6) Remove the X_FRAME_OPTIONS = 'SAMEORIGIN'
None of these seem to be working and I am
/r/djangolearning
https://redd.it/1e9m3w2
My application runs smoothly when working through my own url, including logging in and other form activities. However, when x-frame’d in another site, I run into csrf verification issues and get the 403 forbidden when sending forms. In the dev tools, I can see that no request cookies are being sent, however, my csrf token and 4 other cookies are included in the ‘filtered out request cookies’ section of the cookies tab, so it appears for some reason they just aren't being passed. I have the below values set in my settings. Note that I have tried setting my cookie secure settings to False just to see if procore’s x-frame was maybe operating in a non-HTTPS manner, however, that did nothing to change the issue.
I have done the following to try and fix this: 1) changed the CSRF_COOKIE_SECURE, SESSION_COOKIE_SECURE, CSRF_COOKIE_SAMESITE, and SESSION_COOKIE_SAMESITE to their least secure settings 2) Updated my CSRF_TRUSTED_ORIGINS 3) Double checked all CSRF/security and middleware (I have all the default) 4) added the url to my ALLOWED_HOSTS 5) added custom CSP where I added the host url to my frame-src and frame-ancestors. 6) Remove the X_FRAME_OPTIONS = 'SAMEORIGIN'
None of these seem to be working and I am
/r/djangolearning
https://redd.it/1e9m3w2
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Need to print a page out
Hi all I want to be able to press a button on the webpage and print the page. I've got it setup so it looks good when I ctrl p, but I can't figure out how to make a button that brings the print page up
/r/flask
https://redd.it/1e9oedb
Hi all I want to be able to press a button on the webpage and print the page. I've got it setup so it looks good when I ctrl p, but I can't figure out how to make a button that brings the print page up
/r/flask
https://redd.it/1e9oedb
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
What skills do you need to become a Junior Developer today?
I'm primarily interested in skills related to data, but I'm open to other areas as well. It seems like the requirements for landing a junior developer position are constantly evolving. Could you provide insights into the minimal skill sets needed to secure that first job?
/r/Python
https://redd.it/1e9mr91
I'm primarily interested in skills related to data, but I'm open to other areas as well. It seems like the requirements for landing a junior developer position are constantly evolving. Could you provide insights into the minimal skill sets needed to secure that first job?
/r/Python
https://redd.it/1e9mr91
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How can I render dynamic graphs with nodes and edges in my website?
I have a database with nodes and edges. I want users to be able to view the graph, add new nodes and edges and inspect the graph by holding and dragging (just like in the graphic design softwares). I couldn't find a way online to achieve this. Is there a framework or library I can use to achieve this?
/r/djangolearning
https://redd.it/1e8iqy6
I have a database with nodes and edges. I want users to be able to view the graph, add new nodes and edges and inspect the graph by holding and dragging (just like in the graphic design softwares). I couldn't find a way online to achieve this. Is there a framework or library I can use to achieve this?
/r/djangolearning
https://redd.it/1e8iqy6
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
D Self-Promotion Thread
Please post your personal projects, startups, product placements, collaboration needs, blogs etc.
Please mention the payment and pricing requirements for products and services.
Please do not post link shorteners, link aggregator websites , or auto-subscribe links.
--
Any abuse of trust will lead to bans.
Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
--
Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.
/r/MachineLearning
https://redd.it/1e8btox
Please post your personal projects, startups, product placements, collaboration needs, blogs etc.
Please mention the payment and pricing requirements for products and services.
Please do not post link shorteners, link aggregator websites , or auto-subscribe links.
--
Any abuse of trust will lead to bans.
Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
--
Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.
/r/MachineLearning
https://redd.it/1e8btox
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
How does everyone plan and structure their apps?
I’m new to Django, been looking over different tutorials. For a more complex app, how does everyone plan and map out their app? With django using MVT, is there an easy way to build something usable fast when dealing with more complex apps? How do you polish the UI? Thanks!
/r/django
https://redd.it/1e9tdma
I’m new to Django, been looking over different tutorials. For a more complex app, how does everyone plan and map out their app? With django using MVT, is there an easy way to build something usable fast when dealing with more complex apps? How do you polish the UI? Thanks!
/r/django
https://redd.it/1e9tdma
Reddit
From the django community on Reddit
Explore this post and more from the django community
TypeError: Object of type Decimal is not JSON serializable even though the serialized data don't have Decimal type; Sessions are not updatedI have a cart that is integrated with the user's session. In my `APIView`, I made a function that would return a serialized data of my cart items. So other than my `GET` request, my `POST` and `DELETE` requests would also use the said function for my response.
It works if I try to send `GET` request. But I would get a `TypeError: Object of type Decimal is not JSON serializable` for my `POST` and `DELETE` requests. I also noticed that that my items in my session are not being updated. HOWEVER, if I try not to use the said function (the one that returns serialized data), everything works just fine. Can you guys help me understand what's causing this error?
class CartView(APIView):
def getcartdata(self, request):
cart = Cart(request)
cartdata = {
"items": [item for item in cart],
"totalprice":
/r/django
https://redd.it/1ea3vh4
Reddit
From the django community on Reddit
Explore this post and more from the django community