SomeBody
"IndentationError: expected an indented block after 'if' statement on line" What is this error in Django? Translates to base file base.py
عبد الله
Maxim
"IndentationError: expected an indented block after 'if' statement on line" What is this error in Django? Translates to base file base.py
it seems like you should get better informed about Python syntax incorrect indent if ...: ... proper indent if ...: ...
عبد الله
Maxim
but this error in base class Django
show the code to share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
SomeBody
https://linkode.org/#tWWBbcUe3YDveYfSB2rwC4
SomeBody
oh, soryy
SomeBody
https://linkode.org/#tWWBbcUe3YDveYfSB2rwC4
the interpreter complains about this line
Maxim
https://linkode.org/#tWWBbcUe3YDveYfSB2rwC4
this is not the code where this error occurred
Viji
Inside form
If you call both model and serializer in your viewset it will give when you give get request
SomeBody
this is not the code where this error occurred
if I give you all list my errors in console, this is help?
SomeBody
https://linkode.org/#JWyiXz7xxJS5LpgeuOkBh7
Maxim
if I give you all list my errors in console, this is help?
D:\Python\lib\site-packages\django\db\models\fields\related.py at least lines 818-819
anuprash
How to send mail in django using Amazon ses
Doragonsureiyā
How to send mail in django using Amazon ses
These single steps will help you a lot: 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
Harsh
Hello i am full stack developer , I am working on a project where i need to create an amazing admin panel using react js that easy 😂 but Suppose we have diff diff model and we can create api using model view set for list create and delete ..... So I want to achieve is i just wrote some ,5-10 line of code to create diff type api for a single model that done And i have also created a function in react which will do each and everything like call list api while opening the page and it will load data table for me Things are working fine Now i also want the dynamic columns for that table So i want the model and type of each and every filed dynamically so font end backend work together I found we can use forms.form but I can not find a way to convert that form object class to json I have tried django-remote-form but that doesn't work
Harsh
Basically i want is .. i have a model and i have some apis for that model .. and a new api or anything that will tell like this field is Image or char or int or etc ...
Anton
Hi there! I have question about how to setup vscode to make indent in right way https://www.reddit.com/r/django/comments/u26qob/django_template_indent_in_vscode/ I have: <head> {% if title %} <title>Django Blog - {{ title }}</title> {% else %} <title>Django Blog</title> {% endif %} </head> But I want: <head> {% if title %} <title>Django Blog - {{ title }}</title> {% else %} <title>Django Blog</title> {% endif %} </head>
Jerome
I know this method , but dont know how to use it in serializers.serialize('json',querysetthemodel_with_choicefield')
I'm doing something similar, & i use DjangoRest because it fits perfectly with django, here some snippets you may be find helpful (app is a quiz) https://dpaste.org/pn9K2
Jerome
Json is handled in the same fashion for both Python& JS, dictionaries for python to json & json parsing to JS objects
Anish
Is there a way to open a desktop application(eg: Notepad or Putty) from the click of a button from my website.
Doragonsureiyā
Is there a way to open a desktop application(eg: Notepad or Putty) from the click of a button from my website.
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
ㅤ
I want to just add a view function to django admin panel I used this way but I will to say that, show in django nothing, I create a class in administration.py and inherited from AdminSite and I just add a function for change a form field And put new admin_site to urls.py How can I do that? https://stackoverflow.com/questions/35875454/django-admin-extending-admin-with-custom-views https://stackoverflow.com/a/8467248/13962648
Hasan
Is it the right way to send cookies from the front end to the back end and do the authentication in the back end? Or do we have to put the access token in the header when requesting?
Kunal..
How to setup payment gateway in django? Can anybody help with any good blog or video available
silvio
Hi my name is Silvio,I'm Sicilian, I have knowledge python about Data Science , OOP, streamlit and today I start learn Django with a book for create a good web application.👍
silvio
What means kiram?
Ashish
Hello everyone i am creating one login api in drf for generting token, till date i have use default token base auth, but now i need to check another table if user exist in this table if exist then login else.
Ashish
Hello everyone i am creating one login api in drf for generting token, till date i have use default token base auth, but now i need to check another table if user exist in this table if exist then login else.
class Team(BaseModel): name = models.CharField(max_length=30) Logo = models.ImageField(upload_to=team_directory_path, null=True, blank=True) managers = models.ManyToManyField(settings.AUTH_USER_MODEL, blank=True) city = models.ForeignKey(City, models.CASCADE, verbose_name='City') def str(self): return self.name
Ashish
this is another where check user exist or not
Ashish
please help me out.
Ruchit
Choices inside Django filters are not updating in the template, anybody have a solution?
Vikas
How i learn drg
Vikas
Drf
Vikas
Django
Eng.
How i learn drg
https://codewithmosh.com/p/the-ultimate-django-part2
Eng.
How i learn drg
Or read the docs
Suraj
From a beginner's point of view , where should I deploy my django app ....On GitHub or on Heroku? Which is the easiest and fastest
Freelancer
Anyone, please guide me about test cases 🥲
Егор
From anywhere.
Алекс
how to get KWARS from URL, django LISTVIEW
Suraj
From anywhere.
How about Digital Ocean or if you can suggest anything else
Егор
If you want it to be deployed you need to learn about uwsgi+nginx or something.
Ruchit
If you want a guide on How to Deploy on AWS follow this https://wolfx.io/how-to-upload-django-app-on-aws
Ruchit
they have a free tier for 1 year
Егор
how to get KWARS from URL, django LISTVIEW
How about reading official documentation first? https://docs.djangoproject.com/en/4.0/topics/http/urls/
Ruchit
Same procedure in DO
Егор
For Digital Ocean?
For whatever.
Ruchit
DO have $100 free limit for 2 months i believe
Егор
how to get in ListView
Same, man. You just pass arguments with <pk:value> and use them.
Алекс
request.query_string?
Phansivang
guys please help me I know about django backend but now i want to know what good languages for frontend ? (no html or css i don't like)
cj
guys please help me I know about django backend but now i want to know what good languages for frontend ? (no html or css i don't like)
the only "languages" available for front-end are HTML, CSS and JS ¯\_(ツ)_/¯ you have no choice
Д
maybe he wants something like wordpress
cj
maybe he wants something like wordpress
still it uses HTML, CSS and JS for frontend ¯\_(ツ)_/¯
Hossein
guys please help me I know about django backend but now i want to know what good languages for frontend ? (no html or css i don't like)
css and html are not languages and they're the only tools available for having a frontend. u will need js as well for some parts of it but is not needed
Phansivang
Thanks you guys so much ❤️
Phansivang
Now I learn react js
Maram
Good evening I recently start learning django, when I try to put my template in the view’s app it doesn’t display knowing that I did exactly what the owner of the video I am learning from did but I don't know what happened with me
Maram
does anyone have any idea,please!
Doragonsureiyā
Good evening I recently start learning django, when I try to put my template in the view’s app it doesn’t display knowing that I did exactly what the owner of the video I am learning from did but I don't know what happened with me
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Bazaroph
Good evening, by the way I'm trying to retrieve data sent to me by the frontend without saving them. How to do it with django DRF? Serializer without model.