Luis
https://channels.readthedocs.io/en/latest/topics/channel_layers.html#using-outside-of-consumers
Aleksei
Hello, I need help in customizing my admin panel. I want to exclude some fields, for example exclude = (‘surname’), but nothing happens after saving and restarting Dev server. Can someone tell me what is the problem might be ?
Doug
@k_aleksei13 can you post what you've done so far
Aleksei
I didn’t you class meta)
Aleksei
Should I use it ?
Luis
Should I use it ?
NO, just add exclude = ('field1', 'field2', 'etc') to your InstructorAdmin class
Luis
Look https://pastebin.com/3UNKWTnF
I can't find the exclude variable here...
Doug
@k_aleksei13 https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.exclude
Maz
Should I use it ?
@ Luis Lopez, isn't it advisable to include metas? What's your take on this?
Doug
for the admin.ModelAdmin you need to add the exclude there
Aleksei
exclude = ('surname',) Do not forget the comma...
I have already done it, but nothing(didn't change my paste)
Amaro
And do not forget to register your class, you did not.
Doug
can you paste the new code
Doug
@k_aleksei13
Luis
@ Luis Lopez, isn't it advisable to include metas? What's your take on this?
If you add exclude under meta class it'll be ignored... do not do these!
Luis
And please, paste new code with exclude list
Aleksei
https://pastebin.com/V45VX7bC
Muflone
https://pastebin.com/V45VX7bC
You have to register the InstructorAdmin class too, next to the Instructor class
Amaro
registered
No, you did not.
Aleksei
You have to register the InstructorAdmin class too, next to the Instructor class
Like this ? : admin.site.register(Instructor, InstructorAdmin)
Amaro
Yes
Amaro
Below InstructorAdmin definition
Aleksei
Below InstructorAdmin definition
I add this, and again, it doesn’t help me PS. Paste upgraded.
Aleksei
Got an exception
Aleksei
AlreadyRegistered('The model %s is already registered' % model.name) django.contrib.admin.sites.AlreadyRegistered: The model Instructor is already registered
Muflone
Try to guess
Aleksei
The model is already registered?😄
Muflone
No one told you to register Instructor twice
Aleksei
but another one error: MediaDefiningClass' object is not iterable
Aleksei
Sorry for stupidity...
Aleksei
but it doesn't help...
Muflone
It should tell you what code is giving you errors
Aleksei
File "D:\repos\Python\DjangoProject\instructors\admin.py", line 9, in <module> admin.site.register(InstructorAdmin) File "D:\repos\Python\DjangoProject\venv\lib\site-packages\django\contrib\admin\sites.py", line 102, in register for model in model_or_iterable: TypeError: 'MediaDefiningClass' object is not iterable
Aleksei
I can send you a full error message, if you need.
Muflone
Who ever told you to register the InstructorAdmin?
Muflone
I wrote, NEXT to the Instructor class
Muflone
You still lack the basic information about Django. It's time to pick a basic tutorial about how Django admin works
Aleksei
change it, but still the same
Muflone
Stop, we cannot hang in every line of your code, just because you cannot register a simple model.
Muflone
You had 4 issues in just 1 line of code
Aleksei
You still lack the basic information about Django. It's time to pick a basic tutorial about how Django admin works
I am learning this right now, but the teacher wrote this code, and it doesn't work for me(maybe another version of django)
Muflone
1) InstructorAdmin not registered 2) Instructor model registered twice 3) InstructorAdmin registered like it was a model
Muflone
Pick a Django tutorial
Muflone
I'd be happy to give you help but cannot debug your code many times just because you don't know how to register the models, this is pretty basic information, the first you have to learn
Muflone
Mozilla developer network has a good and simple tutorial
Muflone
It would require just 1 hour to learn from there, not by tries
Aleksei
thank for you helping.
Muflone
Also djangogirls has good tutorials
Aleksei
so i need to register my InstructorAdmin like what?
Muflone
register(model, modeladmin)
Anonymous
thank for you helping.
https://code.djangoproject.com/wiki/ProfilingDjango#no1
Anonymous
Read tutorials in django this is the best .
Aleksei
I am googling for 2 hours and nothing, seems like smth really stupid thing bothers me...
Muflone
Then Google for djangogirls
Aleksei
ok))
Aleksei
Google for Django tutorial mozilla
I found the problem, just bug with PowerShell and PyCharm. I reset it, and it works...
Aleksei
I have change nothing from the last debugin by you, just restarted)))
Aleksei
triggered
Anonymous
I found the problem, just bug with PowerShell and PyCharm. I reset it, and it works...
yes i know what you feel, yesterday even though i already checked out to my git branch i cant push my code when i run git push. turn out its bug from debian because after i reset my pc i can push my code to master even without checking out to my branch and it work without any problem.
Anonymous
Anyone having issues loading videos from S3?
Anonymous
HTTP load failed with status 400. Load of media resource [video_url] failed
Anonymous
that's really awful...
yeah its fruitasting
Macurrent
Login and keep password remember
Am having trouble getting the command to use to log in in postgre.. Any help??
Macurrent