Re: bug of session middleware --- session never expires

2016-12-28 Thread Melvyn Sopacua
On Sunday 25 December 2016 18:42:16 Chaos Wong wrote: > Thanks for the advice. > It's indeed a rude way to force session to expire only depend on the > absolute time. User always encounters session-expired event when > posting something. > I will consider your way 3). But how the django know user

Re: Subclassing Models in non model class

2016-12-28 Thread Melvyn Sopacua
On Tuesday 27 December 2016 05:51:55 M Hashmi wrote: > I created a model Address like a normal practice below. Now I need to > create a subclass without using models.Model. But its not letting me > do because obviously it won't create tables unless I call > models.Model in class parameters. > > I

Re: Experiences/tips for deploying and supporting on-premise in enterprises?

2016-12-28 Thread Antonis Christofides
> For example, if you're deploying via VM, would you just go ahead and package > Memcached in that VM, or take a different route? Similarly, have you run into > problems using the migration framework for some enterprise clients? If the load is small, as it seems to be, and a VM can handle it, why

Re: Djnago project to installer

2016-12-28 Thread Melvyn Sopacua
On Monday 26 December 2016 12:45:23 Antonis Christofides wrote: > It might be possible to install part of the stack (for example, Django > only). It would be very difficult for the whole stack (web server, > WSGI server, Django, database). I think it might be impossible or > undesirable. > > Why d

Getting data from table with name logged in user

2016-12-28 Thread Ernst van der Heijden
Hello everyone, I'm new to Django and have a problem. I have a table in my database with records that contains data for different users. All I need to do is listing that data with a list_view for the user that is logged in. My code now looks like this: class RoosterListView(LoginRequiredMixin,

Can I close the feature that django orm will create table when a modal create?

2016-12-28 Thread tinybox
Hi everyone, I am a beginner about django. It seems django will create a table when the modal first create, but I want to create table in database by myself and forbid django creating table automatically. What can I do in setting.py? Thanks~ -- You received this message becau

Re: Tutorial 5 (Testing) seems to have an error

2016-12-28 Thread Nicolai Bjerre Pedersen
Hi Eric, Did you find the bug? I have the same issue running python 2.7.12 and django 1.10.4 Den mandag den 15. februar 2016 kl. 20.02.55 UTC+1 skrev Tim Graham: > > It looks like you have a Python path problem or that your project isn't > structured correctly such that the model is being regis

Re: Tutorial 5 (Testing) seems to have an error

2016-12-28 Thread Nicolai Bjerre Pedersen
I figured it out. I had to either delete __init__.py in my root directory (where manage.py is located) or call python manage.py polls.tests instead of just python manage.py polls Den mandag den 15. februar 2016 kl. 20.02.55 UTC+1 skrev Tim Graham: > > It looks like you have a Python path problem

What determines initial number of forms in Django modelformset_factory?

2016-12-28 Thread Duane Gregory
My model formset is producing an initial 7 forms, as seen here: I would like to alter that number, but cannot see how. view and form for ref: def micro_log_create(request): MicroLogFormSet = modelformset_factory(Micro_Log, form=MicroLogForm, max_num=4, extra=0) if request.method == 'PO

Re: Getting data from table with name logged in user

2016-12-28 Thread Antonis Christofides
I think what you want is self.request.user.username or something like that. At the documentation take a look at "Request and response objects". Regards, Antonis Antonis Christofides http://djangodeployment.com On 12/28/2016 10:35 AM, Ernst van der Heijden wrote: > Hello everyone, > > I'm new to

Re: Can I close the feature that django orm will create table when a modal create?

2016-12-28 Thread Tim Graham
You'll want to set Meta.managed = False on the model. https://docs.djangoproject.com/en/stable/ref/models/options/#managed On Wednesday, December 28, 2016 at 7:17:31 AM UTC-5, tinybox wrote: > > Hi everyone, > I am a beginner about django. > It seems django will create a table when the m

Re: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Avraham Serour
There's nothing recommending not to use uwsgi on windows. Deploying on windows may be not recommended, but if you must use it uwsgi may be compiled in cygwin. Actually even nginx may be compiled in cygwin and works fine On Wed, Dec 28, 2016 at 5:03 AM, roboslone wrote: > Both nginx and Apache ar

using django app functionality offline in browser when internet is inactive and synchronize with the remote server when internet is available.

2016-12-28 Thread Shiv Dangi
I am making website for a restaurant that also serving food to home to their customers. I successfully completed online food ordering and serving part and also integrated counter management functionality in same website (all data related to counter management functionality are stored on remote

Re: Django project beginner

2016-12-28 Thread jon
I would recommend the Django Girls tutorial. It is very well written and easy to follow. I covers most of the components that you will need to get started with Django and is a good starting point. https://tutorial.djangogirls.org/en/ On Monday, December 26, 2016 at 6:39:25 AM UTC-5, imed chaabo

Re: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Kakar Nyori
Hi, I use windows, and I too was confused about these things. The best recommendation I got was to use *Vagrant, *and to this day I use it. *"Vagrant is a tool for building complete development environments."* Basically you select an environment like ubuntu OS (called vagrant box), and then y

RE: Url error

2016-12-28 Thread Matthew Pava
It looks like you need to remove “id/” from the URL in the address bar or add “id/” to the beginning of the URL in your urlpatterns. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Sharan Kumar Sent: Wednesday, December 28, 2016 9:29 AM To: Django users Su

Django doesn't email reporting an internal server error (HTTP status code 500)

2016-12-28 Thread Philip Lee
Please help! The question are also posted here http://stackoverflow.com/questions/41363888/django-doesnt-email-reporting-an-internal-server-error-http-status-code-500 I could send mail using the following code E:\Python\django-test\LYYDownloaderServer>python manage.py shell Python 3.5.2 (v3.5.2:4

RE: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Matthew Pava
For what it’s worth, I use Windows 10 as my development environment. We use Windows Server 2012 in production with PostgreSQL and Apache 2.4 with modwsgi. We use Python 3.5 and Django 1.10. All of our tools are 64-bit. What’s really nice is that we have a method to print webpages directly fr

Re: Subclassing Models in non model class

2016-12-28 Thread M Hashmi
Thanks for the reply. I was trying to understand sql level inheritance difference between Proxy based models and abstract models. I got it figured out. Thanks Regards, Mudassar On Wed, Dec 28, 2016 at 4:09 AM, Melvyn Sopacua wrote: > On Tuesday 27 December 2016 05:51:55 M Hashmi wrote: > > > >

Define Django Base Model Class

2016-12-28 Thread Guilherme Leal
In one of my django projects, I have a base model (that inherits from django.db.models.Model), and is the base model class that all my models uses. I would like to "override" the base model class from django, so everytime a developer would import the base model class with "from django.db.models

Re: Define Django Base Model Class

2016-12-28 Thread Avraham Serour
You could monkeypatch django to accomplish this, but I would advise against it. Instead of having implicit or hidden behaviour you should instruct your developers to use from myproject import models instead of from django.db import models On Wed, Dec 28, 2016 at 7:13 PM, Guilherme Leal wrote:

Re: Define Django Base Model Class

2016-12-28 Thread Guilherme Leal
Got it. The custom model doesn't have any significantly different behaviour, just some helper properties that return, for instance, a basic GrapQL Node from that very model (the project uses graphene). 2016-12-28 15:46 GMT-02:00 Avraham Serour : > You could monkeypatch django to accomplish this,

File/Folder Sync API?

2016-12-28 Thread Alexander Joseph
I'm building a collection of apps that write custom .docx and .xlsx files, and store them to a users account. These files need to be in a specific hierarchy and each user will have their own files/folders they can view and edit. It would really be great if I could allow each user to sync their

Django-Channels strange slowdowns - how to profile?

2016-12-28 Thread jakub . skalecki
My question from StackOverflow: My technology stack is Redis as a channels backend, Postgresql as a database, Daphne as an ASGI server, Nginx in front of a whole application. Everything is deployed using Docker Swarm, with only Redis and Database outside. I have about 20 virtual hosts, with

Re: What determines initial number of forms in Django modelformset_factory?

2016-12-28 Thread Farhan Khan
I believe its the "extra" parameter. By default, the size is the number of objects you pass it. You can set that value to 0 by doing YourObject.objects.none() On Wednesday, December 28, 2016 at 7:17:31 AM UTC-5, Duane Gregory wrote: > > My model formset is producing an initial 7 forms, as seen he

Custom Widget for CharField Multiple

2016-12-28 Thread Farhan Khan
Hi, I am trying to create a `CharFieldMultiple`, equivalent to the MultipleHiddenInput or SelectMultiple. The goal is to have multiple CharField returned as a list, but have not been able to recreate it. My code thus far is: class CharFieldMultiple(forms.widgets.Input): def render(self, nam

Re: Define Django Base Model Class

2016-12-28 Thread Vijay Khemlani
That doesn't change the advise I would find it weird to import a class only to have something else loaded https://www.python.org/dev/peps/pep-0020/ "Explicit is better than implicit." On Wed, Dec 28, 2016 at 3:02 PM, Guilherme Leal wrote: > Got it. > > The custom model doesn't have any signi

Re: What determines initial number of forms in Django modelformset_factory?

2016-12-28 Thread Duane Gregory
Perfect. Thank you! On Wednesday, December 28, 2016 at 12:43:39 PM UTC-7, Farhan Khan wrote: > > I believe its the "extra" parameter. > By default, the size is the number of objects you pass it. You can set > that value to 0 by doing YourObject.objects.none() > > On Wednesday, December 28, 2016 a

How to pass data between Django module/app functions without using database in asynchronous web service

2016-12-28 Thread Ken McDonald
I've got a web service under development that uses Django and Django Channels to send data across websockets to a remote application. The arrangement is asynchronous and I pass information between the 2 by sending JSON formatted commands across websockets and then receive replies back on the sa

Re: using django app functionality offline in browser when internet is inactive and synchronize with the remote server when internet is available.

2016-12-28 Thread roboslone
Hi! Seems like this is a task for your frontend, not Django. You'd probably want to store orders data in client's browser and then call some handler on your backend (Django), that would correctly process this data. You should be careful, though, because clients could send malformed data to that

Re: Custom Widget for CharField Multiple

2016-12-28 Thread roboslone
Hi! If I understand this correctly, subclassing `forms.widgets.Input` was a wrong idea. As you can see in Input's source (https://docs.djangoproject.com/en/1.10/_modules/django/forms/widgets/#Input ), it always renders