garrip91
Anonymous
the value of list_display refers to is_staffdate_joined which is not callable anyone?
Anonymous
anyone?
Doragonsureiyā
anyone?
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work. Have a nice day 😊
garrip91
@pyflare Is it good idea for me: https://pastebin.com/etWdqKkG ?
garrip91
Why not ?
I'm interested in your opinion
Mirco
I'm interested in your opinion
That's the use of aggregation, so yes
Asaduzzaman
I created a middleware for app title,slogan etc( generally it comes from a model). When i developed local server it was worked. But when i deployed on my vps machine it isn’t working. Anyone idea how can i solve that issue?
Mike
Hello anobody can for few words explain whats is it rest-framework for django and why its good? thankyou
Driptamine
Yo, how to solve psycopg2.errors.InsufficientPrivilege: permission denied for table django_migrations
fn
How project tree is structured if I have 3 apps: home, login and dashboard app? Each app redirects to each other. User opens Home app, clicks sign in button and opens Login app, after successful authentication opens Dashboard app, that's it. Is it true to create app to each page?
ken
hi. an interesting scenario: (dunno even if this is recommended) Is it possible to store a queryset (not the results, the queryset itself) in some string (or as some variable) w/o making a DB call, to reuse for later. scenario is, there are multiple models that have a similar structure, and a large part of their queryset is similar and I have a common python function for db query (DRY ?).
Bunty chhatri wala..
Hey.. I want to filter a query based on search by another user. eg: a user can search another users posts. search = request.POST['search'] query= Post.objects.filter( status= 'published' , user= search) But it is showing an error.. *Invalid literal for int() with base 10: 'rishabh'* Here user is a foreign key.
Rohan
I am guessing user column in Post table is id ref to user id and User table has name field
Krishna
when I'm trying to do Debug=False my admin site css and js not rendering in browsers developer mode it's showing error of mimetype [" Refused to apply style from 'https://site.com/static/admin/css/nav_sidebar.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. "], I added " mimetypes.types_map['.css'] = 'text/css' " but its not working
Sopan
Hello anobody can for few words explain whats is it rest-framework for django and why its good? thankyou
The site says: ------ Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: • The Web browsable API is a huge usability win for your developers. • Authentication policies including packages for OAuth1a and OAuth2. • Serialization that supports both ORM and non-ORM data sources. • Customizable all the way down - just use regular function-based views if you don't need the more powerful features. • Extensive documentation, and great community support. • Used and trusted by internationally recognised companies including Mozilla, Red Hat, Heroku, and Eventbrite. --------- and if you implement rightly, then you may get paid (..like us)
ARBAAB
hello everyone... can anyone help me with how to create custom message in django
Doragonsureiyā
hello everyone... can anyone help me with how to create custom message in django
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Shubham
Do anybody have an idea about implementating Paytym payment integration in DRF for multivendor system, where customer/client can pay for the service directly?
Bunty chhatri wala..
Sopan
You need a mentor to guide you - what and where to go from here!
Akash
Cookies persist on Staging environment but not on localhost ! (react-FE, django-BE) Both have path set to / Stuck debugging the issue since yesterday, any help is appreciated !
IND_
hey guys any good resources to learn django 3.x
Doragonsureiyā
hey guys any good resources to learn django 3.x
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Im trying to create a school management system but I dont know how to create different users Student, Teacher, Admin, how to proceed with the models
Mirco
Im trying to create a school management system but I dont know how to create different users Student, Teacher, Admin, how to proceed with the models
https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html
Akash
If i have added CSRF token to middleware and have certain POST request where I want to verify for CSRF, do I need to add decorator for that view ?
Driptamine
why do we always have to type these commands: python manage.py migrate admin zero python manage.py migrate auth zero python manage.py migrate contenttypes zero python manage.py migrate sessions zero
cj
and I don't see a reason to run those commands tho 🤔
Driptamine
I'm always noticing this irritating migration issues
Driptamine
To undo migrations to the first state
is that have to be part of developing starting project tho?
Driptamine
really frustrating
Akash
I'm always noticing this irritating migration issues
You might encounter these command when you mess up with existing database data/schema. Then we run in order basically rebuild our database scheme
Dennoh
is that have to be part of developing starting project tho?
Depends on what you are doing Why do you always migrate to zero?
cj
is that have to be part of developing starting project tho?
no, as I told you, in 12 years using Django, I never run those commands, and I don't see a valid reason to run them either
cj
as those are django-core migrations, you shouldn't worry about them
Driptamine
because after typing: django-admin startproject project_name . and python manage.py startapp app_name I'm getting this error: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency accounts.0001_initial on database 'default'.
cj
if you really HAVE TO run those, you're doing something wrong or you broke something
Driptamine
but whats wrong with 2 basic commands?
cj
nothing wrong, it looks like you did something wrong or you're trying to use some out-dated package or something like that
Doragonsureiyā
because after typing: django-admin startproject project_name . and python manage.py startapp app_name I'm getting this error: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency accounts.0001_initial on database 'default'.
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
cj
I also find the first command to be wrong, append .
the first command is not wrong actually
cj
neither the second one
cj
and to create and app just run django-admin startapp app_name
using ./manage.py startapp foobar is totally valid too
Dennoh
the first command is not wrong actually
yes, it's not wrong but he isn't cd into the dir with manage.py
cj
I think you need go inside into project and create app
running manage,py outside project folder would throw a different error than the one he showed
Pratik
django-admin startproject demo then cd demo then python manage.py startapp demoapp try this
cj
the problem is not in the commands he used to create the project and the app
cj
the problem he has on the migrations is caused by something else —he didn't explain yet—
cj
not by the commands he's running to create project/apps ... come one guys! open your eyes
Dennoh
😂😂😂
cj
he doesn't have problems creating a project neither an app
Driptamine
exactly
cj
he has problems with migrations, which is caused most probably because he's using some old/unmaintained package or he's doing something else with some other apps he already has in his project... which he didn't explain yet —and I don't know if he will—
Driptamine
there is a 3rd command you run that you aint' saying
yeah, sorry: python manage.py makemigrations accounts python manage.py migrate
cj
see? 🤷🏻‍♂️ he's not telling all the info, that's why it's hard to help him
Driptamine
didn't wanna flood😝😝😝
cj
didn't wanna flood😝😝😝
if you want to get help, you should explain EVERYTHING... people don't read minds here