These are chat archives for django/django

27th
Jul 2017
selected-pixel-jameson
@selected-pixel-jameson
Jul 27 2017 03:32
Hey All, does anyone have experience working with the django-import-export app?
Andrew Backer
@awbacker
Jul 27 2017 03:45
we use it in our admin on a few pages, for export only
but have pretty much stopped using it.
shiwoopark
@Shiwoo-Park
Jul 27 2017 08:23

Hello, I'm having problem with this code anyone could help?

My Error on screen is like this,,,

"AssertionError at /test/sharded/
Should never get here. Please report a bug, including your model and model manager setup."

And My code is like below,,

class ShardedModelManager(BaseManager.from_queryset(ShardedModelQuerySet)):
""" Customized Manager for Sharded Database Control """
pass

class TTicket(models.Model):
objects = shard_util.ShardedModelManager()

And I have custom QuerySet class ,,,
Garrus Napp
@GarrusNapp
Jul 27 2017 09:03
When is it nescessary to specify templates folder in settings.py ?
shiwoopark
@Shiwoo-Park
Jul 27 2017 09:05
maybe when you want to use your custom dir for templates
@GarrusNapp
Garrus Napp
@GarrusNapp
Jul 27 2017 09:05
@Shiwoo-Park and default is app/templates/app/x.html ?
shiwoopark
@Shiwoo-Park
Jul 27 2017 09:08
if you use like that, you might need to use like below in View classes
class SomeView(TemplateView):
........template_name = "app/x.html"
so, each_app/templates/* is absolute path for every django TemplateViews
Garrus Napp
@GarrusNapp
Jul 27 2017 09:14
That's precisely what I wanted, thank you @Shiwoo-Park
shiwoopark
@Shiwoo-Park
Jul 27 2017 09:16
^^
Nikhil Allamsetti
@niklul
Jul 27 2017 13:15
@dixon-che :smile:
Matt
@MattZiolkowski
Jul 27 2017 16:02
Hello, anyone could help me with the following problem. I cannot log in to my pythonanywhere django administration page (http://<username>.pythonanywhere.com/admin) using username and password I set and are working locally on my computer. Shouldn't username and password be the same I set up originally on my computer? Or when I created superuser on pythonanywhere in bash I should add my username and password somehow? Accessing http://mattZiolkowski.pythonanywhere.com/admin was the last task in the Deploy! part of djangogirls tutorial where I got stuck. I might add that my pythonanywhere site says "It worked!" without errors. Any thoughts? I would much appreciate any advice.
Matt
@MattZiolkowski
Jul 27 2017 16:17
I created a superuser again in pythonanywhere in bash and typed my desired username and password again and it worked. Possibly I misspelled it in the first time. Its a case when writing down your problem brings a correct solution. Thanks!
Pankaj Mishra
@BeautifulCodes
Jul 27 2017 19:47
Hi everyone ! I am actually making my portfolio so to do the backend I m using django. I need to implement a feature Page Views in that, which should work for refreshing page . For that I have a idea and I need your validation, if it will work or not(I really don't have time to implement and check). I am making one model called PageView and in that I am making a column called Hits(integer). Now whenever I hit the homepage. I am using JavaScript's onwindow load function to use Ajax, using Ajax I am hitting url again which will call view and will make updation of model "PageView" there. I want to know if it will work or not ?
David Pineda
@dpineiden
Jul 27 2017 22:01
Hello @BeautifulCodes , maybe now you can try channels, that allow you to work in better performance than ajax, beacuse enable a websocket to communicate and messaging