Luis
https://channels.readthedocs.io/en/latest/topics/channel_layers.html#using-outside-of-consumers
Luis
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
Aleksei
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
Aleksei
Aleksei
Doug
@k_aleksei13 https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.exclude
Amaro
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
Amaro
And do not forget to register your class, you did not.
Doug
can you paste the new code
Doug
@k_aleksei13
Luis
Luis
And please, paste new code with exclude list
Maz
Aleksei
https://pastebin.com/V45VX7bC
Aleksei
Aleksei
Aleksei
Aleksei
Amaro
Yes
Amaro
Below InstructorAdmin definition
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
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
Doragonsureiyā
Aleksei
Aleksei
I can send you a full error message, if you need.
Muflone
Who ever told you to register the InstructorAdmin?
Aleksei
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
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
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
Muflone
Then Google for djangogirls
Aleksei
ok))
Aleksei
I have change nothing from the last debugin by you, just restarted)))
Aleksei
triggered
Anonymous
Anyone having issues loading videos from S3?
Anonymous
HTTP load failed with status 400. Load of media resource [video_url] failed
Aleksei
Anonymous
Macurrent