Check if user exist in login system Django
I'm struggling trying to figure out how to display the error message, but i don't know what else to try :(
It keeps showing the next error message: "Error al registrarse" instead of the one above.
​
views.py
def registroView(request):
if request.method == "POST":
form = CrearUsuarioForm(request.POST)
if form.isvalid():
user = form.save(commit=False)
if Usuario.objects.filter(
username=form.cleaneddata.get("username")
).exists():
messages.error(request, "Nombre de usuario ya utilizado!")
return redirect("registro")
/r/djangolearning
https://redd.it/104w69t
I'm struggling trying to figure out how to display the error message, but i don't know what else to try :(
It keeps showing the next error message: "Error al registrarse" instead of the one above.
​
views.py
def registroView(request):
if request.method == "POST":
form = CrearUsuarioForm(request.POST)
if form.isvalid():
user = form.save(commit=False)
if Usuario.objects.filter(
username=form.cleaneddata.get("username")
).exists():
messages.error(request, "Nombre de usuario ya utilizado!")
return redirect("registro")
/r/djangolearning
https://redd.it/104w69t
reddit
Check if user exist in login system Django
I'm struggling trying to figure out how to display the error message, but i don't know what else to try :( It keeps showing the next error...
Hot Reloading on Django Templates using ViteJS?
Is this possible? Laravel has a dedicated plugin to directly integrate ViteJS into your workflow.
/r/django
https://redd.it/1053a2c
Is this possible? Laravel has a dedicated plugin to directly integrate ViteJS into your workflow.
/r/django
https://redd.it/1053a2c
reddit
Hot Reloading on Django Templates using ViteJS?
Is this possible? Laravel has a dedicated plugin to directly integrate ViteJS into your workflow.
Trying to create an app that allows users (businesses) to be able to find other users (businesses) that are around them
Ive created an address model (fields for address, city, state, and zip) that will be linked to my user model via a one-to-one relationship. Are there any packages that would help me find the users in my DB nearby both by using either my address stored or via current location?
/r/djangolearning
https://redd.it/10532l3
Ive created an address model (fields for address, city, state, and zip) that will be linked to my user model via a one-to-one relationship. Are there any packages that would help me find the users in my DB nearby both by using either my address stored or via current location?
/r/djangolearning
https://redd.it/10532l3
reddit
Trying to create an app that allows users (businesses) to be able...
Ive created an address model (fields for address, city, state, and zip) that will be linked to my user model via a one-to-one relationship. Are...
Just showcasing this Flask app. Any feedback is appreciated!
https://www.fleetcardeal.com/
/r/flask
https://redd.it/1051elg
https://www.fleetcardeal.com/
/r/flask
https://redd.it/1051elg
How do I make another model a required field for abstractbaseuser model?
Here's a basic outline of what I've got
class Address(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
primary_key=True,
)
address = models.CharField(
max_length=200,
)
city = models.CharField(
max_length=100,
)
state = USStateField()
zipcode = USZipCodeField
class CustomUser(AbstractBaseUser):
...
required_fields = [
#How would I structure this to make the fields in Address required when
/r/django
https://redd.it/1055y71
Here's a basic outline of what I've got
class Address(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
primary_key=True,
)
address = models.CharField(
max_length=200,
)
city = models.CharField(
max_length=100,
)
state = USStateField()
zipcode = USZipCodeField
class CustomUser(AbstractBaseUser):
...
required_fields = [
#How would I structure this to make the fields in Address required when
/r/django
https://redd.it/1055y71
reddit
How do I make another model a required field for abstractbaseuser...
Here's a basic outline of what I've got class Address(models.Model): user = models.OneToOneField( ...
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/1059w5c
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/1059w5c
reddit
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic? Use this thread to chat about and...
Call a view and pass form fields from a pagination button
I have a template that shows a question and multiple choice answers.
I have pagination on the template and show one question at a time.
How can I call a view that will save the users answers each time the next button is clicked. I can’t submit the form because that will end the quiz and calculate the score.
I have not been able to get this working, does anyone have a solution?
/r/django
https://redd.it/105ckyc
I have a template that shows a question and multiple choice answers.
I have pagination on the template and show one question at a time.
How can I call a view that will save the users answers each time the next button is clicked. I can’t submit the form because that will end the quiz and calculate the score.
I have not been able to get this working, does anyone have a solution?
/r/django
https://redd.it/105ckyc
reddit
Call a view and pass form fields from a pagination button
I have a template that shows a question and multiple choice answers. I have pagination on the template and show one question at a time. How...
Dockerise a Django application - Part 6 - Postgres database
https://www.webinative.com/blog/dockerise-django-application-part-6/?utm_source=reddit&utm_medium=social&utm_campaign=dockerise
/r/django
https://redd.it/104s05l
https://www.webinative.com/blog/dockerise-django-application-part-6/?utm_source=reddit&utm_medium=social&utm_campaign=dockerise
/r/django
https://redd.it/104s05l
Webinative Technologies
Dockerise a Django application - Part 6 - Postgres | Webinative Technologies
Learn how to set up a Postgres container and connect to your Django app.
How do you all document websocket urls in django
I know how to document django views, but how do I document websocket urls and the consumer events. Or should I write down a document literally and give it to the frontend guy ?
/r/django
https://redd.it/1052180
I know how to document django views, but how do I document websocket urls and the consumer events. Or should I write down a document literally and give it to the frontend guy ?
/r/django
https://redd.it/1052180
reddit
How do you all document websocket urls in django
I know how to document django views, but how do I document websocket urls and the consumer events. Or should I write down a document literally and...
My celery-beat works locally but not in production?
my task:
@shared_task
def my_test():
# Executes every 2 minutes
UserStatisticStatus.objects.filter(id=1).update(loot_boxes=+234)
print('Hello from celery')
app.conf.beat_schedule = {
'my-task-every-10-seconds': {
'task': 'user_statistic_status.tasks.my_test',
'schedule': timedelta(seconds=10)
}
}
my settings:
if 'RDS_DB_NAME' in os.environ:
CELERY_BROKER_URL = 'redis://<myurl>/0'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'
CELERY_BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-central-1',
'polling_interval': 20,
/r/django
https://redd.it/104pw7q
my task:
@shared_task
def my_test():
# Executes every 2 minutes
UserStatisticStatus.objects.filter(id=1).update(loot_boxes=+234)
print('Hello from celery')
app.conf.beat_schedule = {
'my-task-every-10-seconds': {
'task': 'user_statistic_status.tasks.my_test',
'schedule': timedelta(seconds=10)
}
}
my settings:
if 'RDS_DB_NAME' in os.environ:
CELERY_BROKER_URL = 'redis://<myurl>/0'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'
CELERY_BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-central-1',
'polling_interval': 20,
/r/django
https://redd.it/104pw7q
reddit
My celery-beat works locally but not in production?
my task: @shared_task def my_test(): # Executes every 2 minutes ...
How to ensure password is hashed when saving User in model?
I'm using Djangos built in BaseUser and Abstract* for this, but when I create user on the model side using
u = User(... password="fsdfsd324")
u.fullclean()
u.save()
The DB still stores it in plain text. I've tried overriding clean and clean\password within the model as I would in forms, but this doesn't work.
What's the cleanest way to do this without Forms/ModelForms? Thanks
/r/django
https://redd.it/104shkm
I'm using Djangos built in BaseUser and Abstract* for this, but when I create user on the model side using
u = User(... password="fsdfsd324")
u.fullclean()
u.save()
The DB still stores it in plain text. I've tried overriding clean and clean\password within the model as I would in forms, but this doesn't work.
What's the cleanest way to do this without Forms/ModelForms? Thanks
/r/django
https://redd.it/104shkm
reddit
How to ensure password is hashed when saving User in model?
I'm using Djangos built in BaseUser and Abstract\* for this, but when I create user on the model side using u = User(......
Cargo Shipping (Export/Import) in Django
Hello good day. i have this project i'm developing and its about exporting and importing like usps/dhl/ups. i have a feature that i want to add but i'm having an issue combining how it will work.
what i want is that i want a user to be able to track the list of items in their order like when a user has taken the items to be sent to another country, to usps, a shipping record should be created with tracking number on it, and once a user clicks on that record on their dashboard, it should display all the items of that shipping on another page. and how can one add multiple items to an order using django forms because the list of items would be added using forms and once saved, a shipping (import or export) history would be created in which users can view on their dashboard, click on any and see the lists of items on their shipping history including payment and all that. thats the issue i have and need clarity on. i'm using mvt.
/r/django
https://redd.it/104r65g
Hello good day. i have this project i'm developing and its about exporting and importing like usps/dhl/ups. i have a feature that i want to add but i'm having an issue combining how it will work.
what i want is that i want a user to be able to track the list of items in their order like when a user has taken the items to be sent to another country, to usps, a shipping record should be created with tracking number on it, and once a user clicks on that record on their dashboard, it should display all the items of that shipping on another page. and how can one add multiple items to an order using django forms because the list of items would be added using forms and once saved, a shipping (import or export) history would be created in which users can view on their dashboard, click on any and see the lists of items on their shipping history including payment and all that. thats the issue i have and need clarity on. i'm using mvt.
/r/django
https://redd.it/104r65g
reddit
Cargo Shipping (Export/Import) in Django
Hello good day. i have this project i'm developing and its about exporting and importing like usps/dhl/ups. i have a feature that i want to add...
Free Copilot-like autocomplete for Jupyter notebooks
Hey everyone! I'm Anshul from the Codeium team, where we are building free AI-powered code autocomplete tooling, and today we are launching our integration on Jupyter notebooks, which has been the biggest ask from data scientists on our Discord since originally launching on VSCode and JetBrains. Currently no other major alternative (Github Copilot, Tabnine, Replit Ghostwriter, etc) supports standalone Jupyter notebooks. Hope you enjoy!
​
https://reddit.com/link/105diit/video/5ppcv2tzajaa1/player
/r/JupyterNotebooks
https://redd.it/105diit
Hey everyone! I'm Anshul from the Codeium team, where we are building free AI-powered code autocomplete tooling, and today we are launching our integration on Jupyter notebooks, which has been the biggest ask from data scientists on our Discord since originally launching on VSCode and JetBrains. Currently no other major alternative (Github Copilot, Tabnine, Replit Ghostwriter, etc) supports standalone Jupyter notebooks. Hope you enjoy!
​
https://reddit.com/link/105diit/video/5ppcv2tzajaa1/player
/r/JupyterNotebooks
https://redd.it/105diit
Codeium
Codeium in Jupyter Notebooks
Launching Codeium in Jupyter Notebooks.
I made a self-hosted full stack kanban-style webapp using Flask and Vue
Hi!
After almost half year I'm ready to share my project. I made a kanban-style webapp which inspired by Trello. Still need a proper project name though (I'm open to suggestions :-) ).
https://preview.redd.it/sbdlw9lrhmaa1.png?width=1920&format=png&auto=webp&s=2e9945b64c937b064027cb671cd48269af69428b
https://preview.redd.it/3acx41lrhmaa1.png?width=1920&format=png&auto=webp&s=3668132fc6ffe1fb03214d3ab9c2fc6c3afa3bec
Stack looks like this:
\- PostgreSQL as database engine
\- Flask as backend using Socket.IO too,
\- Vue 3 with Typescript for frontend (I'm still new to TS and not frontend expert yet)
It's currently on alpha state, check roadmap for planned features.
Project link on Github
/r/flask
https://redd.it/105ozjo
Hi!
After almost half year I'm ready to share my project. I made a kanban-style webapp which inspired by Trello. Still need a proper project name though (I'm open to suggestions :-) ).
https://preview.redd.it/sbdlw9lrhmaa1.png?width=1920&format=png&auto=webp&s=2e9945b64c937b064027cb671cd48269af69428b
https://preview.redd.it/3acx41lrhmaa1.png?width=1920&format=png&auto=webp&s=3668132fc6ffe1fb03214d3ab9c2fc6c3afa3bec
Stack looks like this:
\- PostgreSQL as database engine
\- Flask as backend using Socket.IO too,
\- Vue 3 with Typescript for frontend (I'm still new to TS and not frontend expert yet)
It's currently on alpha state, check roadmap for planned features.
Project link on Github
/r/flask
https://redd.it/105ozjo
Best IDE to practice python as a beginner?
As the title suggests, I am a complete beginner. Which IDE should I use to enhance my learning process?
/r/Python
https://redd.it/105tp9e
As the title suggests, I am a complete beginner. Which IDE should I use to enhance my learning process?
/r/Python
https://redd.it/105tp9e
reddit
Best IDE to practice python as a beginner?
As the title suggests, I am a complete beginner. Which IDE should I use to enhance my learning process?
Does anyone else constantly have problems with Conda conflicts?
Conda is a cool Python environment manager, but it also has some very opinionated ideas about what a valid environment is.
One issue I run into a lot is if you install a newer package on PIP, which works fine mind you. This usually causes a conflict like your current env requiring libgen 3.27, but the package you downloaded using 3.29 for example. At this point your whole conda is nuked and there’s no way to patch the conflict except try to roll back. You can’t just tell conda to mind it’s own business and ignore conflicts because it will never be able to resolve your environment ever again which is the first step of asking conda to do anything.
How would the fine folks at r/Python go about dealing with this?
/r/Python
https://redd.it/105qinj
Conda is a cool Python environment manager, but it also has some very opinionated ideas about what a valid environment is.
One issue I run into a lot is if you install a newer package on PIP, which works fine mind you. This usually causes a conflict like your current env requiring libgen 3.27, but the package you downloaded using 3.29 for example. At this point your whole conda is nuked and there’s no way to patch the conflict except try to roll back. You can’t just tell conda to mind it’s own business and ignore conflicts because it will never be able to resolve your environment ever again which is the first step of asking conda to do anything.
How would the fine folks at r/Python go about dealing with this?
/r/Python
https://redd.it/105qinj
reddit
Does anyone else constantly have problems with Conda conflicts?
Conda is a cool Python environment manager, but it also has some very opinionated ideas about what a valid environment is. One issue I run into a...
I scanned every package on PyPi and found 57 live AWS keys
https://tomforb.es/i-scanned-every-package-on-pypi-and-found-57-live-aws-keys/
/r/Python
https://redd.it/10525zo
https://tomforb.es/i-scanned-every-package-on-pypi-and-found-57-live-aws-keys/
/r/Python
https://redd.it/10525zo
My Infrastructure as Code Rosetta Stone - Deploying the same Django web application on AWS ECS Fargate with CDK, Terraform and Pulumi
https://briancaffey.github.io/2023/01/07/i-deployed-the-same-containerized-serverless-django-app-with-aws-cdk-terraform-and-pulumi/
/r/django
https://redd.it/105w9jf
https://briancaffey.github.io/2023/01/07/i-deployed-the-same-containerized-serverless-django-app-with-aws-cdk-terraform-and-pulumi/
/r/django
https://redd.it/105w9jf
briancaffey.github.io
My Infrastructure as Code Rosetta Stone - Deploying the same web application on AWS ECS Fargate with CDK, Terraform and Pulumi
Three reusable infrastructure as code libraries for abstracting containerized web app architecture on AWS ECS
Released a new update for my visual website builder, looking for some feedback!
https://reddit.com/link/105pm8v/video/slfg8d1cnmaa1/player
We posted in here a few months ago and got some awesome reception for our project, Nimbus. We're excited to announce the latest update to Nimbus, our visual website builder that exports to perfect React code (and more coming soon!). Built with Django, Nimbus makes it easy for developers of all levels to create and maintain professional websites.
With this update, we've added a couple of new features that we think users will find useful. First up, we've improved the user interface to make it even easier to use. We've also added one click previews, which allow you to see what your site will look like without having to constantly export. This should save you some time and make the building process even smoother.
The next thing we're going to work on is adding custom code so you never have to leave Nimbus when building a site. You'll be able to add custom functions, API calls, etc. right from Nimbus! It will take some time to develop but it's going to be awesome.
We hope you find these updates useful. As always, we appreciate your feedback and suggestions and feel free to ask me questions about how it works, I'm
/r/django
https://redd.it/105pm8v
https://reddit.com/link/105pm8v/video/slfg8d1cnmaa1/player
We posted in here a few months ago and got some awesome reception for our project, Nimbus. We're excited to announce the latest update to Nimbus, our visual website builder that exports to perfect React code (and more coming soon!). Built with Django, Nimbus makes it easy for developers of all levels to create and maintain professional websites.
With this update, we've added a couple of new features that we think users will find useful. First up, we've improved the user interface to make it even easier to use. We've also added one click previews, which allow you to see what your site will look like without having to constantly export. This should save you some time and make the building process even smoother.
The next thing we're going to work on is adding custom code so you never have to leave Nimbus when building a site. You'll be able to add custom functions, API calls, etc. right from Nimbus! It will take some time to develop but it's going to be awesome.
We hope you find these updates useful. As always, we appreciate your feedback and suggestions and feel free to ask me questions about how it works, I'm
/r/django
https://redd.it/105pm8v