Re: User Based role in Django

2017-06-21 Thread Jani Tiainen
Well its your code, so yes if you write code that does it. It doesn't happen magically for you. 21.6.2017 11.15 "Mannu Gupta" kirjoitti: > Hi , > Will I be able to trace if user upgrde the subscription level ? > > Manni > > On Wed, Jun 21, 2017 at 1:41

Re: User Based role in Django

2017-06-21 Thread Jani Tiainen
ng your method i.e by making different groups . > When he upgrade the group . > How about making another table having user, his subscription level and > changed_at field(which traces when he /upgrade the group ) > > Just want to know your suggestion . > > Mannu > > O

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread Jani Tiainen
Hi, In our CI integration testing we use special test database and we do explicitly set both normal connection and test connection to reuse the same database. Also we do use --keepdb to avoid database teardown. Note that you have to use transactional test otherwise your worker doesn't see data fr

Re: Django ORM and TestCase

2017-06-29 Thread Jani Tiainen
Hi, In TestCase Django wraps all tests within transaction and makes commit and rollback as no-op. So only code that is within transaction (your test) will see the data. After test is finished a rollback is issued to remove all the data inserted to db. And there is no way to read that data outsi

Re: Django Smart Selects - What does 'models world readable' mean??

2017-07-02 Thread Jani Tiainen
It means that there are no permission checks implied on models - so data you expose to select fields are readable by anyone for example by using curl tool. 2.7.2017 7.16 ip. "Mark Phillips" kirjoitti: > I need to chain some select boxes in my admin forms to make data input > less error-prone and

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Jani Tiainen
/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1f61e62-a6cc-44a4-ba35-7fa8b28c5549%40googlegroups.com <https://groups.google.com/d/msgid/django-users/e1f61e62-a6cc-44a4-ba35-7fa8b28c5549%40googlegroups.com?utm_medium=email&utm_so

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Jani Tiainen
deprecated field Is that temporary? That would influence the approach From what I understood from your original post this is just a matter of deploying the new app version that removes a field, so you would just need to run migrations after deploying On W

Re: Django ORM and TestCase

2017-07-06 Thread Jani Tiainen
at 2:34:28 PM UTC-7, Jani Tiainen wrote: > Hi, > > In TestCase Django wraps all tests within transaction and makes commit and > rollback as no-op. > > So only code that is within transaction (your test) will see the data. > > After test is finished a rollback is issued to re

Re: The best database for django

2017-07-10 Thread Jani Tiainen
Hi, Like Rich suggested start with Postgres. It's very powerful and has first class support in Django. 10.7.2017 19.15 "DEIBER ANDRES RINCON ROJAS" kirjoitti: > Hi to everybody, I'm developing an web application using Python and Django > and it requires storage of excel data, data volume high a

Re: How to Contribute to the Django?

2017-07-12 Thread Jani Tiainen
it https://groups.google.com/d/optout. -- Jani Tiainen -- 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

Re: Create Mobile App from Django Template

2017-07-17 Thread Jani Tiainen
Hi, There are numerous ways to do that. You could create mobile version of your site or do called responsive design. That way site would be accessible with virtually any device. If you want to create native app you can write for example rest api to provide data for your app. 17.7.2017 21.54 "Meg

Re: How to get extra data in clean_data?

2017-07-18 Thread Jani Tiainen
oups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ab8a7050-37c8-4547-9b86-5bd16821ede9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Jani Tiainen -- You received this message bec

Re: Use one correspondig database user for each application user

2017-07-21 Thread Jani Tiainen
Hi, I think connection pooling is out of Django scope. Django though reuses db connection. In some early versions Django opened and closed connection per request. 21.7.2017 20.55 "Fred Stluka" kirjoitti: > Answer: Connection pooling > > Sharing a single DB user for all/multiple Web app users

Re: Downloading error in django-nonrel file

2017-07-21 Thread Jani Tiainen
Hi. Django nonrel was attempt to use orm with non relational databases. It works only partially and development has stalled. (Last commit two years ago). You can use non relational databases just fine - you can't use orm for that. 21.7.2017 15.39 kirjoitti: > Hello Everyone > > only 143 kb is

