These are chat archives for django/django

20th
Apr 2016
sumit sinha
@sumitsinha91
Apr 20 2016 11:56
can anyone help me for unittest related tutorial or documnts
Affan Sadiq
@affansadiq
Apr 20 2016 12:11
hey is there anyone who can help me i want to get advice from someone who is using django often/regularly
Tom Christie
@tomchristie
Apr 20 2016 12:12
@affansadiq @sumitsinha91 - Best to just go ahead and ask the question itself.
More likely to get a response that way.
Affan Sadiq
@affansadiq
Apr 20 2016 12:13
okay thanks
So basically what i want to know is ..would someone recommend using python django + cubes (for OLAP ) ?
Furthermore i want to use reactJS
Tom Christie
@tomchristie
Apr 20 2016 12:16
Django’s perfectly capable as an API backend to a React JS frontend, yes.
Affan Sadiq
@affansadiq
Apr 20 2016 12:16
Awesome im new to python
Tom Christie
@tomchristie
Apr 20 2016 12:16
Typically you’d be using eg Django REST framework as well to help with some API stuff.
There’s a fair amount to learn tho if you’re putting all those different things together.
Usually best to try to start of with just one or two different parts.
Affan Sadiq
@affansadiq
Apr 20 2016 12:20
Okay thanks
:)
Tom Christie
@tomchristie
Apr 20 2016 12:21
Welcome.
sumit sinha
@sumitsinha91
Apr 20 2016 12:21
please help me on unittest
i also want to know more about unit test
i am new on python
Tim Leguijt
@tleguijt
Apr 20 2016 13:05
if you're new to python; there are plenty of perfect tutorials online to get you started
if you want to know more about unit testing with Django; https://docs.djangoproject.com/en/1.9/topics/testing/
Vasily Alexandrov
@the-neuro
Apr 20 2016 13:18
Hi everyone! I strongly need your advice. I want to make Django a frontend for ETL scripts and due to large execution time (15+ minutes) make a progress bar to show script status. What is the best way (module, built function) to do it the correct way?
Filip Figiel
@megapctr
Apr 20 2016 14:39
Probably celery for running the script separately from the server
Affan Sadiq
@affansadiq
Apr 20 2016 16:27
If i want to develop a single web app should i use django or flask?
Tom Christie
@tomchristie
Apr 20 2016 16:30
Both are good options. Flask is less opinionated, Django comes with more built-in behavior. Give both a quick try (eg the Django tutorial) and see which you’re more comfortable with.
Affan Sadiq
@affansadiq
Apr 20 2016 16:30
any django tutorial ?
Alex Kahn
@alexkahn
Apr 20 2016 17:10
Hey folks, upgrading to 1.9 and my templatetag tests are failing due to the new autoescaping. I’m pretty sure I just need to mark something as safe but doing that with my test template doesn’t seem to be doing the trick. Anyone else deal with this problem already?
Dmitry Fedotkin
@BlackPie
Apr 20 2016 18:32
Hi there!
Did someone face very slow working of django admin view? According to debug toolbur there is everything OK with SQL queries, but CPU takes too much time(~100 seconds).
How to debug there?
Mir Nazim
@mnazim
Apr 20 2016 18:35
@BlackPie Enable some profiler pannels and see what they tell you.
http://django-debug-toolbar.readthedocs.org/en/1.4/panels.html
There are also some timining pannels which tell can you how much time was spent doing what.
Dmitry Fedotkin
@BlackPie
Apr 20 2016 18:39
@mnazim like that? http://prntscr.com/auppbp
it tells me nothing(
Mir Nazim
@mnazim
Apr 20 2016 18:41
@BlackPie share your DEBUG_TOOLBAR_PANELS settings
The one you shared is browser timing, it has nothing to do with request timing.
See what it tells you
Dmitry Fedotkin
@BlackPie
Apr 20 2016 18:45
@mnazim seems ok http://prntscr.com/aupsnl
Mir Nazim
@mnazim
Apr 20 2016 18:47
And you are still getting long load times for admin pages? Does this happen for any other page? Is this localhost or are you accessing the site over internet?
Dmitry Fedotkin
@BlackPie
Apr 20 2016 18:48
Yes. All other pages are fast. This is localhost.
Mir Nazim
@mnazim
Apr 20 2016 18:51
Hmm. What type of page are you accessing in admin? Object list? Object detail? Is it possible there's something more than database access going on? Is fetching object list or one object from database fast from django shell? Need more info.
Dmitry Fedotkin
@BlackPie
Apr 20 2016 18:53
Just created model with OneToOne field, and made one instance. I talked about admin object detail. This object fetch from shell very fast
Mir Nazim
@mnazim
Apr 20 2016 18:56
Okay, so the OneToOne field, are there a lot of choices for that field. That might be taking time to populate the drop down for it.
Try converting the OneToOne field to raw_id_fields
class ModelNameAdmin(admin.ModelAdmin):
    raw_id_fields = ('one_to_one_field_name',)
Dmitry Fedotkin
@BlackPie
Apr 20 2016 19:00
awesome
that drop down menu was a reason of lag
thanks a lot!
Mir Nazim
@mnazim
Apr 20 2016 19:01
:thumbsup: