how know where is the error? - django

im using a django app (django adzone), well, but im trying to add banners, and django zone tell me " please fix the errors" , but nothing more, i cant see where are the errors.
any idea how ill know ?
EDITED
There's not trace about the error or something like that, is just a django admin message
see the images
thanks

Then your best shot is to install ipdb (easy_install ipdb) then drop these lines in at the end of the is_valid method (and if not create it):
import ipdb; ipdb.set_trace()
Save your form again, then go to the router. You'll have access to a shell where you can inspect several suspects like:
self.data
self.errors

OK, i know where is the error.
There's another field named "Advertiser", but Chrome dont display this field, i dont know why. sorry i think there is not error, just a Chrome "bug".
FF,Opera, IE are showing the complete form.
Thanks

Been there, seen that!
It's not a chrome bug it's the Ad blocker blocking the input!
You can:
Deactivate the Ad blocker or rename the field (Advertise)
Cheers

Related

Adding non-CMS (Django) page to Wagtail menu

I may not be understanding something obvious, but I'm struggling to add a (top-level) menu item to my Wagtail based menu that hooks to a page rendered by an included app that doesn't know about Wagtail. Ideally, it is just a normal Django TemplateView with standard urlconf, though I may need to add some custom code.
If I use the custom URL in the menu editor, I get a not found from Wagtails core.serve. I've looked at snippets, wagtail hooks, RoutablePageMixin, and the custom URL in the menu editor and none seem like it accomplishes what I'm trying to do.
It may well be that I'm simply misunderstanding the docs, but is there a simple example of someone doing this? The closest I've found so far is https://www.caktusgroup.com/blog/2016/02/15/wagtail-2-steps-adding-pages-outside-cms/. I've also searched https://docs.wagtail.io/en/v2.4/advanced_topics/third_party_tutorials.html to now avail. Any guidance appreciated.
Thx,
--Don
Hope this is useful, but it seems that my problem was not the mixing of Wagtail and non-Wagtail items - it was in my URLConf - Wagtail.core.serve occurred before the Django url I was trying to reach and was trying to respond. Once I reordered the URLConf appropriately, I am getting the view as I wanted.
Sigh...

django on apache - admin page links are VISIBLE but not CLICKABLE

I have just deployed a django site, and upon changing the value my DEBUG variable to 'False' causes my admin page links to change from active links to simple text.
An attempt to go directly to what I know should be the URL causes a 'TemplateDoesNotExist'.
I am sure it's not a permissions issue with Apache, I feel it is something to do with my admin configuration though I have no idea what.
I figured it out. Here is a reference for anyone else who might find themselves with this problem.
I was using what must be a deprecated method of defining my Admin models - I put them all in models.py, instead of creating a separate admin.py file for each application.
When learning django, there are plenty of tutorials floating around that recommend or give examples that use this method. Apparently this is no longer a good idea (at least not as of Django 1.4). It could probably be wrangled into working with some template hacking, but it is is probably cleaner and definitely simpler to just follow the latest conventions and create the admin.py file.
I thought I was saving time by just cramming it all into one file "for now" but without some of the magical debug-only template loading, this solution failed.
Hope this saves someone some frustration!
I know this question's been already solved.
But in my case, coming from django 1.7 to a server that runs django 1.6, I had to add
admin.auto_discover()
to my urls.py.
Well, I had added this line to the end of urls.py and django admin was all characters !
Moving it to top up the file, above definition of urlpatterns, fixed the issue.
Hope this helps :)

issues with django-ckeditor : acts like regular TextField

I am trying to use the django-ckeditor in my models / forms.
However, the RichTextField or CKEditorWidget seem to work like regular
text field. This happens both on the admin site and in my own forms.
I followed the installation guide as explained here :
https://github.com/shaunsephton/django-ckeditor
I feel like there is some step I did wrong or something else I forgot
to install, because there are no error message.
Thanks for helping.
Did you remember to attach the JS to your forms as discussed? Do you see any errors at the JS console?

Deleting an object Django- code seems right but is not working?

I have been working on this for far too long, and despite all of my research cannot find out what is wrong. Admittedly, I am new to django.
I have a ticket app that uses forms to create, edit and update tickets. I'm now trying to delete them, based on the ticket_id which is a primary key.
In my view I have:
def deleteTicket(request, ticket_id):
ticket = Ticket.objects.get(pk=ticket_id)
ticket.delete.all()
redirect_to = 'project/tickets.html'
return HttpResponseRedirect(redirect_to)
In my urls.py:
(r'^(?P<project_slug>[^\.^/]+)/tickets/(?P<ticket_id>\d+)$', views.deleteTicket),
When I open a ticket and click on the link that should call this view the expected page appears but the ticket I just tried to delete is still listed. I'm not getting any errors anywhere, but this code is doing nothing. Why?
Thanks for your help! It has been driving me crazy.
I'm going to assume your indentation is correct.
Pretty sure you're just supposed to go ticket.delete() since it's an object you're deleting, not an entire queryset, you don't need the .all(). Actually, to delete multiple objects you'd write Ticket.objects.all().delete(), so the syntax you're using is just plain wrong and I'm surprised it's not throwing an exception.
Also, you shouldn't delete via GET requests, only POST.
Lastly, you should use reverse for your redirect, or at least an absolute URL.

Error on Django Form Wizard - Resets to wizard to step 0 with no data on submit

I'm using the django form wizard and its sporadically will reset the wizard to step 0 after submitting the form on the last step.
This only happens very occasionally, and there doesnt appear to be any pattern to indicate why this happens.
Can anyone suggest a possible cause or way to investigate this? Frankly i'm not sure where to start to investigate this.
thanks
check if you have any global variable that someone else, on another browser, is resetting