python - Django 1.7 is dumping all print statements at server start but nothing when the application runs -


I'm having some problems that are wrong here. I am trying to set up logging for my Django project, but as soon as I start ./change.py runerver , all the debug messages are sent as soon as possible. Nothing happens when navigating

I have tried to isolate the logging problem by setting it in a very simple app. same problem.

So I have also tried a very basic print statement, and I see the same behavior ...

This is my views.py :

  render django.shortcuts import django.views.generic.edit import CreateView, UpdateView, DeleteView of Django from django.views.generic Import ListView. Corner. Import from reverse_labies import from ArlSolarServices. Models Import Architect # Make your thoughts here Class ArchitectList (ListView): print ( "Architect list ') model = architect TEMPLATE_NAME =' backend / architects.html 'class ArchitectCreate (CreateView): make print (" architect View) model = architect TEMPLATE_NAME =' backend / architect_form. html 'success_url = reverse_lazy (' backend: architects ') fields = [' name '] class ArchitectUpdate (UpdateView): print ( "update architect view) model = architect TEMPLATE_NAME =' backend / architect_form.html 'success_url = reverse_lazy (' Backend: Architect ') Fields = [' name '] Category ArchitectDelete (DeleteView): Print (' Architecture And visual removal ') model = architect TEMPLATE_NAME =' backend / architect_confirm_delete.html 'success_url = reverse_lazy (' backend: Architects')   

That's what I see when I Django dev server Start:

  $ ./manage.py remove runserver architect Companies in the architect scene update architect visual architect scene architect list architect view update Create architect scene delete architects visualization systems Czech performance. S .. Em check no problem (0 shutdown) 08 October 2014 - 13:49:03 Django version 1.7, using the settings 'turigo.settings', start the development server at http://127.0.0.1:8000/ control c Exit the server with   

All print statements are left here ... OK but now when I navigate the website to different views Nothing happens ...

  [08 / Oct / 2014 13:51:40] "GET / admin / architect / add / HTTP / 1.1" 200 10643 [08 / Oct 2014 13:51:43] "Receive / Administrator / Architect / HTTP / 1.1 "200 10 56   

Any ideas? Thanks

In Python, anything defined at the class level is always executed when the file is imported for the first time. is. (It prints statements as more and more assignments such as model = architect : jobs are only executable statements).

The parchment reveals that you need to move them when the methods are called the degeneration then the statement in the way of running: Because you do not have any, you can use the base dispatch. > can also override the original method are:

  class ArchitectList (ListView) def dispatch (self, * args, ** kwargs): print (the "architect list ') return super (ArchitectList , Self) .dispatch (* args, ** kwargs)    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -