Django Admin ERR_QUIC_PROTOCOL_ERROR - python

Django Admin list view page for a single model returns a blank page. it only load some of the buttons. console shows this error Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR. Have been trying somethings but couldn't solve this one. Also it doesn't happen on local machine. I am using django jet. tried using the vanilla django admin but still the same error. Other than this model all the other model's list view page is working fine.
If anyone has faced this error in the past or know anything about it, suggest me some fixes. any help would be appreciated. Thanks

Related

Django Admin behaves weirdly

I have this Django app running perfectly but sometimes Django Admin works oddly, because If I click on any model, instead of taking me to the list of registries in that model, It takes me to the same model list but with a weird css.
Here is the picture of the normal model list
Here is the picture after clicking any model
I can't add information to models or anything.
I had the same issue a few days ago. What solved the problem for me was re-collecting the statics:
(env)$python manage.py collectstatic
and then force relad (ctrl + F5) the django admin site.

Heroku Django Admin returns 'FileNotFoundError at /admin/projects/project/add/'?

I am trying to setup a Django admin page to be able to update my project portfolio directly. Everything works fine until I click on the 'add project' button. Then I'm hit with an error:
I do not understand what it is looking for. Any insight would be helpful as I've tried searching google/stack and haven't found a similar issue with a solution. If you need more information, let me know and I'll update my question.
I think the problem is in the file path on your django models. try changing the
models.FilePathField(path='#fullpathtoyourphotosdirectory')

django-tinymce to work on all textareas in django admin

I have been trying to get tiny mce to work for my django admin site on all textareas without having to add each field's widget. I have a lot of forms and would like this to work as "automagically" as possible.
I have installed tiny mce using the "pip install django-tinymce" method.
I have followed the following article and even though it does not throw any errors in firebug or developer mode I cannot see what I am doing wrong.
https://blog.bixly.com/django-tinymce-in-djangos-admin-app
I have followed this to a the letter with no luck at all. Any thoughts or suggestions to get this working on all textareas would be greatly appreciated.
Thanks,
jAC
I was able to get this to work by using admin.py's ModelAdmin classes.
For example:
#admin.register(HomePageSlider)
class HomePageSliderAdmin(admin.ModelAdmin):
class Media:
js = ( '/static/assets/js/tiny_mce/tiny_mce.js' , '/static/assets/js/tiny_mce/textareas.js' )
The first part is for the tinymce location and the second is loading the configuration that i threw in a textareas.js file.

Django: How to debug this admin bug? Form not rendered

I am facing a very strange problem. I have a Django project which runs fine in four environments (development, testing, staging and production), besides one strange bug.
In the production environment, the change form for a single model isn't rendered anymore. The rendered html page only contains the csrf token and then the submit buttons. All other change forms for other models are rendered just fine.
The result looks like this:
I am running the same code based (same commit and branch) on an identical staging server, and everything looks fine.
What could cause the faulty rendering of the form? How can I further debug it?
This is what I tried so far:
I switched back to a commit where I was absolutely sure that the admin change form worked. Form still not rendered.
I compared the pip packages between the Staging and Production. Both are identical (Django 1.7.1)
I checked the log files on the dev server. No Django error found.
I am running out of ideas how to debug this issue. Any suggestions?
Update March 23rd
It turns out that setting DEBUG=True, let's Django rendering the form. If DEBUG=True, the form rendering is failing silently. Why is that?
idea 1:DEBUG=False- static files are not handled by django but nginx /apache does
idea 2:Compare settings.py and url.py (mostly there r changes between staging/prod env's)
idea 3:For debugging run django stand-alone (runserver) without apache/fcgi

how to make django comment model field Site not required

I'm using django-threadedcomments from ericflo on github. This app simply extends the native django comments framework. I am running into the same issue with both frameworks. I continue to get an error relating to mysql that site_id cannot be null. I have no use for the Site field in my comments. I tried to extend the Comment model with my own making site both blank and null but I am still getting the same error. What is the proper way to override that requirement? Thanks
I tried:
class Comment(Comment):
site=models.ForeignKey(Site,null=True,blank=True)
I found it easier to just define one Site object. django-threadedcomments is not the only extension which requires that.
You will not be able to change this without monkey-patching the current model, but it shouldn't be a big deal setting the site field to Site.objects.get_current() in the view/form when saving a comment!

Categories