Vahid
AH
Levitybot
The Inspired
The Inspired
What is createview?
Used to create a new entry of model
https://docs.djangoproject.com/en/5.0/ref/class-based-views/generic-editing/#django.views.generic.edit.CreateView
greenspectactles
Isaac
I need help but I can't send the picture the page
khaled
I am facing a problem but not in my django project
I have a certbot container in my ddocker compose file
and I amm runnning it using docker-compose run --rm certbot certonly --webroot -w /var/www/certbot/ --force-renewal -d [domain]--email [email] --agree-tos
but it keeps refusing to create the ssl secure connection
do I have to do anything other than this ?
i followed many tutorials but still the same result
Charly
khaled
well my django application won't run correctly if this still appear
Isaac
Whenever I try to start the server this is what I get
Isaac
And I am not even using a virtual envelope
Charly
Isaac
Yes
No
I use vscode
khaled
What does appear?
Creating development_certbot_dev_run ... done
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for doctors.sy and www.doctors.sy
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: www.doctors.sy
Type: connection
Detail: 37.27.97.58: Fetching http://www.doctors.sy/.well-known/acme-challenge/qRL83mhMNiks_GygAFOTzsdeSMafRhJIV0QB6nbfCO0: Connection refused
Domain: doctors.sy
Type: connection
Detail: 37.27.97.58: Fetching http://doctors.sy/.well-known/acme-challenge/2u5b0V5HcYJwRTJEcFz3NYeSh_1hNgYHptT9GnmHyaw: Connection refused
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
Charly
khaled
ok
Charly
Isaac
Isaac
Charly
Yes
So thats the issue, you are not installing it in the right python version
Isaac
Charly
Charly
python vs python3 command for example
Charly
i dont know what versionns you have or what version you want to use so I can't give you the exact vcommand
Isaac
I have python 3.12.1 and 3.11.3
Isaac
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'flashprime.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if name == 'main':
main()
Isaac
And this is from my mange.py file
Isaac
@Carlangueitor are you there
Isaac
The normal way
Isaac
Isaac
Charly
The normal way
Then you may wrote a different command that the one written there
Isaac
Isaac
Dj - 505
Charly
Xzz
What's is this x module that project asks to download
Xzz
Code: execute_from_command_line(sys.atgv)
Xzz
Shows no module named x
Auc
Charly
Xzz
Charly
Ортонормированная
class Vendor(model.Model):
name = models.CharField(
unique=True,
max_length=100,
help_text='Enter the name of the company (supplier)',
db_comment='Name of the company (supplier)'
)
class Delivery(models.Model):
storage = models.ForeignKey('Storage', on_delete=models.CASCADE, help_text='Connection to the main warehouse')
vendor = models.ForeignKey('Vendor', on_delete=models.CASCADE, help_text='Communication with the supplier')
delivery_date = models.DateField(help_text='Delivery date')
[2024-05-01 08:28:05] [23503] ERROR: update or delete on table "vendors" violates foreign key constraint "deliveries_vendor_id_0fea7d79_fk_vendors_id" on table "deliveries"
[2024-05-01 08:28:05] Details: Key (id)=(1) is still referenced from table "deliveries".
Deleting an entry from the vendor table
What the hell is this? The cascade is worth it
Patil
If Anyone master in django please reply me
Doragonsureiyā
.
Hello everyone, please help me write the correct loop in the template for display. The code and details of the information on the link
https://dpaste.org/XSk8E
The Inspired
The Inspired
that or you need to delete the entry that it says... i.e. the table with id=1.
as simple as that
The Inspired
The Inspired
those errors are only for admin side. It wont show to user. for showing error to user, either use a frontend notification library, if you are using a framework like react or vue, or of using vanilla django, use Django's in-built messaging framework system
https://docs.djangoproject.com/en/5.0/ref/contrib/messages/
Ортонормированная
The Inspired
😅 that is error of postgres, not django...
you cannot show a database error in a framework... at least, not to my knowledge
Vitaly
e.orig.pgcode
nyctophile
hi guys!
i have a question, can i create serializer for a custom action that contains only one field(which is year)?
i am trying this way https://hastebin.com/share/lexolavabo.python, but no input is showing up. can you help me with that?
my goal is that to return some data according to the year which will be received
Farman
Hey is there any free hosting for django project
Abhi
I am creating a e commerce site where I created mostly the frontend part and I am a little confused about the backend i already created a function when the user clicks on but option it shows in the cart icon can any tell me some steps about backend like what I have to do
Auc
Dj - 505
Abhi
Pablo
Hi guys, please who has worked with the django-quill library before?
I am trying to get syntax highlighting to work but it isn’t working. The syntax highlighting gets displayed in the form when I am creating a new blog post, but when I render out the blog post, the syntax highlighting doesn’t work.
Please I need help
Doragonsureiyā
Pablo
Impossible to help without details.
Read this please:
http://www.catb.org/~esr/faqs/smart-questions.html
Only those who have worked with Django-quill-editor or quill can help. Note that I have combed through the documentation severally and several stackovwrflow answers
I am building a blog. Now in this blog, I am making use of a wysiwyg form called quill. It has a Django library wrapped around it called django-quill-editor.
Now when I am filling this form from the admin dashboard, I can clearly see that syntax of whatever code I put in being highlighted. So I fill the form and save it. When I display the contents of the blog in an html file, I see the contents but the syntax isn’t highlighted.