Emre
book was given in django website
I am trying get orginal documentation pdf version i could not find if you have can you send it to me?
Roman
How to get data from ajax?
Doragonsureiyā
How to get data from ajax?
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 first results
Roman
Thanks you..
منتظر
from mptt.models import MPTTModel, TreeForeignKey class Category(MPTTModel): name = models.CharField(max_length=255, db_index=True) parent = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='children') slug = models.SlugField(max_length =255, unique=True) how can I make multi level dropdown menu for the category model
𝕯aniel
Do migrate and create categories in admin panel
منتظر
U already do it. What's problem
oh sorry I mean how can I display it
منتظر
yeah
𝕯aniel
{%recursetree var %} {{node.name}} {{children}} {% endrecursetree %}
𝕯aniel
{%recursetree var %} {{node.name}} {{children}} {% endrecursetree %}
<ul class="root"> {% recursetree categories %} <li> {{ node.name }} {% if not node.is_leaf_node %} <ul class="children"> {{ children }} </ul> {% endif %} </li> {% endrecursetree %} </ul>
منتظر
ohhh than you very much
𝕯aniel
My pleasure
Garry
anyone having to update user profile ?
Garry
https://youtu.be/7DU-uhhYI6Y i tried this ..but shows error “ LookupError: No installed app with label 'admin'. “
𝕯aniel
Did u install correct ur app in settings.py?
Garry
yes INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'faculty', 'student', 'questions', ]
Garry
i have already implemented login signup module in my project … now i have to update user profile ..how can i do it ..if anybody having code and logic of it please share
William
i have already implemented login signup module in my project … now i have to update user profile ..how can i do it ..if anybody having code and logic of it please share
Create profile page and display uer info using request.user then give an option like update data. Then provide form action to the update user function in views
Garry
ok..i will try it ..ty 🤝
Артем
Hello everyone, who can help with forms?
Артем
I put my form into header, so each page have this form. My form make like this: 1. User put data. 2. Django make docx. 3. In the end it must open page with button in order to download the docx. But if i will replace function “if form.is_valid” in an other function. After complete i see the window from form have been completed. But i want to see the page with button.
Артем
Please
Артем
It is very important
Артем
So you want to display the data that the user enters into a doc file then provide download functionality?
Yes And it must work on each page, but i dont want to put function if form.is_valid in each def for all pages
William
After providing info in form fields what is happening?
Артем
Can you able to generate a doc file after some inputs?
Yes, this file save in media, and i want after successful form redirect in page where is button with downloading this file.
Артем
After providing info in form fields what is happening?
This info putting into docx and this file save in media
Артем
i have such function for each pages: def contacts(request): function(request, 'Отравлено с вкладки: контакты.') form1 = Callback() form2 = Callback_doc() return render(request, 'contacts.html', {'form1': form1, 'form2': form2}) function(): def function(request, sentence): now = datetime.datetime.now().strftime('%d-%m-%Y') form1 = Callback(request.POST) form2 = Callback_doc(request.POST) a=[] if form2.is_valid(): ................................. return render(request, 'form_res.html', {'result': 'Форма составлена не верно, попробуйте снова!'})
Артем
so in each time i see render contacts.html
Артем
but i want to see render form_res if form is valid
William
You can try like after submitting make that doc file open in new web page then give download option
William
Use javascript
Артем
no i ask how to put form.is_valid in other function?
Артем
Use javascript
in order to open other page if form valid
William
If form is valid then provide instance value inside it
William
please write the example
if form.is_valid(): a = form.cleaned_data['a'] convert_doc(a) return ...
Артем
if form.is_valid(): a = form.cleaned_data['a'] convert_doc(a) return ...
so convert_doc is another function Do you know how to put convert_doc and 'if form.is_vald' in a function in order to use small code
Артем
?
William
Refer google
yyyyyy
Anyone plz help me
yyyyyy
Using Sqlite 3 database in pycharm what should I hve to install
KrishNa
Nothing
KrishNa
In Django sqlite3 is inbuilt
KrishNa
Go to setting file and check database portion
Firdavs
Guys what is form=Customer(request.POST)
Mirco
Guys what is form=Customer(request.POST)
A form instantiation with POST data This means that it's basically a form submission by the user and the form will validate the POST data
Zaid
Is it possible to use postgresql in pythonanywhere free whitout upgrading plan
Ashri
Hii guys Please anyone send me a link to practice Django code in online otherthan in app. S now I am unable to do that ?
Rakesh
replit.com
John
Hey guys can anyone help me with this I have an image field in a serializer, I want it like this "picture_name_1": "http://127.0.0.1:8000/media/product_images/2020-08-05_2_SMMFeSM.png",
John
I'm getting the image url like this "picture_name_1": "/media/product_images/2020-08-05_2_SMMFeSM.png"
John
class ProductVarientSerializer(serializers.ModelSerializer): image = serializers.SerializerMethodField() orders = serializers.IntegerField(default=22,read_only=True,required=False) class Meta: model = Product fields = ('product_name','orders','views','image') depth = 1 def get_image(self, obj): request = self.context.get("request") image = Variants.objects.filter(product_id=obj.id).first() serialiser = Serializervariant(image, context={'request': request}).data return serialiser
John
class Serializervariant(serializers.ModelSerializer): picture_name_1 = serializers.SerializerMethodField() class Meta: model = Variants fields = ('picture_name_1',) def get_picture_name_1(self, obj): request = self.context.get('request') return obj.picture_name_1.url
Ashri
replit.com
Here Every thing we can do ? Like todoapp etc...i.e all files are installed
Rakesh
Whatever app you need you have to create on your own
Rakesh
Here Every thing we can do ? Like todoapp etc...i.e all files are installed
First of all Django is not a independent programming language to practice with some practice sets
Rakesh
It is creating projects using various features
Ashri
Ya Just few days back I have started my journey in Django. Even when I am learning machine learning also I haven't faced these types
Anonymous
I cannot optimize my site fully, what should i do?
Ashri
👐
We will discuss later if I have any doubts
Mahdi
Anonymous
Optimize for front end? Or query?
Query, requests, links with django-debug-toolbar
Piyush
What is the difference in between django and django rest framework ? Please explain
Mirco
What is the difference in between django and django rest framework ? Please explain
Django is the framework Django Rest Framework is a Django app for implementing REST APIs