Breeze
i just customized the django model to fit some new feilds
Breeze
Breeze
This is my models .py https://hastebin.com/kocodezofi.py
Its_me
dคv¡d
what exactly?
I mean just dont input email and enter... But i dont expert on custom user model.. sorry
Breeze
Breeze
Breeze
Vaibhav
???
objects = MyUserManager()
This should be in your myUser model
Breeze
Breeze
Vaibhav
Django creates migration when we change manager but i haven't seen any difference even if you don't migrate
λ701
How to pass an object to a model field?
Breeze
Vaibhav
Breeze
Can you check the definition of create super user in base manager?
def create_superuser(self, first_name, last_name, phone, email, password):
user=self.create_user(
first_name=first_name,
last_name=last_name,
phone=phone,
email=self.normalize_email(email),
password=password
)
user.is_admin=True
user.is_staff=True
user.is_superuser=True
user.save(using=self._db)
return user
Vaibhav
Breeze
Vaibhav
my own code
You have overrided django create super user right, have you checked it's definition?
Breeze
Breeze
how am i to do tha?
Vaibhav
😅 depends on your editor ...
Breeze
Maxim
Visual studio
i don't think that was a question
i think it was a joke about you having to use the editor
Breeze
Well, i have resolved the issue. The answer has been there all these while. This is the side effect of coding all through the night😂
Amin
do Anyone know ? Is djangobootstrap Library useful or not
Anonymous
Hi!! Does someone have problems with "./manage.py runserver ". No changes was applied after create and save new object or register new class in admin dashboard it never start to be available from this dash if I'm don't reload the server manualy
Will be very thankful if some one give me the start-info about the way to solve this problem
Patya
Azamat
Amin
Azamat
Im using bootstrap4, it is good thing
Azamat
But better connect it with link instead of download it.
NerdDude
Hi, guys! I'm trying to make a blog in Django, never programmed in it. For some reason, data from the database is not displayed. Apparently I'm a tired and therefore I don't see a problem. Can anyone help me? Here is the code on pastebin
https://pastebin.com/spEkEfBf
Mirco
Mirco
And you need to loop over it as you are using the filter and not the get()
Or use first()
NerdDude
Mirco
Doragonsureiyā
NerdDude
Alexander
Hello!
My task is to make an openid connect (oidc) - provider and client using Django. Everything that I found I could not start (
1. I found only two clients - https://docs.authlib.org/en/stable/client/django.html
and
https://mozilla-django-oidc.readthedocs.io/en/stable/index.html
2. I tried these providers
https://github.com/juanifioren/django-oidc-provider - looks abandoned,
https://django-oauth-toolkit.readthedocs.io/en/latest/index.html - here I came across the fact that I need to implement the validate_silent_login method myself - I have little expertise in this and did not find any ready-made solutions
https://docs.authlib.org/en/latest/django/index.html - I didn't have time to parse it yet, but got stuck on his client.
I couldn't find any simple instructions.
Maybe someone knows and uses a simple and working solution?
Thank you in advance)
Abdalwhab
Hi
What is pest way to Create an invoice.
A
Can anyone tell me how to apply update/modify operation in django sqlite3 database in a project
Mohammad Shahbaz
Anonymous
Django redirect after successful login is not working in production with Nginx
Doragonsureiyā
Arav
While adding a new app in my project and I tried to do make migrations and there is an error ''ModuleNotFoundError:No module named cutomer.urls''
Anonymous
Kevin
Can i deploy using dbsql lite, its a very tiny webapp?
Dmitry
Hey there! I'm learning how permissions work and trying to give permission to my custom user model, but has_perm check is always False. I didn't override has_perm method, it was inherit from PermissionsMixin.
Here's my shell
>>> u.user_permissions.all()
<QuerySet [<Permission: records | record | Can view record>]>
>>> u.user_permissions.last().codename
'view_record'
>>> u.has_perm('records.view_record')
False
does anyone know what could be wrong?
Dmitry
I restarted shell and now it works 👍
Complex_101
I'm trying to find how to connect Facebook API to python which allows multiple users to sign in through their email and password and then the api can access their profile content and ol. How yo do that? Can anyone suggest any tutorials?
Mirco
Complex_101
Mirco
Yes
Then uso something like django-allauth to login / sign-up via Facebook
Mirco
Jugurtha
I found this in the code source :
Cache middleware. If enabled, each Django-powered page will be cached based onURL. The canonical way to enable cache middleware is to set``UpdateCacheMiddleware`` as your first piece of middleware, and``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE = [ 'django.middleware.cache.UpdateCacheMiddleware', ... 'django.middleware.cache.FetchFromCacheMiddleware' ]This is counter-intuitive, but correct: ``UpdateCacheMiddleware`` needs to runlast during the response phase, which processes middleware bottom-up;``FetchFromCacheMiddleware`` needs to run last during the request phase, whichprocesses middleware top-down.
♈
Hello guys today's Django 4.0 new version release😊😊
Doragonsureiyā
Anonymous
hi i do dockerize a django project with module psycopg2 finally the sizes going to 370~380 MB its normal ?
its possible to reduce the sizes ?
ᴀмɪʀ ♛
hi guys, im trying to use rest framework in django, I installed it also add to installed app then migrate manage dot py file, but now when i want to import rest_framework and run app the error say: no module is there with this name!
Anonymous
ᴀмɪʀ ♛
Bobosher
@LSR
Bobosher
Anonymous
Hey i m getting error table shop_blog has no column named name in Django can anyone help me
When I checked migrations column name is present but still it is showing error
Роман
Good afternoon. I have django 1.11 and local postgres. I want to write tests for which I need to use models. Tell me, what good practices are there to fill the test database with my postgres data?
Vaibhav
Vaibhav
Bobosher
Anonymous
Anonymous
Showing the same error
Abdulloh
Hi everyone!
I have a problem with russian words in API
if I use postman it's ok
but when I use browser it's returning encoded version of russian words