Anonymous
using abstract user model?
Anonymous
If so, you should create manager.
Arshiya
If so, you should create manager.
So how? What should i write in that?
Anonymous
I think User model is not working now.
Anonymous
Can you show me User model code?
Arshiya
I think User model is not working now.
It works well in admin panel and there is not any problem. Also i can create new users from admin panel. The problem is in createview
Arshiya
Can you show me User model code?
from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): last_updated = models.DateTimeField(auto_now=True) image = models.ImageField(default='profile_pics/default.jpg', upload_to='profile_pics/', null=False) admin = models.BooleanField(default=False) def str(self): return self.username def is_admin(self): if self.admin: return True else: return False
Anonymous
from apps.users.managers import UserManager
Anonymous
objects = UserManager()
Anonymous
You should add this code in custom User model.
Anonymous
And you should create a User manager.
Arshiya
Arshiya
And you should create a User manager.
I think i did that and didnt work I will Try again
Stormy
I think i did that and didnt work I will Try again
Have you add this line in setting.py AUTH_USER_MODEL = "app.User"
Arshiya
from apps.users.managers import UserManager
Cant find correct path. What is it?
Anonymous
Cant find correct path. What is it?
https://testdriven.io/blog/django-custom-user-model/
Anonymous
You can reference this.
Arshiya
objects = UserManager()
I did this again Same problem
Divyesh
In Django how we implement notification, anyone know about this please help me out
Artyom
u cannot, Django won't start
I left only default setting with engine defined and later added other params (user, pass, ip etc), after that I called connections.close_all() and django.setup() and somehow it works 😃
Mirco
😅 agree
So not a real valid solution
Anonymous
thnks what should i change or add !
Depending on what you're working on
DeathLikeSilence
Depending on what you're working on
I have a class called register. the user puts the information(fill out the form and that for is email, phone number, full name, and password) all of them were put into session after that, I have another class called verifyOTPcode. I get the session in this class by this code: " request.session.get("mysessionName") and I have a if condition that checks OTP code is correct or no if it was corretct, that information put in Table and if it eas incorrect we received an error now in the first class, csrftooe and sessionid were created, and when I want to recieve sessionid and use it, another session will created, and can not get that sessionid had been created in the first class My project is with React and DRF I would be grateful if you can help me
Arshiya
Hi guys I create an object with CreateView I want send an other object as extra data to the page that user redirected to. What should i do?
Professional
I am getting page not found 404
Professional
While doing views and URLs
Professional
Can any one help me with this
Anonymous
Can any one help me with this
Send the code to see
Professional
Hi guys
Professional
I stucked with the error can any one help me
Mirco
I stucked with the error can any one help me
We don't have magic ball, explain better
Mirco
Hi guys
Don't write me in pm
Balde
Good evening, every time I try to send my project to Github, I get this error: Total 12282 (delta 2528), reused 9043 (delta 2509), pack-reused 0 error: RPC failed; HTTP 400 curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 😍 send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly Everything up-to-date . .... .please help me
Balde
this is in relation to the deployment of a django project
Balde
Yes but no django involved
Yes, how do you make for deploy your project
Charly
Yes, how do you make for deploy your project
Thats irrelvant. Can you just follow the rules and ask in an appropiate place?
Balde
Okay thanks
Nani
Bro I have small
Nani
Doubt can I ask?
Nani
Is there any opportunities for freshers on django?
Nani
Why because I have very good knowledge on django as a fresher level..
iam
so my issue was as a beginner i was not aware that i can't use NoSql well with django but still after some research i found articles about djongo and pymongo, even though it was installed some how with errors it just uninstalls versions of django let's say i want to stick with 4.2 LTS it removes it and installed 4.1 and breaks the projects for me and i decided to revert back to postgresql and my reason to use mongodb is that i am building blog site and will be having constant changes.
iam
any advice or idea given to me use NoSql or just idea's I should have in my blog will be helpful.
Devendra
Hey bros I using tailwind css in django LMS project is it necessary to configure static and templates files in settings.py by the way I using css in app folder and inheritce base template from project level
Maxim
Is there any opportunities for freshers on django?
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so delete your question here and move to the @PythonOfftopic group and ask there.
iam
You should not use Django with NoSQL and the blog case makes no sense.
Blog case bcz i was making changes to models frequently
Charly
And I doubt you need that for a blog
Charly
A database schema for a blog is super simple
iam
And? Migrations exist
Yeah i kind of got but i just in my mind that mongo will be better
iam
A database schema for a blog is super simple
yeah now that it's working in sticking with postgresql
Anurag K
How to do image crop in django website
iam
How to do image crop in django website
pillow with cropper.js according to my research, but i have no context for your how to.
Hosein
hi guys, I have been given a task for a startup as a support ticket, do you know a good GitHub project to introduce to me.
Hosein
What are you talking about?
i want implement support ticket system
Charly
i want implement support ticket system
So youneed to think about it instead of just get oneproject. Thats point of prograaming.
Charly
If not just use a premade one.
clouded
i know, but i want get some idea about that
We keep the focus rather technical in this group.
clouded
I bet there are sufficient options to chose from existing systems to get ideas.
Maxim
@dentverdostup offtopic read only 48 hours
Shazad
Hello I have a doubt is urlsafe_base64_encode and decode packages work in django 4
Артем
Hi, why does Traceback print in my log file? I use logging Help me please Code in settings: LOGLEVEL = os.environ.get('LOGLEVEL').upper() LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '{levelname} {asctime} {process:d} {message}', 'style': '{', }, }, 'handlers': { 'newfile': { 'level': 'INFO', 'class': 'logging.FileHandler', 'filename': 'logs/general.log', 'formatter': 'verbose' }, }, 'loggers': { "": { 'level': 'INFO', 'handlers': ['newfile'], 'propagate': True, }, }, }
clouded
yes
Where should they go instead?
Артем
Where should they go instead?
i dont need traceback in log How to switch off it?