Re: The best way to use AMP of google with Django

2017-07-24 Thread Jani Tiainen
Hi I really don't know what AMP is but Django templates can be used to output any text you want to. Whout extra work. If you need content negotiation that is also relatively simple to do. 24.7.2017 20.55 "carlos" kirjoitti: > Hi, i have blogs with Django i need use AMP (https://www.ampproject.

Re: Run Django tasks with another programming language

2017-07-28 Thread Jani Tiainen
Hi. I greatly suspect that your problem isn't the Python itself but what you do in your workers. Also what analysis made you to conclusion that using golang or c# would improve situation? In other words have you really measured and identified the slow part? 28.7.2017 19.21 "M Mihai" <1497mi...@

Re: Run Django tasks with another programming language

2017-07-29 Thread Jani Tiainen
will be better of if I will do these requests using another programming language On Friday, July 28, 2017 at 8:34:53 PM UTC+3, Jani Tiainen wrote: > Hi. > > I greatly suspect that your problem isn't the Python itself but what you > do in your workers. > > Also what analysi

Re: Run Django tasks with another programming language

2017-07-29 Thread Jani Tiainen
Furthermore, your findings would be helpful for others as well. You’ve found something that is slow (or just hogs resources) would allow others to resolve similar issue(s) much more easy. > On 29 Jul 2017, at 20.10, Jani Tiainen wrote: > > Hi. > > You should run performance p

Re: Django tutorial part 4: 'utf8' codec can't decode byte 0xa0 in position 22431

2017-08-01 Thread Jani Tiainen
<mailto:django-users@googlegroups.com>. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4360a617-289d-4e4c-8f60-b7dda65e1fda%40googlegroups.com <https://groups.google.com/d/msgid/djang

Re: Django tutorial part 4: 'utf8' codec can't decode byte 0xa0 in position 22431

2017-08-01 Thread Jani Tiainen
ponse. It was really helpful. Instead of using word I > edited the html files with Notepad. Now it's working :) > > Am Dienstag, 1. August 2017 23:01:49 UTC+10 schrieb Jani Tiainen: >> >> Hi. >> >> You need to make sure that file is really encoded as utf8 and

Re: Define middleware per app?

2017-08-02 Thread Jani Tiainen
Hi, What is the problem that your’e trying to resolve with middlewares and why you think that you can’t use defaults as is? > On 2 Aug 2017, at 14.59, Robert Stepanek wrote: > > I am new to Django and my project consists of two apps: a typical blog-style > web site app and an API app. For th

Re: Turn off migrations completely in Django 1.7

2017-08-02 Thread Jani Tiainen
.com <https://groups.google.com/d/msgid/django-users/a93ba892-599a-4677-9895-cb88ce36b01d%40googlegroups.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- Jani Tiainen -- You received this message because you are subscribed to the Google Gro

Re: Define middleware per app?

2017-08-03 Thread Jani Tiainen
Well of course you can just have two set of settings (derive common stuff). So you don't need fully separated projects. If you don't want to. 3.8.2017 11.27 "Robert Stepanek" kirjoitti: > Hi, > > On Wednesday, August 2, 2017 at 8:31:14 PM UTC+2, Jani Tiainen wrote

Re: How to use try..except, but when DEBUG is True, show the error?

2017-08-12 Thread Jani Tiainen
You can reraise exception simply by calling "raise" without params. 12.8.2017 17.54 "Fellipe Henrique" kirjoitti: > Hello, > > i have these code, for example: > > try: >x = parse_date('') > except TypeError: > return False > > ​ > > It's ok for me code like these.. but, when DEBUG ==

Re: How to use try..except, but when DEBUG is True, show the error?

2017-08-12 Thread Jani Tiainen
Also I would suggest that you log exception in case you don't want to raise it. That way you know that something goes wrong. 12.8.2017 18.52 "Fellipe Henrique" kirjoitti: > Thanks, but.. it's weird I tried that before, and show me the error, but, > only text.. not that "yellow page" from django

Re: deploying on windows

2017-08-12 Thread Jani Tiainen
Certain version of IIS does have native WSGI support. Couldn't find it with my phone but google should help you with that. 12.8.2017 21.06 "Larry Martell" kirjoitti: > I have a django app that runs in linux. It uses nginx and uwsgi. I > have successfully deployed it with Docker, vagrant/Virtual

Re: Use one correspondig database user for each application user

2017-08-14 Thread Jani Tiainen
Hi. Django doesn't use connection pooling. That's beyond scope of Django. Normally Django opens connection per worker thread and keeps it open as long as there is no unrecovable error or connection exceeds MAX_AGE setting See https://docs.djangoproject.com/en/1.11/ref/databases/#connection-manag

Re: How to prevent the use of hidden fields in a form

2017-08-17 Thread Jani Tiainen
Hi. Of course you don't use hidden field value at all from the form (you shouldn't even have those values there in the first place). Get and set id and date after you have validated form otherwise to final object so there isn't any possibility to even try to change to value On 17.8.2017 16

Re: Query for retrieving the latest of a related row.

2017-08-17 Thread Jani Tiainen
Hi. Actually your way is pretty much only way to do it. With aggregation you can get latest post timestamp per forum but to get actual post requires second query. Also unless you list hundreds of forums per page performance shouldn't be a problem. Note that you could use reverse relation to get

Re: New Decorator Routing for Django

2017-08-20 Thread Jani Tiainen
Hi, I just want to point out that there is similar work done for the core. https://github.com/django/deps/blob/master/accepted/0201-simplified-routing-syntax.rst If we're lucky it will be available in Django 2.0. 21.8.2017 0.07 "Malik Brahimi" kirjoitti: > Hey guys! Do you mind checking out m

Re: Correct pattern to call external api during form saving

2017-08-21 Thread Jani Tiainen
Hi. First you need to decide is it crucial that api gets called no matter of what and do you need to report result of call back to user. If yes you want to store task of calling somewhere (database) and do the actual calling at background worker job. There exist several ways to do it but for exa

Re: Python and Django traing

2017-08-26 Thread Jani Tiainen
Hi. I would suggest to take a look at official tutorial. Django Girls does have very good tutorial. 27.8.2017 0.27 "AFSungo" kirjoitti: > Hi, > > I am beginner and want know: > > Where can I find an online and remote class to learn Django?? > > > -- > You received this message because you are

Re: class Meta(object)

2017-08-28 Thread Jani Tiainen
For django it doesn't matter. It's more like historical way to define metadata. 28.8.2017 7.31 ip. "Matthew Pava" kirjoitti: > Should our Meta classes inherit from object? I just did a code inspection > and got that message a few times; it never occurred to me to do that > before, and even the

Re: Result of queryset in Django 1.10 is not sorted

2017-09-05 Thread Jani Tiainen
Hi, Unless you have applied ordering, either in model Meta, or in your query clause, results are really "in no particular order". Most of the databases do return results in order the data is read from the disk, but that's not quaranteed. If you require ordering, add .order_by() to your query

Re: putting an dynamically created image to response

2017-09-06 Thread Jani Tiainen
Hi, You probably want to have actually a view that returns the map image as a response. And that's documented, using PDF though but for image same principle applies. https://docs.djangoproject.com/en/1.11/howto/outputting-pdf/ On 6.9.2017 11.55, Ahmet Temiz wrote: Hi, I created an image (

Re: How to pre-load model data?

2017-09-08 Thread Jani Tiainen
Hi. We actually implemented spreadsheet importer for one of our clients. It was relatively trivial. Just read the row from spreadsheet put it to modelform for validation and save. There are pretty good libraries to read spreadsheets directly. 8.9.2017 22.13 "Mark Phillips" kirjoitti: > Thanks

Re: I am getting an error that django core commands are listed as settings are not properly configured

2017-09-11 Thread Jani Tiainen
Hi. Information you provided isn't much. What you tried to do to get that error. And please don't paste images or binary files they're quite hard to handle on certain devices. 11.9.2017 17.21 "margana harika" kirjoitti: > I am getting the error which i have shown in the screen shot attached.ca

Re: Hi, I want to know what's the core layer of django.

2017-09-15 Thread Jani Tiainen
Hi. There isn't exactly core if the Django. All things you mentioned forms the core. Plus there is much more. Forms, url routing. And bunch of helpers like auth and GIS. 15.9.2017 10.54 ap. kirjoitti: > In Django Developer group, easy to see core layer of django, but what's > the layer is

Re: JSON Objects

2017-09-16 Thread Jani Tiainen
Hi One of the simplest ways is to use special serializer. At least django-nap and django-rest-framework do have excellent serializers you can leverage. Django itself also has serializer you can use. https://docs.djangoproject.com/en/1.11/topics/serialization/ 16.9.2017 13.26 "yingi keme" kirjoi

Re: Autocomplete in Django

2017-09-17 Thread Jani Tiainen
Hi. Besides the way Andréas described, there exist autocomplete fields that can accept arbitrary input you can send to backend without having to create special add phase. Adding such functionality of course requires a custom field that can add nonexisting values to database. 17.9.2017 7.40 "Mre

Re: Any django reusable app for outdoor & indoor location, GPS tracking?

2017-09-27 Thread Jani Tiainen
Hi. To my knowledge there isn't one since we implemented our own tracker. If you're going to build one I do have few pointers that you should consider. Recent browser changes requires that location data is transferred over https. I think chrome was first one to require it. That makes developing

Re: Setting up Django for the first time, urls.py and settings.py

2017-10-01 Thread Jani Tiainen
Hi. Urls changed so that you can't pass view as a string anymore. If you're looking good tutorial Django Girls do have one. And it's using recent djangi. 1.10.2017 2.40 ip. "drone4four" kirjoitti: > I’m playing with Django for the first time. I am using a guide called, > “Python > from Scra

Re: Video Chat with Django

2017-10-04 Thread Jani Tiainen
Hi. I'm not sure that Django would be suitable for such an application. Django heavily relies on standard http request-response cycle and I would imagine that something like video chat requires more persistent connections and Django doesn't excel in those. 30.9.2017 1.33 "Shazia Nusrat" kirjoi

Re: django project avoid reload page where work algorithm

2017-10-08 Thread Jani Tiainen
Hi. For long running operatios celery tasks are pretty good choice. Celery can use rabbitmq as messaging queue so those two aren't mutually exclusive. Once you have task running it is possible to use for example ajax polling to query status of the task and once complete inform end user that task

Re: Django and Oracle 10g

2017-10-08 Thread Jani Tiainen
Hi. There is nothing special with Oracle. Once you have cx_Oracle installed just setting proper django backend and connection params. Note oracle 10g had been out of support for good while and it's not officually supported any more in recent Django versions. Also 11g is going out of support soon

Re: django project avoid reload page where work algorithm

2017-10-08 Thread Jani Tiainen
Τη Κυριακή, 8 Οκτωβρίου 2017 - 4:09:37 μ.μ. UTC+3, ο χρήστης Jani Tiainen > έγραψε: >> >> Hi. >> >> For long running operatios celery tasks are pretty good choice. Celery >> can use rabbitmq as messaging queue so those two aren't mutually exclusive. >>

Re: tox?

2017-10-08 Thread Jani Tiainen
Hi, Tox is quite widely adopted. For example django-rest-framework uses it to run tests against various combinations of python and django. 9.10.2017 1.21 ap. "Christophe Pettus" kirjoitti: > On a Django-related project I maintain, someone's submitted a PR that > includes a tox.ini file. I'll

Re: Import csv file on django view

2020-07-24 Thread Jani Tiainen
Hi, I highly can recommend to use pandas to read csv. It does pretty good job to guess a lot of things without extra config. Of course it's one more extra dependency. pe 24. heinäk. 2020 klo 17.09 Ronaldo Mata kirjoitti: > Yes, I will try it. Anythin I will let you know > > El mié., 22 de jul

Re: Problems installing a Django package

2015-08-13 Thread Jani Tiainen
seeing that I can just going, I retry the package install and... get > >> the same error: "*invalid command 'bdist_wheel'"*. Anyone could tell me > >> what is going on? Is my first time doing a reusable app. > >> > >> > > -- >

Re: Need help in Django Task

2015-08-18 Thread Jani Tiainen
oglegroups.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/c31c4026-3efc-477e-b026-48e9e6364117%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

Oracle DB, some help needed

2015-09-08 Thread Jani Tiainen
is acceptable. Thank you for your co-operation. -- Jani Tiainen - Well planned is half done, and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: django.db.utils.DatabaseError: ORA-12704: character set mismatch

2015-09-08 Thread Jani Tiainen
QMayPJYzT69PMoJAN1S9K4reQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Re: What frontend-tools to use for a new CRM project? Shall I use Django OR switch to Meteor.js?

2015-09-10 Thread Jani Tiainen
I've been developing with Dojotoolkit and ExtJS. Both integrate with Django as well as any other JS framework. On 10.09.2015 09:47, Mario Gudelj wrote: +1 angular. Stack overflow is your friend and there's a lot of angular on it. You can do a lot with it with basic knowledge as well. And te

Re: migration error "geo_db_type" when using postgres as second database for geodjango

2015-09-14 Thread Jani Tiainen
On 14.09.2015 11:58, Wenyao Xue wrote: Hi, I use mysql as default database and postgres for geodjango related appliction. my settings: DATABASE_ROUTERS = ['world.routers.GisRouter', 'rest_shop.routers.ShopRouter', 'rest_client.routers.ClientRouter'] DA

Re: migration error "geo_db_type" when using postgres as second database for geodjango

2015-09-14 Thread Jani Tiainen
obj2._meta.app_label == 'world': return True return None def allow_syncdb(self, db, model): """ Make sure the auth app only appears in the 'auth_db' database. """ if db == &#x

Re: real time notification system

2015-09-14 Thread Jani Tiainen
There are several ways to do that but something like Twisted and Websockets or NodeJS and Websockets could do the trick. There also exists swampdragon project that is supposed to have all the goodies in easy to use format. On 14.09.2015 14:20, shamila ali wrote: How can implement real time no

Re: how to create a project in django in windows 7

2015-09-15 Thread Jani Tiainen
Hi, I wrote a long time ago my setup I used when working in Windows. Since that I moved on to *nix since everything was just easier to get by. Here's the link: https://djangonautlostinspace.wordpress.com/2012/04/16/django-and-windows/ On 15.09.2015 10:34, Nick Sarbicki wrote: I am a f

Re: Controlling access at table row level

2015-11-05 Thread Jani Tiainen
Django has foundation for object level (row level) perms: https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#handling-object-permissions So basically you just check: current_user.has_perm('permname', obj) For a full list of methods you can check: https://docs.djangoproject.com/en/1

Re: How do I relate two tables using field name instead of id?

2015-11-05 Thread Jani Tiainen
ffe-42df-994b-22e9028dd4c7%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/f42b087f-dffe-42df-994b-22e9028dd4c7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Jani Tiainen

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-05 Thread Jani Tiainen
o view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/563AB16E.9060604%40gmail.com > . > > For more options, visit https://groups.google.com/d/optout. > -- Jani Tiainen - Well planned is half done, and a half done has been sufficient before... -

Re: update_or_create() always creates (or recreates)

2015-11-06 Thread Jani Tiainen
Your problem lies on the way Django actually carries out create or update. As name suggest, create or update does either one. But that's what you don't want - you want conditional update. Only update if certain fields have been changed. Well this can be done few ways. So you want to do "up

Re: Connecting to FirebirdSQL-Database as a second DB

2015-11-11 Thread Jani Tiainen
Hi, Are you sure that django-firebird is compatible with version of Django you're using? Docs seem to indicate that django-firebird supports only Django 1.6.x On 11.11.2015 11:39, Djangaroo wrote: Hello everybody, I'm having trouble connecting a second Database to my Django Project. I woul

Re: Connecting to FirebirdSQL-Database as a second DB

2015-11-11 Thread Jani Tiainen
my Database with the Django Project. At the moment I'm trying to get this <https://github.com/cfingerh/django-firebird/tree/master>to work On Wednesday, November 11, 2015 at 10:53:31 AM UTC+1, Jani Tiainen wrote: Hi, Are you sure that django-firebird is compatible with vers

Re: Timer for online examination

2015-11-16 Thread Jani Tiainen
Hi, If you're looking something magical there isn't anything. Just declare expiracy timestamp and compare against it in code. It should be rather trivial to do with JS down counter to UI for mode concrete feedback to end user. But keep final word of expiracy in Django code. On 17.11.2015 08

Re: Timer for online examination

2015-11-17 Thread Jani Tiainen
Like the rule #1 in web development says - "Never trust user input". On 17.11.2015 09:47, Robin Lery wrote: Hello, I think you will have to implement jquery/javascript to make the timer. After the countdown finishes js can post the form automatically. Cheers. On Tue, Nov 17, 2015

Re: Making a field readonly according to the user in admin.py

2015-11-18 Thread Jani Tiainen
readwrite for user 'victor' How can I achieve this result if possible with something of the following simple kind class BookOption(admin.ModelAdmin): if (user is 'roby'): readonly_fields=['quantity',] list_display = ('title', 'author&

Re: Requesting data from an API and rendering data on website

2015-11-18 Thread Jani Tiainen
dc809a0-4f20-4cd6-99b8-d50e3e186285%40googlegroups.com <https://groups.google.com/d/msgid/django-users/7dc809a0-4f20-4cd6-99b8-d50e3e186285%40googlegroups.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- Jani Tiainen -- You received thi

Re: Using request object in settings.py for custom logging

2015-11-24 Thread Jani Tiainen
Hi, Problem is that you quite certainly have different users and several processess/threads which would lead logging configuration per request. Is there a reason you don't use something like sites framework to differentiate clients? On 24.11.2015 12:22, Nikunj Badjatya wrote: Hello, Curr

Re: Using request object in settings.py for custom logging

2015-11-25 Thread Jani Tiainen
on is single site only. AFAIK, sites framework is useful when your django application serves multiple sites. Can you throw some more light on what can be achieved using sites ? I would like to evaluate all available options. Thanks. On Tuesday, November 24, 2015 at 4:54:36 PM UTC+5:30, Jani Ti

Re: How can I develop GeoDjango app that can uploaded shapefiles from a user(form) not from django admin

2015-11-26 Thread Jani Tiainen
Hi, and welcome to wonderful world of GeoDjango. :) https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/#geographic-data And specially: https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/#gdal-interface On 26.11.2015 10:31, Mekonnen Legess wrote: Hello everyone I am try

Re: Drop and replace SQL Table automatically when Model is migrated

2015-12-07 Thread Jani Tiainen
Django has built-in support for database migrations since version 1.7. In normal conditions you should be using at least version 1.8 (LTS, and lowest version supported now). On 07.12.2015 03:48, Alexander Whatley wrote: I will check with the people who made the IDE. Thanks for the input. On S

Re: get all current active connected users

2015-12-09 Thread Jani Tiainen
Hi, This is really problematic domain since as you know, Django works on HTTP request-response cycle. After cycle is finished there is absolutely no way to know "who is logged on". So first you have to determine factors that make up "currently active user". Then you have to track that inform

Re: get all current active connected users

2015-12-10 Thread Jani Tiainen
default session TTL is 2 week after last modification). So that would still give troubles that users may have been active in last few seconds but not logged in for a few days. On 09.12.2015 15:37, Jon Ribbens wrote: On Wednesday, 9 December 2015 12:55:22 UTC, Jani Tiainen wrote: This is

Re: New on Django and applications

2015-12-16 Thread Jani Tiainen
Hi, First reply provided you to a starting point - official Django tutorial. And considering that Django is web application framework you can build pretty much anything that you can imagine to work on web. On 16.12.2015 12:49, Baptiste Guillaud wrote: Hi ! I'm new on Django, I'm French and

Re: How to serve a static file with django?

2015-12-23 Thread Jani Tiainen
Hi, Also staticfiles and serving them is gone quire throughly in Django official tutorial part 6 On 23.12.2015 06:57, Dan Bikle wrote: *Hi List,* * I am new to django. I read this: https://docs.djangoproject.com/en/1.9/howto/static-f

Re: possible to setup old project (different dependencies) as a library ?

2016-01-04 Thread Jani Tiainen
Hi, You can use your older project "as a library". But it won't magically enable using outdated libraries. IOW, even if you use 1.4 based project as a library you still need to upgrade parts that are not 1.9 compatible, that also means that all your libraries must be upgraded to support Djang

Re: execute python through ajax

2016-03-09 Thread Jani Tiainen
On 09.03.2016 15:55, Florian Hoedt wrote: Hello Django users, I would like to execute some python code by JS. For example if somebody clicks on a openlayers map it should execute a python based query and get the result as JSON to render it on the map. How would I achieve something like this?

Re: Why doesn't {{ form.field.value }} return cleaned data?

2016-03-31 Thread Jani Tiainen
On 31.03.2016 01:08, Ryan Prater wrote: Say I have a TypedMultipleChoiceField and I'm building a custom select multiple widget in my template. If I want to check a box based on an initial value (ie. default checked options), OR check a box based on form data that has been returned (ie. erro

Re: install geodjango in windows 10

2016-04-12 Thread Jani Tiainen
Hi, GeoDjango is actually built in as django.contrib.gis package so it's "batteries included". To make it work you need to have certain GEOS and GDAL libraries. Easiest way to get them is install either MS4W stack or PostGIS librarios for PostgreSQL. Also there exists few constraints for y

Re: Help with django.

2016-04-19 Thread Jani Tiainen
Hi, you should start with tutorials, Django official: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ Django Girls Tutorial: http://tutorial.djangogirls.org/ And finally on my list is Marina Mele's tutorial: http://www.marinamele.com/taskbuster-django-tutorial On 19.04.2016 14:23,

Re: Converting GeometryField to MultiPolygon using GeoDjango?

2018-06-13 Thread Jani Tiainen
Hi. I usually do data cleanups with QGIS tool which has excellent tools to manipulate data. And it's relatively fast. Of course if you need to import data more regular basis QGIS might not be an option. ke 13. kesäk. 2018 klo 21.30 Jack kirjoitti: > See original question on Stack Overflow >

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jani Tiainen
Hi, First I really suggest you to take a look at Django GIS functionality. It requires few libs to be installed but gives you tons of functionality. Including fields that can show geometry on map. Next problem is that you want to convert physical address to coordinates. Process is called geocodin

Re: How to run python script by clicking a HTML button?

2018-06-21 Thread Jani Tiainen
Hi, Django doesn't exactly work that way. Please do the official tutorial from Django docs to get grasp of basics how things works and are tied together. to 21. kesäk. 2018 klo 23.15 SUBHENDU PANDA kirjoitti: > Below is my HTML code... > > > > > > HTML Forms > > > First name: > > >

Re: Multiple image upload in Django using AJAX & jQuery

2018-06-22 Thread Jani Tiainen
I've made simple picture uploader with Django. Sources can be found at https://github.com/jtiai/picpaster pe 22. kesäk. 2018 klo 14.38 Keerthan Bhat kirjoitti: > Can someone please help me in this? This thing is literally giving me > headache from past few weeks. Please help. Please! > > > https

Re: How to verify if is new record or update record on django template?

2018-07-12 Thread Jani Tiainen
Hi. Usually you know that in a view. Url routing will be different depending if it's a new record or editing old record. to 12. heinäk. 2018 klo 16.58 Fellipe Henrique kirjoitti: > How to verify if is new record or update record on django template? How > can i do that? > > Thanks! > > -- > You

Re: Django database problem

