Anonymous
Saikiran you are right! But you know any good website, or udemy, book, or youtube channel that can help
Anonymous
Also I have countered _squlite3 import error when I run the server for first time..
Shubham
You can get free books from genesis library
Pankaj
serializers.CharField accepting integer values in drf. how this happening? Can anyone help me with this.
Salisu
Hello guys, pls how can I calculate renumeration for each staff according to their rank from a course they attended. Course and Staff are model classes in my django project
Anonymous
Doragonsureiyā
Hi, What is the best learning source for starting with django..
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Armstrong
Please how can I make an API request from pixabay...I want to allow user to be able to search images from pixabay via their api ...how I'm going to integrate the function in my views.py I've my API_KEY from pixabay... anyone please I need this urgently
Uday
I've created a model form and it does not show on the page models.py class Newsletter(models.Model): email = models.EmailField(max_length=254) name = models.CharField(max_length=50) timestamp = models.DateTimeField(auto_now_add=True) def __str__(self): return self.email forms.py class NewsletterForm(forms.ModelForm): class Meta: model = Newsletter fields = ['name', 'email'] views.py class HomeNewsletterFormView(FormView): template_name = 'home/base.html' form_class = NewsletterForm base.html <form method="POST" action=''> {% csrf_token %} {{ form.as_p }} <input type="submit">
Uday
In views u haven't returned the render and form as context
class HomeNewsletterFormView(FormView): template_name = 'home/base.html' form_class = NewsletterForm context_object_name = 'form' this?
R.U.S.H.A.B.H
C/p code in the pastebin 👆
Mite
What the error exactly says??
Mite
Send us the URls.py code
Uday
https://pastebin.com/VP2TzznH
Uday
Send us the URls.py code
from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home') ] this is it in urls.py
Uday
What the error exactly says??
no error, just the form fields doesnt show on the template
Mite
Path('home' ,views.HomeNewsletterFormView.as_view(),name='home') try this url pattern
Uday
Path('home' ,views.HomeNewsletterFormView.as_view(),name='home') try this url pattern
The form is in the base.html which consists of block and code on base.html shows on all pages anyway
Uday
The form is not particularly only on home template
Uday
It's in the footer
Anonymous
Hi, I am a beginner in django. So, i was trying to show static files in a web page. In settings.py, STATIC_URL is set to '/static/' . I have an app named blog. so, i put a image named main.jpg inside blog/static/blog/main.jpg. But, when i load the page, i see the following error . "GET /static/blog/main.jpg HTTP/1.1" 200 93415"
Anonymous
Based on documentation, it should also look into static folders inside the app's right?
Anonymous
Is there anything i am missing ?
Anonymous
I just restarted the app.. and its working.. weird!
Anonymous
Did u added os.path.join, BASE_DIR, " static"
Thanks. But, i have my files inside my app directory.. how does it help with adding path to static inside base dir?
Anonymous
Okay..thank you
Surendar
I am trying to use local SQL Server database as a default database in django application. I have declared database in setting.py file as below: DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'Hospital', 'USER': 'root', 'PASSWORD': 'upload', 'HOST': '127.0.0.1', 'PORT': '', 'OPTIONS': { 'driver': 'ODBC Driver 13 for SQL Server', 'host_is_server': True }, }, } While running the server I am getting below error: conn = Database.connect(connstr, django.db.utils.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2]. (2) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 13 for SQL Server]Invalid connection string attribute (0); [08001] [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (2)') pls help me to solve this issue.
Pankaj
serializers.CharField accepting integer values in drf. I have fields like first name and last name. And passing integer 1 to it is saving as "1". how this happening? Can anyone help me with this.
Anonymous
I have small doubt
Anonymous
Am dng a project
Anonymous
I want give total access to security admin
lil meow meow
Hello everyone. I cannot import simple app in my project. I am on Windows OS. And when I'm clicking on install package app_name it gives me an error. Have anyone struggled with this problem?
Cleo
Hello everyone. I have a question: how could I import CSS to my page. I was trying put some tags like { static }but doesn't works
محمد دلشاد
Hello everyone. I have a question: how could I import CSS to my page. I was trying put some tags like { static }but doesn't works
create a static files folder then put all your css and link it in your template with static keywod
Pankaj
since "1" is also a character
I just don't want integer to be accepted what to do now
محمد دلشاد
I just don't want integer to be accepted what to do now
use vanila js to prevent for that textbox
Pankaj
use vanila js to prevent for that textbox
U mean it should be handled from front-end side
agz
Please how do you handle more than one form in one view
R.U.S.H.A.B.H
R.U.S.H.A.B.H
It'll be easy
agz
Change your naming conventions
I mean handling more than one form class in a Django form. The documentation only explains handling one form class in a view
R.U.S.H.A.B.H
Just keep name different
agz
I already did that
Pankaj
yes
Thanks for ur help
محمد دلشاد
Anonymous
How to integrate emails notifications in Django? For a specific view?
Doragonsureiyā
How to integrate emails notifications in Django? For a specific view?
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box write down the same words you asked here Step 4: Read the firsts results
Akhil
Can we make a website appliancation for android using django??
Anonymous
Anyone who uses django at backend in react. Can you tell me is it a good idea or not. Can I use django.auth in that?
Anonymous
Anyone who uses django at backend in react. Can you tell me is it a good idea or not. Can I use django.auth in that?
Yes, just build your react app and the serve it as static files. You will require django rest framework for serving data to your react
Anonymous
Application*
Anonymous
Can we make a website appliancation for android using django??
Have you searched about responsive websites? This could help
Akhil
I just used python manage.py runserver
Akhil
Then I tried on my google chrome but it's only work in http
Akhil
Not in https why .?
Akhil
Can I not use in https ??
Mirco
Can I not use in https ??
The real answer is why ? You are in development mode, HTTPS is not needed