Wednesday, May 31, 2023
Re: pub_date field is not visible in admin panel, even after configuring the app made migrations i tried every way possible from my side
the field isn't displayed in the admin[2]. To show these fields in the
admin but leave them non-editable, list them as read-only fields[3] like
this:
# admin.py
from .models import Question
@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
readonly_fields = ['pub_date']
If you want these auto_now_add fields to be in the admin and editable,
I'm not sure, I've never done this. Maybe you can't explicitly set
editable=True on the field? Usually if I want to set a DateTime
automatically and also make it editable, I won't use auto_add_now.
Instead I'll override the save method and set the field there.
[1] https://docs.djangoproject.com/en/4.2/ref/models/fields/#datefield
[2] https://docs.djangoproject.com/en/4.2/ref/models/fields/#editable
[3] https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields
On Wed, May 31, 2023 at 12:57:24AM -0700, Likhith K.P. wrote:
> from django.db import models
>
> # Create your models here.
> class Question(models.Model):
> question_text = models.CharField(max_length = 500)
> pub_date = models.DateTimeField(auto_now_add = True)
>
> def __str__(self):
> return self.question_text
>
> class Choice(models.Model):
> question = models.ForeignKey(Question, on_delete = models.CASCADE)
> choice_text = models.CharField( max_length = 200)
> votes = models.IntegerField(default = 0)
>
> def __str__(self):
> return self.choice_text
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f8a5d278-a840-433b-b431-9499d9dd9debn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20230531151506.GO17675%40fattuba.com.
Re: Finding Help in getting started in Django
J. Ranga Bharath
Cell: 9110334114
I'd like to give some advice before start your Django journey and Django project configurations---------- Before Start Django ----------1. master Python "class" bacause you might use django class-based view a lot, learn "decorator" and standard library "datetime" and "re"2. choose "Python version" for your django project, I recommend Python 3.10 or 3.11. You should check current installed Python versionin your terminal --> py --version** if you use Unix OS like MacOS or Linux, type "python3" instead of "py"3. I highly recommend create virtual environment for each django project, install virtualenv with pipwindows cmd --> py -m pip install virtualenvthen --> py -m virtualenv app-envmacos terminal --> python3 -m pip install virtualenvthen --> python3 -m virtualenv app-env4. activate virtual environment you just createdwindows cmd --> app-env\Scripts\activate.bat or app-env\Scripts\activatemacos terminal --> source/bin/activateto stop virtualenv just type --> deactivate5. install django latest version via pip (you must activate virtualenv first)--> py -m pip install django---------- Start Django ----------1. start new django project (don't forget to activate virtualenv first)--> django-admin startproject my-app2. go inside project folder and create "requirements.txt" and type all requirement library for your project--- requirements.txt ---django >= 4.2.0, < 4.3.0wheel >= 0.4.0ipython >= 8.11.0 # python shell for django projectpython-decouple >= 3.7.0 # for hiding sensitive data in settings.py before uploading to gitsetuptools >= 67.7.0psycopg >= 3.0.0 # postgresql database driver. if you use django 4.1 or lower you must install psycopg2 instead of psycopgmysqlclient => 2.1.1 # mysql database driver. if you already use postgresql you don't need this3. install specified dependencies--> py -m pip install -r requirements.txtfor upgrade your dependencies --> py -m pip install --upgrade -r requirements.txtby doing this you have more control to your project dependenciesfor example if you specified "django >= 4.2.0, < 4.3.0" it will upgrade django between 4.2.0 to 4.2.* but never 4.3.04. in your main project directory it will have 3 files nowmy-app, manage.py and requirements.txt5. open "settings.py" in "my-app"first thing you need to be cautious is SECRET_KEY constant. You must never lose it or expose this to public that's why "python-decouple" library neededfor more information https://pypi.org/project/python-decouple/6. in DATABASE section change it to your database--- for postgresql ---DATABASES = {'default': {DATABASE_ENGINE='django.db.backends.postgresql'DATABASE_NAME='mydatabase'DATABASE_USER='root'DATABASE_PASSWORD=''DATABASE_HOST='localhost'DATABASE_PORT='5432'}}--- for mysql ---DATABASES = {'default': {ALLOWED_HOSTS='localhost'DATABASE_ENGINE='django.db.backends.mysql'DATABASE_NAME='mydatabase'DATABASE_USER='root'DATABASE_PASSWORD=''DATABASE_HOST='localhost'DATABASE_PORT='3306'}add your "user" and "password", both database port above are default port though7. start your first database migrate--> py manage.py migrateNow go for Django Tutorial --> https://docs.djangoproject.com/en/4.2/I hope this help you avoid some problems in the future.--ในวันที่ วันอังคารที่ 30 พฤษภาคม ค.ศ. 2023 เวลา 21 นาฬิกา 56 นาที 14 วินาที UTC+7 Veronica Ndemo เขียนว่า:Hi guys I need help.I am just getting started in using Django and I would love to get guidance on how to go about the Django framework
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8f7da283-844b-4fd3-aa73-324a5ada7d7cn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m316NYXbxJXg0skFM79dKANbqKq%2BnL-eMayU9w9qFtNHzSg%40mail.gmail.com.
Monday, May 29, 2023
Re: UPLOAD STATIC FILES
xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0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V5efzSE
Mdq9aMJ2N1pKmrVh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 29/05/2023 04.24, Obiorah Callistus wrote:
> please how can i display .css and .js files in my template
>
Have you considered reading the documentation?
Kind regards,
Kasper Laudrup
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ce267e59-2518-f897-d1b4-be148feaef98%40stacktrace.dk.
Re: UPLOAD STATIC FILES
please how can i display .css and .js files in my template --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5a2ceeec-20f1-46aa-98b9-717c9965b82dn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEXS5w%2B5m5ASCFR0YL%3Dt7CPWk%3DM__UVtTtHfLyJ1xcBZzFaEXw%40mail.gmail.com.
Sunday, May 28, 2023
Re: 'WSGIRequest' object has no attribute 'Files'
--I believe it should be all lower case request.filesOn May 22, 2023 4:36:36 AM AKDT, Sanket Chudasama <sanket.dev025@gmail.com> wrote:p_form = ProfileUpdateForm(data= request.POST, files= request.Files, instance = request.user)On Tuesday, 16 April 2019 at 12:35:15 UTC+5:30 Soumen Khatua wrote:Hi Folks,
I'm getting this error 'WSGIRequest' object has no attribute 'Files' and i didn't get proper solution in google also. I alredaty took enctype="multipart/form-data" in my forms tag. Here is my code snippet please provide me the solution it's urgent.Thank you in advance..html<form class="" method="post" enctype="multipart/form-data">{% csrf_token %}{{ p_form.as_p }}<input type="submit" name="" value="Change"></form>models.pyclass Profile(models.Model):user = models.OneToOneField(User, on_delete=models.CASCADE)bio = models.TextField(blank=True, null=True)image = models.ImageField(default='profile/default.jpg', upload_to='profile')views.pydef profile_view(request):if request.method == 'POST':print("this is update form post method")p_form = ProfileUpdateForm(request.POST,request.Files,instance = request.user.profile)if p_form.is_valid():p_form.save()return redirect('profile')Error:'WSGIRequest' object has no attribute 'Files'
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/81312FDA-D855-460D-8F04-04CB112F629E%40fattuba.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ4Kmg6j49X8ioUAB5NMyHrPjjEoMJBLmGjxFG%3DpZ7Om8vptdQ%40mail.gmail.com.
Saturday, May 27, 2023
Re: 'WSGIRequest' object has no attribute 'Files'
--I believe it should be all lower case request.filesOn May 22, 2023 4:36:36 AM AKDT, Sanket Chudasama <sanket.dev025@gmail.com> wrote:p_form = ProfileUpdateForm(data= request.POST, files= request.Files, instance = request.user)On Tuesday, 16 April 2019 at 12:35:15 UTC+5:30 Soumen Khatua wrote:Hi Folks,
I'm getting this error 'WSGIRequest' object has no attribute 'Files' and i didn't get proper solution in google also. I alredaty took enctype="multipart/form-data" in my forms tag. Here is my code snippet please provide me the solution it's urgent.Thank you in advance..html<form class="" method="post" enctype="multipart/form-data">{% csrf_token %}{{ p_form.as_p }}<input type="submit" name="" value="Change"></form>models.pyclass Profile(models.Model):user = models.OneToOneField(User, on_delete=models.CASCADE)bio = models.TextField(blank=True, null=True)image = models.ImageField(default='profile/default.jpg', upload_to='profile')views.pydef profile_view(request):if request.method == 'POST':print("this is update form post method")p_form = ProfileUpdateForm(request.POST,request.Files,instance = request.user.profile)if p_form.is_valid():p_form.save()return redirect('profile')Error:'WSGIRequest' object has no attribute 'Files'
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/81312FDA-D855-460D-8F04-04CB112F629E%40fattuba.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BZJHEoSCMeLPmcYf148iK0ACDPmGx9_gB6zkNav_UBNdmNtmg%40mail.gmail.com.
Re: 'WSGIRequest' object has no attribute 'Files'
p_form = ProfileUpdateForm(data= request.POST, files= request.Files, instance = request.user)On Tuesday, 16 April 2019 at 12:35:15 UTC+5:30 Soumen Khatua wrote:Hi Folks,
I'm getting this error 'WSGIRequest' object has no attribute 'Files' and i didn't get proper solution in google also. I alredaty took enctype="multipart/form-data" in my forms tag. Here is my code snippet please provide me the solution it's urgent.Thank you in advance..html<form class="" method="post" enctype="multipart/form-data">{% csrf_token %}{{ p_form.as_p }}<input type="submit" name="" value="Change"></form>models.pyclass Profile(models.Model):user = models.OneToOneField(User, on_delete=models.CASCADE)bio = models.TextField(blank=True, null=True)image = models.ImageField(default='profile/default.jpg', upload_to='profile')views.pydef profile_view(request):if request.method == 'POST':print("this is update form post method")p_form = ProfileUpdateForm(request.POST,request.Files,instance = request.user.profile)if p_form.is_valid():p_form.save()return redirect('profile')Error:'WSGIRequest' object has no attribute 'Files'
Friday, May 26, 2023
Re: Tokenized Authentication for subdomains
--Hi,I'm currently working on a project with subdomains, and I wanted to authenticate the user across the site, regardless of the url. I did some digging and found some ideas for implementing Oauth/openID connect authentication in Django (wasn't much help). Seeing, I don't intend on using third-party providers for this one.I have an idea of how it should work 'on paper', but it gets fuzzy when I start thinking about server-end verification; how the token is generated, and how I get access to it for later verification.Any suggestions, would be really helpful?Thanks in advance.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJN6x_gEgbE87yg0NpzhS_Rr_BEwWwo7HkWT02JRccfCfWS2Gw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACaE8x4AXKD7AUqk2%2B4Ck_%2Bp-zc5jOW%2BVDDXF7NMVLm6%3DYkW%3DQ%40mail.gmail.com.
Re: Tokenized Authentication for subdomains
sub1.example.com
sub2.example.com
...
Hi,I'm currently working on a project with subdomains, and I wanted to authenticate the user across the site, regardless of the url. I did some digging and found some ideas for implementing Oauth/openID connect authentication in Django (wasn't much help). Seeing, I don't intend on using third-party providers for this one.I have an idea of how it should work 'on paper', but it gets fuzzy when I start thinking about server-end verification; how the token is generated, and how I get access to it for later verification.Any suggestions, would be really helpful?Thanks in advance.
Re: How many related columns should you use on a model. Does it matter?
https://en.m.wikipedia.org/wiki/Third_normal_form
How many related columns should you use on a model. Does it matter?
For example, say in a payroll application I have a model Company. Each Company has multiple model Employee. Each Employee has a Job. Does it matter if the final model, Job has a fk to both the Employee and Company model or should the Job only have a relation to the Employee model?
What is the school of thought on this and why?
Thank you.
Re: JOB | Lead Platform Engineer (Singapore/London)
Hello, I'm working with an employer that is looking to hire someone in London or Singapore to take lead on the modernisation of their on-premises environment. Python experience is *mandatory*. Consequently, I had hoped that some members of this group may like to discuss. I can be reached using "JamesBTobin (at) Gmail (dot) Com". Kind regards, James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6cc40ec3-dc19-4dab-82da-bbc43035b154n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADJuPLUs3Y%2BK1%2BU_q4K-N1XPBe_axcDAAHko5CV_1nnmY4jwLg%40mail.gmail.com.
Thursday, May 25, 2023
Re: Dynamic Table
https://wq.io/guides/eav-vs-relational
I have to create dynamic table at runtime where user enters the details of table name,table column,table fields,constraints.take this input in backend and create table dynamically without creating schemas of tables as tables are created at runtime .first approach is that we will create one table where all the fields are mentioned where primary key,secondary key,unique,not niull and all the constraints are mentioned in horizontal column.now we have to create table 2 where user will select whild field id he want to select .suppose if user wants to create primary key then it will select field 1 in second table so it is refered from main table.and then table is created do you know how this works in django from backend side
Wednesday, May 24, 2023
Re: group by "project"
TRY THISfrom django.db.models import Count
def list(self, request, *args, **kwargs):
project_id = self.request.query_params.get('project_id')
if project_id:
queryset = RegistrationDatesSlots.objects.values('project', 'date').annotate(count=Count('project')).filter(project=project_id)
else:
queryset = RegistrationDatesSlots.objects.values('project', 'date')
serialized_data = []
for item in queryset:
serialized_item = {
'date': item['date'],
'project': item['project']
}
serialized_data.append(serialized_item)
return Response(serialized_data)--On Thursday, May 25, 2023 at 7:05:38 AM UTC+5:30 Muhammad Juwaini Abdul Rahman wrote:Do you realize what 'Count' do?On Thu, 25 May 2023 at 09:20, 'Mohamed Yahiya Shajahan' via Django users <django...@googlegroups.com> wrote:def list(self, request, *args, **kwargs):project_id = self.request.query_params.get('project_id')if project_id:queryset = RegistrationDatesSlots.objects.values('date').annotate(project=Count('project')).filter(project=project_id)# queryset = RegistrationDatesSlots.objects.filter(project=project_id).query.group_by=['project']else:queryset = RegistrationDatesSlots.objects.all().values('project', 'date')serialized_data = []for item in queryset:serialized_item = {'date': item['date'],'project': item['project']}serialized_data.append(serialized_item)return Response(serialized_data)
this is my views i want to group by "project" but shows only one record,
i know there are multiple records there
The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.SAVE PAPER | Good for your planet | Good for your Business
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/016aad73-74fc-49c3-80e7-c8d68ea0a6ddn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/28b321b8-4e3b-4fee-a94b-177ab1ba76f0n%40googlegroups.com.
SAVE PAPER | Good for your planet | Good for your Business
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAw%3DCNizUd266rbGVJWCemSYkQ%3DJmaVuHCR%2BSFCY03L-1UnO_g%40mail.gmail.com.
Re: importing ultralytics in Django rest framework
Hello, how are you?I'm trying to import and use ultralytics library in my Django rest framework app and I receive this error ValueError: libcublas.so.*[0-9] not found in the system path does anybody know how to solve this error?--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b124d7a2-4ea5-4537-85f8-1e4d1f1f67a3n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFKhtoRgFRdT8ERFYUxu2K9xDSDgGWTceF0nLFo1f4S%2BT2Dvuw%40mail.gmail.com.
group by "project"
this is my views i want to group by "project" but shows only one record,
i know there are multiple records there
SAVE PAPER | Good for your planet | Good for your Business
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/016aad73-74fc-49c3-80e7-c8d68ea0a6ddn%40googlegroups.com.
Monday, May 22, 2023
Re: Run Python Code on Front-End
How can one run Python code from the backend that triggers on the front-end upon clicking a button on a certain page?
Have a close look at htmx.
It doesn't run Python but will replace any targeted HTML element with output from Python (or any other code) running on the backend.
You would otherwise need a Python interpreter running in the browser. But who wants that with all the security issues entailed?
Htmx is a javascript library which enhances HTML itself. Your HTML in your template then calls your Django views directly to replace any part of a page with the result.
If htmx had been around earlier, all those famous js frameworks would never have been needed. It is a life saver.
M
-- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Your email software can handle signing.
Re: Run Python Code on Front-End
Hello all,I've created an accessibility app where the speech_recognition package is utilized and triggered upon running a Python function. I can successfully run the Python code in Jupyter Lab - no problems. However, it seems impossible to activate the speech_recognition package on the front-end from my views in the Django application.How can one run Python code from the backend that triggers on the front-end upon clicking a button on a certain page?Thanks all--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ca5edbef-3244-4d67-ad32-3cd9741c8ccdn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFKhtoTry3Zo06Xpvqssgh9mdCUv_VD2yP%2B_B7ZtqruoTkFf7Q%40mail.gmail.com.
How many related columns should you use on a model. Does it matter?
How many related columns should you use on a model. Does it matter?
For example, say in a payroll application I have a model Company. Each Company has multiple model Employee. Each Employee has a Job. Does it matter if the final model, Job has a fk to both the Employee and Company model or should the Job only have a relation to the Employee model?
What is the school of thought on this and why?
Thank you.
--You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3e2c011-584a-45da-9efd-83b1402f6a9bn%40googlegroups.com.
Re: 'WSGIRequest' object has no attribute 'Files'
Hi Folks,
I'm getting this error 'WSGIRequest' object has no attribute 'Files' and i didn't get proper solution in google also. I alredaty took enctype="multipart/form-data" in my forms tag. Here is my code snippet please provide me the solution it's urgent.Thank you in advance..html<form class="" method="post" enctype="multipart/form-data">{% csrf_token %}{{ p_form.as_p }}<input type="submit" name="" value="Change"></form>models.pyclass Profile(models.Model):user = models.OneToOneField(User, on_delete=models.CASCADE)bio = models.TextField(blank=True, null=True)image = models.ImageField(default='profile/default.jpg', upload_to='profile')views.pydef profile_view(request):if request.method == 'POST':print("this is update form post method")p_form = ProfileUpdateForm(request.POST,request.Files,instance = request.user.profile)if p_form.is_valid():p_form.save()return redirect('profile')Error:'WSGIRequest' object has no attribute 'Files'
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3e4130af-e2ee-4ec1-a90a-97b652c3e9ffn%40googlegroups.com.
Sunday, May 21, 2023
AWS lambda deployed problem
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9c0eddfd-c2ca-46e8-bf9e-a0ba0e7b6500n%40googlegroups.com.
AWS lambda deployed problem.
and zappa ==0.56.1.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b5d2113d-6344-45d6-be94-2a06991464f0n%40googlegroups.com.
Re: I new to Django
xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5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hrc8sXp
xaejU20acCtv6J4YpkYuBtkZHjLj65DBHlelk73N6qY3adHnmWCICFMICBRY4bpx
ay4/RGKodmROzq2PQy2pvRDSEwEGbeMeo7xCda1yPeoFJ0zcraNppVAEPV5efzSE
Mdq9aMJ2N1pKmrVh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 21/05/2023 16.26, khaled alshadbi wrote:
> Hello friends
> please help me to start from scratch... I want to build sales program
> using Python and Django
>
https://docs.djangoproject.com/en/4.2/intro/
Kind regards,
Kasper Laudrup
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/18ff3218-30a3-1b88-3553-2f5cefec5310%40stacktrace.dk.
Wednesday, May 17, 2023
Re: Queying 3 tables in Django
recruits = Recruitment.objects.filter(cv__skill=skill)
Hello Guys! How do I write a model query in django python to get the User details(Recruitment) when i pass a search parameter( skill) to the Skill table?
class Recruitment(models.Model):
fname = models.CharField(max_length=50)
lname = models.CharField(max_length=50)
address = models.CharField(max_length=100)
phone = models.IntegerField()
email = models.CharField(max_length=50)
password = models.CharField(max_length=30)
class CV(models.Model):
summary = models.TextField()
f_key_REC = models.ForeignKey(Recruitment, related_name='cv', on_delete=models.CASCADE)
class Skill(models.Model):
sk1 = models.CharField(max_length=100, default=None)
sk2 = models.CharField(max_length=100, default=None)
sk3 = models.CharField(max_length=100, default=None)
fk_sCV = models.ForeignKey(CV, related_name='skill', on_delete=models.CASCADE)
Friday, May 12, 2023
Your post titled "Re: Django query from database" has been unpublished
As you may know, our Community Guidelines
(https://blogger.com/go/contentpolicy) describe the boundaries for what we
allow-- and don't allow-- on Blogger. Your post titled "Re: Django query
from database" was flagged to us for review. We have determined that it
violates our guidelines and have unpublished the URL
http://djangotalk.blogspot.com/2013/10/re-django-query-from-database_11.html,
making it unavailable to blog readers.
Why was your blog post unpublished?
Your content has violated our Malware and Viruses policy. Please visit
our Community Guidelines page linked in this email to learn more.
If you are interested in republishing the post, please update the
content to adhere to Blogger's Community Guidelines. Once the content is
updated, you may republish it at
https://www.blogger.com/go/appeal-post?blogId=1173511580060553160&postId=9147577169866543105.
This will trigger a review of the post.
For more information, please review the following resources:
Terms of Service: https://www.blogger.com/go/terms
Blogger Community Guidelines: https://blogger.com/go/contentpolicy
Sincerely,
The Blogger Team
Your post titled "Re: logic problem" has been unpublished
As you may know, our Community Guidelines
(https://blogger.com/go/contentpolicy) describe the boundaries for what we
allow-- and don't allow-- on Blogger. Your post titled "Re: logic problem"
was flagged to us for review. We have determined that it violates our
guidelines and have unpublished the URL
http://djangotalk.blogspot.com/2013/10/re-logic-problem.html, making it
unavailable to blog readers.
Why was your blog post unpublished?
Your content has violated our Malware and Viruses policy. Please visit
our Community Guidelines page linked in this email to learn more.
If you are interested in republishing the post, please update the
content to adhere to Blogger's Community Guidelines. Once the content is
updated, you may republish it at
https://www.blogger.com/go/appeal-post?blogId=1173511580060553160&postId=8761795639695446029.
This will trigger a review of the post.
For more information, please review the following resources:
Terms of Service: https://www.blogger.com/go/terms
Blogger Community Guidelines: https://blogger.com/go/contentpolicy
Sincerely,
The Blogger Team
Your post titled "Re: DjangoDash 2010 is done! Check out the projects done in 48 hours." has been unpublished
As you may know, our Community Guidelines
(https://blogger.com/go/contentpolicy) describe the boundaries for what we
allow-- and don't allow-- on Blogger. Your post titled "Re: DjangoDash 2010
is done! Check out the projects done in 48 hours." was flagged to us for
review. We have determined that it violates our guidelines and have
unpublished the URL
http://djangotalk.blogspot.com/2010/08/re-djangodash-2010-is-done-check-out.html,
making it unavailable to blog readers.
Why was your blog post unpublished?
Your content has violated our Malware and Viruses policy. Please visit
our Community Guidelines page linked in this email to learn more.
If you are interested in republishing the post, please update the
content to adhere to Blogger's Community Guidelines. Once the content is
updated, you may republish it at
https://www.blogger.com/go/appeal-post?blogId=1173511580060553160&postId=8396721057445820593.
This will trigger a review of the post.
For more information, please review the following resources:
Terms of Service: https://www.blogger.com/go/terms
Blogger Community Guidelines: https://blogger.com/go/contentpolicy
Sincerely,
The Blogger Team
Your post titled "Re: I live in Ukraine. For me it is better to pick up European or US host?" has been unpublished
As you may know, our Community Guidelines
(https://blogger.com/go/contentpolicy) describe the boundaries for what we
allow-- and don't allow-- on Blogger. Your post titled "Re: I live in
Ukraine. For me it is better to pick up European or US host?" was flagged
to us for review. We have determined that it violates our guidelines and
have unpublished the URL
http://djangotalk.blogspot.com/2010/07/re-i-live-in-ukraine-for-me-it-is.html,
making it unavailable to blog readers.
Why was your blog post unpublished?
Your content has violated our Malware and Viruses policy. Please visit
our Community Guidelines page linked in this email to learn more.
If you are interested in republishing the post, please update the
content to adhere to Blogger's Community Guidelines. Once the content is
updated, you may republish it at
https://www.blogger.com/go/appeal-post?blogId=1173511580060553160&postId=8257710231134791299.
This will trigger a review of the post.
For more information, please review the following resources:
Terms of Service: https://www.blogger.com/go/terms
Blogger Community Guidelines: https://blogger.com/go/contentpolicy
Sincerely,
The Blogger Team
Your post titled "Re: duplicate entry in django" has been unpublished
As you may know, our Community Guidelines
(https://blogger.com/go/contentpolicy) describe the boundaries for what we
allow-- and don't allow-- on Blogger. Your post titled "Re: duplicate entry
in django" was flagged to us for review. We have determined that it
violates our guidelines and have unpublished the URL
http://djangotalk.blogspot.com/2013/09/re-duplicate-entry-in-django_7.html,
making it unavailable to blog readers.
Why was your blog post unpublished?
Your content has violated our Malware and Viruses policy. Please visit
our Community Guidelines page linked in this email to learn more.
If you are interested in republishing the post, please update the
content to adhere to Blogger's Community Guidelines. Once the content is
updated, you may republish it at
https://www.blogger.com/go/appeal-post?blogId=1173511580060553160&postId=8231429383425386164.
This will trigger a review of the post.
For more information, please review the following resources:
Terms of Service: https://www.blogger.com/go/terms
Blogger Community Guidelines: https://blogger.com/go/contentpolicy
Sincerely,
The Blogger Team