^1-14-19-8^
is giving error: (myenv) C:\Users\Cxfd\projects\mysite>c:/Users/Cxfd/myenv/Scripts/python.exe c:/Users/Cxfd/projects/mysite/polls/urls.py Traceback (most recent call last): File "c:\Users\Cxfd\projects\mysite\polls\urls.py", line 3, in <module> from polls import views ModuleNotFoundError: No module named 'polls'
if used relative import: (myenv) C:\Users\Cxfd\projects\mysite>c:/Users/Cxfd/myenv/Scripts/python.exe c:/Users/Cxfd/projects/mysite/polls/urls.py Traceback (most recent call last): File "c:\Users\Cxfd\projects\mysite\polls\urls.py", line 3, in <module> from . import views ImportError: attempted relative import with no known parent package
^1-14-19-8^
have included the app name "polls" in settings.py: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polls', ]
^1-14-19-8^
even selected the correct interpreter which is present in the created environment
Good evening Please who here can help with any cloud service good in handling pdfs I mean ones I can upload and download the document from my django application
Mark
Hi developers
Mark
I need help, anyone up?
X_ShaygaN_D
I need help, anyone up?
This isnt a group of coding assistants, ask your questions and the ones able will help you.
Mark
I'm a Django developer, I have created a Quotation Maker WebApplication but I'm stuck when it comes to export the HTML template into PDF
Mark
without loosing Complex CSS Styling and format. I want same to same PDF as shown on my HTML Template
Mark
Is it possible?
Mark
I tried "xhtml2pdf" and other classes but it still not creating same to same, the content got messed up.
Mark
I also have images in my quotation template
Eddy
Good night people!I have two views that perform searches for different purposes in the database and I need both views to be accessed by the same form, how can I do this?
Eddy
<form class="d-flex" method="GET" action="{% url 'post:post_search' %} "> {% csrf_token %} <input class="form-control me-2" type="text" name="query"> <button class="btn btn-primary custom-btn" type="submit">Pesquisar</button> </for
Môhámêd
html is <div class="comment-input-box"> <form method="post" action="{% url 'product_detail' slug=product.slug %}" accept-charset="UTF-8"> {% csrf_token %} <div class="row"> <div class="col-xxl-6 col-xl-6"> <div class="comment-input"> <input type="text" name="review" placeholder="Your review"> </div> </div> <div class="col-xxl-12"> <div class="comment-submit"> <button type="submit" class="cart-btn">Submit</button> </div> </div> </div> </form> </div> and the view is if request.method == "POST": review = request.POST.get("review") if review: # review = str(review) print("----------review-------------->", review) i want to send arabic word in input but it sent in reverce and seperate any one help me in this problem
Kengne
I have a problème on figurating django-tenant with Django channels not working in asgi for all tenant, but only working with public schéma
The Inspired
Not yet
I'm going to need to see a screenshot of your views and urls
Sree
Hello, i want to setup google auth with django and react. Is there any better documentation for that?
Ibnu
hello , here is the errer Reverse for 'delete' with arguments '('',)' not found. 1 pattern(s) tried: ['delete/(?P<pk>[^/]+)/\\Z'] and its because of this : <a href='{% url 'delete' room.id %}' >Delete</a> whats wrong here?
Ibnu
From my very faint experience point of view: Are you sure this is a reasonable regular expression?
? What do you mean .. I really don't understand 😭 just this line of code in my template is making the error.. I want you to tell me if I have to share any specific code file.. This if my 1st time with this error..
Ibnu
this is my views code def delete(request , pk): room = get_object_or_404(Todo, id=pk) if request.method == 'POST': room.delete() return redirect('home') return render(request , 'Todo/delete.html' , { 'room' : room })
Kengne
AttributeError at /r/obamafashion/api/salon/ 'FakeTenant' object has no attribute 'domain_subfolder'. I'm using django-tenant with django-channels and i'm runnung asgi server with daphne. I got the error above
Kengne
AttributeError at /r/obamafashion/api/salon/ 'FakeTenant' object has no attribute 'domain_subfolder'. I'm using django-tenant with django-channels and i'm runnung asgi server with daphne. I got the error above. here is the reference https://dpaste.org/Kd6oU/slim
▲ GYelejin 🗡⃤ (po_beda)
How can I dynamically update a Django admin page with the admin table after applying filters in Django admin page? I have over 10 models. I can't make templates for all of them with js.
Rose
User Juab David has 1/3 warnings; be careful! Reason: rule #1: speak English
Isaac
Hello everyone! I have a slug field in my model that is automatically populated based on the name field when creating an object. I am looking to implement a functionality where if I enter text in a language other than English, such as Chinese, in the name field, the slug URL field will be translated to English.
C
Hi, i defined two apps and moved them into another app as they are related , but i have problem adding them to installed apps in settings as : "parentapp.childapp.apps.ChildappConfig" does not work. Now i wanted to know would be it okay if i import ChildAppConfig class to apps.py in parentapp ?and then use : "parentapp.apps.ChildappConfig" ? This is my first project in django and i really not sure sometimes if what i am doing to solve problems would not cause bigger problems! And if there is a better way , an standard one to do it and add the apps into another app to installed apps i appreciate if you tell me.
Nicolás
Hi. I am trying to deploy a project with nginx and gunicorn with my ubuntu machine as the server. I am experiencing troubles acquiring the SSL certificate with certbot. Can help me someone with experience on that?
Nicolás
The problem is
Nicolás
With the command $ sudo certbot --nginx -d gloss-shoes.com -d gloss-shoes.com -v
Macara
hello friends, I am working on an e-commerce problem now I have a little problem with basket management
Nicolás
http-01 challenge for gloss-shoes.com Waiting for verification... Challenge failed for domain gloss-shoes.com http-01 challenge for gloss-shoes.com Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems: Domain: gloss-shoes.com Type: connection Detail: 192.64.119.32: Fetching http://www.gloss-shoes.com/.well-known/acme-challenge/WpNLX9gAPQ66f_gJ7J4BC5zPE72K6hSgG-Bq32biCUk: Timeout during connect (likely firewall problem) Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.
Nicolás
I think that is something related with my local settings. If you have seen this previously, your insight will be highly valuable for me
Macara
hello friends, I am working on an e-commerce problem now I have a little problem with basket management
I want once the customer places an order to automatically delete their basket to allow another order to be made
Desval
Good morning,Please how to fix a circular Error in projet urls.py?
Alex
Good morning,Please how to fix a circular Error in projet urls.py?
what you got that need to be imported from urls?
Abhishek
Hello friend actually I am working on project where I have to make an order api in which payment is also integrated so I am facing an issue with making an order api so can anyone help me
Abhishek
FieldError at /order/v0/ Cannot resolve keyword 'status' into field. Choices are: actual_amount, attached_order, delivery_address, delivery_address_id, delivery_date, email, hash_value, id, is_paid, mobile, order_id, order_status, paid_amount, paid_via_wallet, payment_id, shown_amount, user, user_id
Abhishek
I got this issue while testing my api on postman
Abhishek
If you are free we can connect on any desk
Abhishek
I will show u all the things in detail
Charly
If you are free we can connect on any desk
Nah dude, you need to share all the details here. We don't provide private consulting for free this is a help group only.
Abhishek
Ok than may I send you code can you figure it out
Charly
Ok than may I send you code can you figure it out
I already gave you a hint, don't ignore it
Charly
And yes, share the code here
Charly
(read rule 5 to know how)
t
Hi everyone, I'm reaching out to the Django community for help with a custom template tag that I'm trying to implement. I've been troubleshooting the issue but haven't been able to resolve it, so I'd appreciate any insights you might have. Problem: My custom template tag named age is not being recognized in my Django template. I'm getting a TemplateSyntaxError: custom_tags' is not a registered tag library error. Things I've Done: Custom Tag Implementation: I've created a file named custom_tags.py within the templatetags directory of my app named person. Inside custom_tags.py, I have a function named calculate_age that takes a birthdate as input and returns the calculated age. The function is registered as a template filter using from django import template; register = template.Library().register. Template Usage: In my template (e.g., person_detail.html), I'm trying to use the age tag like this: {{ person.birthdate | age }}. I've included {% load custom_tags %} at the beginning of the template to load the custom tag library. Configuration: I've verified that the person app is listed in the INSTALLED_APPS setting within my project's settings.py file. APP_DIRS is set to True in the TEMPLATES setting to ensure Django searches for templates within installed apps. Troubleshooting: I've restarted the development server (python manage.py runserver). I've double-checked for typos in file names, variable names, and the template tag syntax. I've tried importing custom_tags from the shell (python manage.py shell) to confirm the module is found, but I get a ModuleNotFoundError: No module named 'person'.
t
Project Structure: ├── db.sqlite3 ├── docs ├── fansonly │   ├── apps │   │   ├── account │   │   │   ├── admin.py │   │   │   ├── apps.py │   │   │   ├── __init__.py │   │   │   ├── migrations │   │   │   │   └── __init__.py │   │   │   ├── models.py │   │   │   ├── tests.py │   │   │   └── views.py │   │   └── person │   │   ├── admin.py │   │   ├── context_processors.py │   │   ├── forms.py │   │   ├── __init__.py │   │   ├── migrations │   │   │   ├── 0001_initial.py │   │   │   ├── 0002_astrology_description.py │   │   │   ├── 0003_alter_astrology_options_alter_person_options_and_more.py │   │   │   ├── __init__.py │   │   │   └── __pycache__ │   │   │   ├── 0001_initial.cpython-310.pyc │   │   │   ├── 0002_astrology_description.cpython-310.pyc │   │   │   ├── 0003_alter_astrology_options_alter_person_options_and_more.cpython-310.pyc │   │   │   └── __init__.cpython-310.pyc │   │   ├── models.py │   │   ├── __pycache__ │   │   │   ├── admin.cpython-310.pyc │   │   │   ├── context_processors.cpython-310.pyc │   │   │   ├── forms.cpython-310.pyc │   │   │   ├── __init__.cpython-310.pyc │   │   │   ├── models.cpython-310.pyc │   │   │   ├── urls.cpython-310.pyc │   │   │   └── views.cpython-310.pyc │   │   ├── template_tags │   │   │   ├── custom_tags.py │   │   │   ├── __init__.py │   │   │   └── __pycache__ │   │   │   ├── custom_tags.cpython-310.pyc │   │   │   └── __init__.cpython-310.pyc │   │   ├── tests.py │   │   ├── urls.py │   │   └── views.py │   ├── asgi.py │   ├── __init__.py │   ├── __pycache__ │   │   ├── __init__.cpython-310.pyc │   │   ├── settings.cpython-310.pyc │   │   ├── urls.cpython-310.pyc │   │   └── wsgi.cpython-310.pyc │   ├── settings.py │   ├── urls.py │   └── wsgi.py ├── manage.py ├── media │   └── images │   ├── astrology │   │   └── zodiac-character_52683-12354.jpg │   ├── heda-1_7hXy0gh.jpg │   ├── heda-1.jpg │   ├── heda-2.jpg │   ├── heda-3.jpg │   ├── heda-4_1W3Vjpv.jpg │   ├── heda-4.jpg │   ├── occupation │   │   └── girls.webp │   └── person │   └── tehrani-hedieh-image.webp ├── requirements.txt ├── static ├── templates │   ├── base.html │   ├── person │   │   ├── index.html │   │   ├── person_detail.html │   │   └── profession.html │   ├── search_box.html │   └── search_form.html └── tests What could be causing the TemplateSyntaxError even though I've loaded the custom tag library? Thanks in advance for your help!
Of course
Hello I deploy my django project with nginx but for my static files return 403 error Who know why
jūdê
You might need to run collectstatic
Nicolás
But just on my server
Nicolás
And nothing more occurs
Nicolás
I readed today about the 443 port
Nicolás
Thanks, I will try with that change
Nuel-Green ICT
ValidationError at /admin/logout/ ['“2024-04-10 23:44:13.659801+00:00” value must be either True or False.'] Good day I'm happy to be here I go the above error from nowhere when i call logout in my django rest framework app i have removed the logout api and yet it's persistent i'm using django-rest-knox for authentication
Doragonsureiyā
🚫 ‎Victor [6179218284] is already banned.
Rose
Another one bites the dust...! Banned Victor. Reason: spam
Rebison
Hi everyone, Just now I have started to create a project using django. I have decided to use the MySQL database for my project. For using the MySQL database I have changed the settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'database_name', 'USER': 'root', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '3306', } } I have also installed the mysqlclient in the virtual environment When I try to run this command 'py manage.py migrate' It showing ModuleNotFoundError: No module named 'django.db.backends.mysql' Please help me out.
Macccc
use DATABASES instead of DATABASE
Rebison
Sorry, wrongly typed in the message. It is DATABASES only in the settings.py. In django documentation 'django.db.backends.mysql' is available but it is not working.