How can I implement Ajax pagination without side modules like endless-pagination
I need to make ajax pagination in my project and not allowed to use side modules like dajax or endless-pagination. Code in my views.py is following def listing(request): news_list = NewPost.objects.all() paginator = Paginator(news_list, 2) page = request.GET.get('page') try: news = paginator.page(page) except PageNotAnInteger: news = paginator.page(1) except EmptyPage: news = paginator.page(paginator.num_pages) return render_to_response('list.html', {"news": news}) Need to load new pages with AJAX How it should be done? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/059aff43-9578-4265-8cd0-21e900b83d97%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)
Are you sure about correct path to your templates in views? Show your view code понедельник, 17 ноября 2014 г., 5:04:53 UTC+2 пользователь Andreas Ka написал: > > thanks for your answer. > > yes, I just tried that. Same result. > By now, I have understood much more about the templates. > But still, for the admin pages > mysite/templates/admin/base_site.html > doesn't work yet. > > > > I have actually found more errors in the tutorial: > > > > https://docs.djangoproject.com/en/1.7/intro/tutorial06/#adding-a-background-image > didn't work until I put a tag into polls/templates/polls/index.html > > > > > https://docs.djangoproject.com/en/1.7/intro/tutorial05/#testing-our-new-view > these tests all come up with one or the other assertion error > > > > > > On Sun, Nov 16, 2014 at 7:19 PM, RLF_UNIQUE > wrote: > >> Obviously you've restarted the server and refreshed the page in such a >> way to ensure it's not a caching issue ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/2dfc3c89-cf1a-411f-ab0b-c15e7e09d501%40googlegroups.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05933bee-2249-4f21-b6e8-0930b3720363%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Seeking for advise on usage MySQL together with MongoDB
Good day, Community, I'm looking for advise on MySQL & MongoDB usage so please let me take your time to describe the situation. I came to work on e-commerce shop of electrical components with about 10 millions of products. Now all of it stored in awful structure of tables in MySQL. Products stored in 10 small tables, each of them represents individual manufacturer of products and 1 generalized table, where all 10 millions of goods is stored. Those big table serves Sphinx search to implement search on site. All these products being crawled from several APIs and sites on web, so this shop is kind of authorized reseller in our region. The case is that we have to update all products daily and parsing with updating of products takes very long time. I have an idea to start using MongoDB to update and store products and as I think it might take less time than same in MySQL. First question: Am I correct with this statement? Browsing web I've found that some recommend using pymongo, avoiding django rather than mongodb for django. So for your opinion is this statement correct? Also it will be highly highly appreciated if you can share your personal use experience with MongoDB and any information you think be useful. Thank you in advance -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b92afa59-ead1-49e3-b381-1b326ce39fd3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Seeking for advise on usage MySQL together with MongoDB
I would like to thank you a lot for so detailed answers, actually I didn't expect to get so much information on my question. That really great and inspiring. So thank you very much again. Guess now I need to start learning PostgreSQL, cause that is not first time when I hear that Python and Postgres rocks. пятница, 5 декабря 2014 г., 14:56:57 UTC+2 пользователь Artie написал: > > Good day, Community, > > I'm looking for advise on MySQL & MongoDB usage so please let me take your > time to describe the situation. > > I came to work on e-commerce shop of electrical components with about 10 > millions of products. Now all of it stored in awful structure of tables in > MySQL. Products stored in 10 small tables, each of them represents > individual manufacturer of products and 1 generalized table, where all 10 > millions of goods is stored. Those big table serves Sphinx search to > implement search on site. > All these products being crawled from several APIs and sites on web, so > this shop is kind of authorized reseller in our region. > > The case is that we have to update all products daily and parsing with > updating of products takes very long time. > > I have an idea to start using MongoDB to update and store products and as > I think it might take less time than same in MySQL. First question: Am I > correct with this statement? > > Browsing web I've found that some recommend using pymongo, avoiding django > rather than mongodb for django. So for your opinion is this statement > correct? > > Also it will be highly highly appreciated if you can share your personal > use experience with MongoDB and any information you think be useful. > > Thank you in advance > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2b832802-6214-43db-bc65-cb7c69d375b6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Seeking for advise on usage MySQL together with MongoDB
Can you please advise why actually you hate Django ORM and what should be considered instead of it? суббота, 6 декабря 2014 г., 23:18:06 UTC+2 пользователь Cal Leeming написал: > > Hi Artie, > > First, I would strongly recommend reading some of the work by David Mytton > at Server Density, he and his team have been using MongoDB extensively for > many years and they have shared a lot of their insight [1]. It's also worth > mentioning that Postgres has support for JSON field type [2] which > satisfies many of the use cases for document store, though I haven't > finished my own experiments yet so can't comment on comparative > performance/functionality. > > It's industry knowledge that MySQL is bleeding out, rapidly [3] [4]. At > this point, I introduce you to Monty and his creation MariaDB [5]. Although > I would agree with Russell on many of the points he's made about MySQL, > it's hard not to have respect for the work that Monty and his team have > done previously on MySQL, and the vision that is now MariaDB. I would > strongly recommend you spend some time looking into this yourself, read as > many comparison articles as your eyes will allow, and come to your own > conclusions. > > I have built numerous "large scale" systems with a variety of > technologies.. Sphinx, ElasticSearch, MongoDB, MySQL, CouchBase, Redis. > I've also spent many years battling with MongoEngine and have learnt to > hate it, as much as I now hate the Django ORM. So, unless you are edging > towards terabytes of data, assuming you are using SSDs and high memory > nodes, then the impact of your choice will probably be negligible. And if > you are using the Django ORM, then you are even less likely to reap any of > these benefits out of the box [6] There are many different reasons for > choosing one over the over, and you should assess this based on your own > use case/needs/skills, rather than religious bias. > > Determine your use case and test all viable options, otherwise you could > be avoiding something for the wrong reasons. You can build *beautiful* > things with all these different technologies, and it's actually the mindset > which matters the most [7]. Don't just settle for what others are telling > you, try for yourself and come to your own conclusions, only then can you > be sure. It's also a good way to gain in-depth knowledge about how these > technologies work, which can be invaluable. > > Cal > > > [1] https://blog.serverdensity.com/mongodb/ > [2] http://www.postgresql.org/docs/9.3/static/datatype-json.html > [3] http://www.theregister.co.uk/2012/11/29/monty_oracle_eu_promises/ > [4] > http://www.computing.co.uk/ctg/news/2271011/mysql-creator-monty-widenius-wants-it-to-disappear-from-the-earth > [5] http://www.themukt.com/2014/09/11/reason-use-mysql-michael-widenius/ > [6] https://news.ycombinator.com/item?id=4076834 > [7] > http://www.amazon.co.uk/The-Clean-Coder-Professional-Programmers/dp/0137081073 > > > > On Sat, Dec 6, 2014 at 12:26 AM, Russell Keith-Magee < > rus...@keith-magee.com > wrote: > >> >> On Fri, Dec 5, 2014 at 8:56 PM, Artie > >> wrote: >> >>> Good day, Community, >>> >>> I'm looking for advise on MySQL & MongoDB usage so please let me take >>> your time to describe the situation. >>> >>> I came to work on e-commerce shop of electrical components with about 10 >>> millions of products. Now all of it stored in awful structure of tables in >>> MySQL. Products stored in 10 small tables, each of them represents >>> individual manufacturer of products and 1 generalized table, where all 10 >>> millions of goods is stored. Those big table serves Sphinx search to >>> implement search on site. >>> All these products being crawled from several APIs and sites on web, so >>> this shop is kind of authorized reseller in our region. >>> >>> The case is that we have to update all products daily and parsing with >>> updating of products takes very long time. >>> >>> I have an idea to start using MongoDB to update and store products and >>> as I think it might take less time than same in MySQL. First question: Am I >>> correct with this statement? >>> >>> Browsing web I've found that some recommend using pymongo, avoiding >>> django rather than mongodb for django. So for your opinion is this >>> statement correct? >>> >>> Also it will be highly highly appreciated if you can share your personal >>> use experience with MongoDB and any information you think b
Determine content-type of page in middleware class Django
Well, I have middleware class which is required to determine content-type of rendered page and if it is 'txt/html', then do some action. I've started just from seeing what content-types do I have on page and here is first problem I faced: class StatsMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): response = view_func(request, *view_args, **view_kwargs) print response['Content-Type'] Executing this, I get few messages about content-types of page elements, like text/html, application/javascript and also tons of errors like key error: content-type and after that - broken pipe So I assume that not all elements of page have such header Content-Type and my question is following: Is there some general Content-Type that says 'That page is text/html' or there are a lot of content-types on page ? And also if this is a proper way to deterimne content-type of page like this: if response['Content-Type'] == 'text/html': pass -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5556d26e-1c9a-4a33-83fd-4cac589d87b9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to configure django and MySql with python properly ??
Hello, you have to provide some information, like traceback of errors and your settings. Also consider using PostgreSQL instead of MySQL. It is much more better and natural to Django среда, 24 декабря 2014 г., 21:54:14 UTC+2 пользователь Osman Goni Nahid написал: > > I'm beginner in django , can't configure properly django , mysqldb in > python trying more time can't find where i make mistake . can anyone give > me an video or link for me . > thanks in advance :) > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5bb7f20c-409a-4148-889a-bee7833fe65c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How properly render pages with video
The project is online English video lessons. I have a 'classroom' - html page with HTML5 video player in center of it. Videos being stored in media folder on same level as project. What I want is to render video from media folder to 'classroom' page using Django. How am I supposed to do this ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1f506b7-e65b-40b4-815a-499720cd9c7b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.