devops
Just learn the basics and build a crud u would understand a lot of things there only
devops
And install pycharm first it would be easy for u Anusha
Anonymous
Can anyone tell me, what condition I should use to get data of current user in template. In CRUD application.? I am using {℅if request.user == user℅} but it's not working.. Plz help me
Anonymous
Anonymous
It's returning the address
devops
First u have to find the particular user data from database
devops
And then frontend u have to store it a variable and use it
Anonymous
devops
First hit api in postman
devops
And check
devops
What's isssue
Anonymous
👍
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
{% load static %} not staticfiles
Ghorz
Ghorz
In django 3, use {% static %}
Муродали
hi guys
i have an error that
LEXERS = [item for i in get_all_lexers() if item[1]]
TypeError: 'module' object is not subscriptable
what is it?
Philip
may be this https://stackoverflow.com/questions/43147823/typeerror-module-object-is-not-subscriptable
Муродали
Philip
I have a question: How can I in Dockerfile do this: COPY ./docker/nginx/nginx.conf ?
Philip
Муродали
Pastebin your code
import item as item
from django.db import models
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
# Create your models here.
LEXERS = [item for i in get_all_lexers() if item[1]]
LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in LEXERS])
STYLE_CHOICES = sorted([(item, item) for item in get_all_styles()])
class Snippet(models.Model):
created = models.DateField(auto_now_add=True)
title = models.CharField(max_length=100, blank=True, default='')
code = models.TextField()
linenos = models.BooleanField(default=False)
language = models.CharField(choices=LANGUAGE_CHOICES, default='python', max_length=100)
style = models.CharField(choices=STYLE_CHOICES, default='friendly', max_length=100)
class Meta:
ordering = ['created']
Муродали
when i wrote py manage.py makemigrations, i got this error that
LEXERS = [item[i] for i in get_all_lexers() if item]
TypeError: 'module' object is not subscriptable
Philip
you use a module name as a variable
Philip
this is obviously wrong
Philip
comment line 1
Philip
or change
Муродали
comment line 1
if commented item :
NameError: name 'item' is not defined
Philip
you must write: from Something import item
Philip
Something is name of your module
Philip
e.g.: from items import Item
Philip
in your code now item is name of module, not an entity
Муродали
Philip
show your item module structure
Philip
https://stackoverflow.com/questions/57475793/django-rest-framework-serialization-tutorial-confused
Philip
write this: LEXERS = [item for item in get_all_lexers() if item[1]]
Philip
syntax error
Philip
remove line 1
Philip
and repeat list comprehensions in python 😜
Муродали
ok thanks bro
Муродали
👍👍
Philip
I have a question: How can I in Dockerfile do this: COPY ./docker/nginx/nginx.conf ?
Philip
COPY nested files not work, I guess
Ghorz
Ghorz
Nonverbis
I'm a specialist in internet marketing. I'd like to join a project. Any project of grown up people (who think of future popularity of this project, making money on it etc.). My role in this project will be consultative. For you it will be free of charge. What my role is about: AMP, structured data, speed of loading etc. For example, I may tell you: the site is slow, let's discuss how to speed it up. And you'll implement what we planned. I participate for learning purpose. If anybody is interested, please, write me a private message.
Anonymous
thanks a lot
Anonymous
sometimes when copy & paste, it will messed up indentation. Fix that and you're good to go. As the error message instruct... check line 87 (sometimes the error also comes from the previous line, so check line 86 too)
Wang
hi everyone
i want to generate radio type form pass ModelForm
anyone has tutorials about it
Wang
<input name="choice" type="radio" value="4" id="choice4">
<label for=choice4>rains</label>
<input name="choice" type="radio" value="5" id="choice5">
<label for=choice5>summer</label>
Wang
it is the form
Wang
it is the template
Wang
{% for choice in choices %}
<input name="choice" type="radio" value="{{ choice.pk }}" id="choice{{ choice.pk }}">
<label for=choice{{ choice.pk }}>{{ choice.choice_text }}</label>
{% endfor %}
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
Wang
the form by hard code, i want to use ModelForm
Wang
https://docs.djangoproject.com/en/3.0/intro/tutorial04/
Wang
the first form in this page by hard code,
i want to use ModelForm rewrite it ,
Wang
but i am newbe.....
Wang
Anonymous
Hi! Someone asked where to order ChatBots for Telegram. The guys did it to me. The result is awesome. Who needs contacts I will answer in messages. So that there is no spam
Abhishek
Is there any one who can help me while playing with GitHub account. It's looking difficult to use by me.
Can't understand how and what to do in it.
Abhishek
Tushar
i use if request.method == 'post' to save some data in db so when i click on submit no data save in db and if i remove this line so blank object create in db.
Tushar
https://pastebin.com/Lrrei0fK
Anonymous
Hi guys.I am working on CRUD application. But I am facing some errors. I am submitting some data through user_1 but all users can read this data. I want to prevent all user's data for each other. For that I am using following condition in my read template.
{℅if request. user == user℅}
But it's not working. Can anyone plz tell me what condition I should use. My project is pending just because of this issue
Doragonsureiyā
Mohit
How wsgi Server in Django handles multiple requests ?
Sai
Any way to get token without password in django using third party library oauth2 -provider?
Sai
Anonymous
Sai
Where you are storing these data and how you identify the data of specific user
Anonymous
https://del.dog/acelonayro.txt
Sai
Anonymous
It's a default tag for current user
Sai
While querying can you try this
Sai
Like filtering and get those user dsya