2018-08-20 Thread Jani Tiainen
Hi, Instead of doing everything by hand I would recommend doing a custom management command in Django. Because management commands live inside Django ecosystem you get full benefits of Django. Migrations to setup database tables from model definitions. Models and ORM to interact with database. (M

Re: Custom Django Admin Pages

2018-08-21 Thread Jani Tiainen
com/d/msgid/django-users/57ccf869-829c-4ed4-881b-3b2031834bee%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Jani Tiainen - Well planned is half done, and a half done has been sufficient before... -- You r

Re: new to django

2018-08-29 Thread Jani Tiainen
Hi, Django Girls do have excellent tutorial which also does have very detailed setup guide. ke 29. elok. 2018 klo 14.16 sankar ardhas kirjoitti: > Hi all, > I am a web developer in laravel and codeigniter php web > frameworks. I want to learn how to build web application with django

Re: Creating a single page app

2018-09-07 Thread Jani Tiainen
Hi. Django is really frontend agnostic and there isn't definite answer what is the best framework. So pick one that you're happy with. pe 7. syysk. 2018 klo 8.20 Md.iftequar iqbal kirjoitti: > Which is the best best frontend js for django > > > On Fri, 7 Sep 2018, 10:34 am Andréas Kühne, > w

Re: Django for desktop app development

2018-09-08 Thread Jani Tiainen
Hi. Even django is a web app development framework you can use some parts if it to develop desktop apps. But as pointed out you might get much further with developing api with django and use that api in your desktop or mobile app. la 8. syysk. 2018 klo 5.27 Muhammad Dilshad Khaliq < dilshadkhali

Re: Django restful project standalone

2018-09-20 Thread Jani Tiainen
Hi. Could you also describe what are you trying to achieve? People might have good solutions for you if you provide more detailed information. to 20. syysk. 2018 klo 14.10 Peter Mudoko kirjoitti: > Hi guys am experimenting how i can use django restful framework in a > standalone python project

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Jani Tiainen
I suppose you do have good unittest code coverage so do gradual upgrades (which is preferred upgrade path) and read release notes on each version. 2to3 tool is great help to check some obvious issues when upgrading to Python 3. su 23. syysk. 2018 klo 16.57 'David Brown' via Django users < django-

Re: How to create form??

2018-09-23 Thread Jani Tiainen
Hi. If you have done the official tutorial, part 4 is all about this exact problem. su 23. syysk. 2018 klo 18.51 Ansari Sabir kirjoitti: > How to create a form that collect information (like first name, last name, > email address, contact number, gender) and admin can see that information > in

Re: App Sync

2018-10-01 Thread Jani Tiainen
Hi. That really greatly depends and only way to find it out is to install it and does it work. Most notable change is that Django 2.0+ requires Python 3. ma 1. lokak. 2018 klo 16.34 Dennis Alabi kirjoitti: > Please can i install an App developed in django 1.7 into django 2.1 > environment > >

Re: using a foreign key with multiple choices

2018-11-13 Thread Jani Tiainen
Well categoriederecette is a foereign key to your Categorie model. Your models don't make any real sense. If your categories are fixed you can remove foreign key and add charfield and definitions directly to Recette model. If you expect that categories are added, changed, created or deleted freq

Re: mail sending

2018-11-22 Thread Jani Tiainen
Hi. Essentially you need to record the time you want your mail to be sent and then you need some kind of background worker to check (periodically) if there are any mails to be sent. Celery is one tool that can do that. I personally use simple cron job that uses django management command to achie

Re: how to send data from form site page

2018-11-22 Thread Jani Tiainen
Hi. I've really hard time to understand what you want to achieve. Could you please give an example what you're after? Gear Crew kirjoitti to 22. marrask. 2018 klo 16.48: > how to send data from form site page that has html form to model without > using form model because I want to use HTML elem

Re: how to send data from form site page

2018-11-22 Thread Jani Tiainen
y form everytime for user for example when your form fails to validate. On Thu, Nov 22, 2018 at 5:19 PM Gear Crew wrote: > I want to edit style for form model like changing in default HTML tags > > On Thursday, 22 November 2018 16:53:54 UTC+2, Jani Tiainen wrote: >> >> Hi.

Re: URL path not working with Django ver 2.1.2

2018-11-23 Thread Jani Tiainen
scussion on the web visit > https://groups.google.com/d/msgid/django-users/11324094-eea3-488c-b8dd-9e0cc1d38262%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/11324094-eea3-488c-b8dd-9e0cc1d38262%40googlegroups.com?utm_medium=email&utm_source=footer> > . > F

Re: Website is running in Django and also clients want to make the Mobile APP.

2018-11-23 Thread Jani Tiainen
6%3DdyscxarOk4zNbERTaANf%2BAbnMHonFCYMau3dJH0nBMV4A%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAEr6%3DdyscxarOk4zNbERTaANf%2BAbnMHonFCYMau3dJH0nBMV4A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/

<    2   3   4   5   6   7   8   >