ᐯᑌᏞᏦᗩᑎ📈
but DEBUG=True working fine
Anonymous
hi who have a pdf Django course
Doragonsureiyā
hi who have a pdf Django course
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Anonymous
Aneesh
Any one know how to connect rest_framework and mongo engine
Aneesh
Plz help
Aneesh
Does any one know how to find the resources for that
Aneesh
Thanks .bt it is not working
Anonymous
Does anyone know how to integrate telegram for messaging and notification in django app
Raad
Hello everyone,
What do you suggest guys, I have a list of countries and a list of cities. Should I create a table in the database for countries and cities to hold these values or have them in the fronted app loaded from a Jason file or other method?
Raad
Considering that I’m using Django REST API from the backend and react native in the fronted and we have a pretty big database
Anonymous
Meba
Can anyone give me a way how to make a search in function based view (from views.py) and what the template should look like and the URLs too...
Sheshadri
Meba
I know I already write the filter I have got a problem with the Urls
Anonymous
Anonymous
Sinchan
How to access the built in id of model?
Anonymous
Sinchan
You are trying to add a non-nullable field 'id' to employee without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit, and let me add a default in models.py
Sinchan
How to resolve this?
Gil
How to resolve this?
You need to understant what have you done. Read,read,read
You have changed employee , without default field.
1- Write one field that wil be the same for all
2- COntinue doing changes to models.py
Day
In geodjango how do we query to get the location of a specific Id (like get the location of one supplier), here is the query to manipulate,
Mysup=serializer ("geojson",Supplier.objects.all()),
Anonymous
Hello guys, my SQLite doesn't keep records in herokup
Anonymous
But I can still log as admin
Anonymous
When I post updates. The record disappears after a certain amount of time
Anonymous
cj
Anonymous
I have whitenoise
Anonymous
I thought white noise keeps the data stored
Anonymous
And static files are still there
Dhruva
I am using the django rest auth framework for sending mails but in the mail I am getting HTML tags insted of content
Dhruva
How to resolve that
Anonymous
Have you created an HTML template for it
Dhruva
Yaa
Meba
What is the problem explain briefly
The problem I m working on kind of tutorials site and make sure that users can search tutorial by different methods(by department, by tutorial content and by tutorial name).
The routing or the URL goes like this for a department it gets to it from home for that specific department it finds all matching tutorials and goes like this.
meaning
urls.py
Path('<slug:requested_department>/', views.course, name='course'),
Path('<slug:requested_department>/<slug:course_name>/<int:requested_url>/', views.tutorial, name='tutorial'),
Path('search_results/q<slug:num>/', views.searchResults, name='search'),
header.html
<form action="{℅ url 'tutor:search' ℅}" method="GET">
<input type="text" name="q">
</form>
views.py
def SearchResults(request):
query = request.GET.get('q')
course_search_result = Course.objects.filter(Q(course_nameicontains=query))
tutorial_search_result = Tutorial.objects.filter(Q(tutorial_titleicontains=query))
tutorial_content_search_result = Tutorial.objects.filter(Q(tutorial_content__icontains=query))
return render(request,
'tutor/search.html',
{'tutorial_search_results':tutorial_search_result,
'course_search_results':course_search_result,
'tutorial_content_search_results':tutorial_content_search_result})
search.html
{% if tutorial_search_results or course_search_results or tutorial_content_search_results %}
{# search by tutorial title #}
{% if tutorial_search_results %}
{% for result in tutorial_search_results %}
<a href="/tutorial/{{result.id}}">{{result.tutorial_title}}</a>
{% endfor %}
{% endif %}
{% endif %}
when I tried the above code
NoReverseMatch at /tutorial/
Reverse for 'search' with no arguments not found. 1 pattern(s) tried: ['tutorial/search_results/q(?P<num>[-a-zA-Z0-9_]+)/$']
Meba
Anyone help??
Gil
Anyone help??
Not passing argument q<slug:num>
With no argument, no path, no view
Dhruva
def put(self, request, pk, format=None):
profiles = self.get_object(pk)
serializer = ProfilesSerializer(profiles, data=request.DATA)
if serializer.is_valid():
serializer.save()
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Dhruva
TypeError at /accounts/profiles/1
get_object() takes 1 positional argument but 2 were given
Meba
Dhruva
Mirco
Dhruva
Expected view ProfilesListView to be called with a URL keyword argument named "pk". Fix your URL conf, or set the .lookup_field attribute on the view correctly.
Dhruva
then I get this error
Mirco
Dhruva
Dhruva
TypeError at /accounts/profiles/1
get_object() takes 1 positional argument but 2 were given
Mirco
Mirco
Don't pass anything to it
Dhruva
Thank you
Mirco
Doragonsureiyā
Thank you
You're welcome! 😊
Shreehari
hey guys
has anyone used aws ses in django ?
if yes can you please help me with this error:
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)
Dhruva
def patch(self, request, pk):
object = self.get_object(pk)
serializer = ProfilesSerializer(object, data=request.data,
partial=True)
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Dhruva
I m using patch method but that is not working when testing in postman
Mirco
Dhruva
w/o pk also no updation
Mirco
get_object has no params
Dhruva
yaa put is working perfectly
Dhruva
as u told
Dhruva
passed in url
Mirco
Mirco
please study better REST and DRF
Dhruva
still its not partially updating
Mirco
try to read better and think before coding
Dhruva
ok
Momin
Guys i am new to django and i am watching django tutorial on youtube.its shows error when i connect database . I am using postgre and its shows (fatal : password authentication failed for user "postgre")
Momin
V
Hey guys, i am a begginer in django and i am using MySQL for my project. Ive created models and everything was working fine until today, migrations were not working. when i did python manage.py inspectdb, i found that all my models had default meta class managed=false which i read on offcial website should be true. However i created models again by dropping them manually from db and changes took place.. Now my qestion is: Will default managed=false affect further migrations and if it will than how should i make default setting managed=true? As all the models which are inbuilt like users also has managed=false which should have been true by default accoding to documentation, so is there a setting to change meta class of all inbuilt and models created by me? PS: i dont have much knowledge of all this, still learning.. chances are ive missunderstood the concept.. please help.
Mirco
Momin
Momin
Mirco
change your Django settings DATABASE to match the suer and pwd of your Postgres database
Momin
Means ho i will check my usre of my db ?