Re: Chat application

2014-06-19 Thread Anshum Verma
I would suggest you to use Twisted along with Django. Django could serve as MVC framework and twisted could take control of connection protocol. On Jun 19, 2014 4:17 AM, "Pedro" wrote: > Hello, > > i'm working in a mobile app that depends of a Django server (to manage > user

Internationalize: Get two things to happen when you select a language: set the language and redirected to a different part of the site

2014-06-19 Thread visionary800
I am stumped. I am not sure how to approach this. I think its best if I describe what I would like to happen then I would greatly appreciate some recommendations. *Imagine this...* You go to www.mysite.com and you are presented solely with two buttons(and nothing else): [Enter in English] |

Django Dying upon loop

2014-06-19 Thread G Z
my django server dies whenever i login and access the following function: what is a better way to do what im doing. I need to loop through all of the vm_groups by customer id, and then loop through all of the vms and associate them with each other. The code below is what i have but its not

Re: In the Django documentation, Where can I found URLS.PY Symbol explanations?

2014-06-19 Thread Mike Dewhirst
On 20/06/2014 8:26 AM, Uzi Lumbroso wrote: ?In the Django documentation, Where can I found URLS.PY Symbol explanations (for example: (?P[-\w]+)). What is ... [-\w]+) matches I couldn’t find it in the Django documentation. Thanks for the help It is more or less plain Python

In the Django documentation, Where can I found URLS.PY Symbol explanations?

2014-06-19 Thread Uzi Lumbroso
?In the Django documentation, Where can I found URLS.PY Symbol explanations (for example: (?P[-\w]+)). What is ... [-\w]+) matches I couldn’t find it in the Django documentation. Thanks for the help -- You received this message because you are subscribed to the Google Groups "Django

Re: Advanced SQL Question

2014-06-19 Thread Javier Guerra Giraldez
On Thu, Jun 19, 2014 at 4:49 PM, G Z wrote: > how do I deal with concatenated foreign keys to form a primary key how do i > even register that in the models.py? i guess you mean composite keys. if so, then no; the Django ORM doesn't support composite primary keys. -- Javier

Advanced SQL Question

2014-06-19 Thread G Z
I have a multi-level database that uses concatenated foreign keys as primary keys for tables. For example we have three tables VMS VM_LICENSE LICENSES VMS has name license_id <- foreign key vm_id <-primary key vm_licenses has two concatenated fkeys to for a primary key of: licenses_id fkey

Re: Django Forms.py issue with Model.py fields

2014-06-19 Thread Daniel Sears
You're using parens instead of brackets. Change fields = ('username', 'email', 'password') to fields = ['username', 'email', 'password'] On Thu, Jun 19, 2014 at 1:07 PM, G Z wrote: > I'm trying to write my forms.py class for editing customers but I'm >

Django Forms.py issue with Model.py fields

2014-06-19 Thread G Z
I'm trying to write my forms.py class for editing customers but I'm getting some strange issues where it says the field is unknown but im typing it exactly how it is in the model. Forms.Py from portal.models import UserProfile, Customer > from django.contrib.auth.models import User > from

Re: Django View Questions

2014-06-19 Thread G Z
thansk I solved it.. On Thursday, June 19, 2014 11:02:21 AM UTC-6, G Z wrote: > > so I have a problem when ever I go to /manage/ it takes me to index and im > not sure why. > > Urls.py > url(r'^', views.IndexView.as_view(), name='index'), > url(r'^manage/$', views.ManageView.as_view(),

Re: Django View Questions

2014-06-19 Thread C. Kirby
According to the error, you didn't try to access /manage, just the root url On Thursday, June 19, 2014 12:08:05 PM UTC-5, G Z wrote: > > if i comment out the urls for #url(r'^$', views.IndexView.as_view(), > name='index'), it will give me an error that it cant find /manage > > > Page not found

Re: Django View Questions

2014-06-19 Thread C. Kirby
Do you have APPEND_SLASH set in settings? If you don't and are trying to hit register instead of register/ it will fail Kirby -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Setting initial value of a autoincrement field in the database

2014-06-19 Thread C. Kirby
You can't do it in Django directly. If you need to do it you have to go to your DB and use whatever functionality it supports to set an auto id start point. On Thursday, June 19, 2014 12:14:17 PM UTC-5, Anurag Baidyanath wrote: > > I have a field in my models.py file as follows > > ticket_id =

Re: Django View Questions

2014-06-19 Thread G Z
I chagned it further and it is still not working from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.contrib.auth import

Re: Django View Questions

2014-06-19 Thread G Z
url(r'^$', views.IndexView.as_view(), name='index'), url(r'^register/$', views.register, name='register'), # ADD NEW PATTERN! is my new urls from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.contrib.auth import authenticate,

Setting initial value of a autoincrement field in the database

2014-06-19 Thread Anurag Baidyanath
I have a field in my models.py file as follows ticket_id = models.AutoField(primary_key=True) The value for the ticket_id column starts at 1. say i wanted it to start from some value (say 989) . how do i accomplish this using django? -- You received this message because you are subscribed to

Re: Django View Questions

2014-06-19 Thread C. Kirby
You actually have a urls error. Your first one: url(r'^', views.IndexView.as_view(), name='index'), Should be: url(r'^$', views.IndexView.as_view(), name='index'), (Note the $) $ tells the url resolver to stop trying to match a url at the $. Since you don't have it, calls to manage/ match on

Re: Django View Questions

2014-06-19 Thread G Z
if i comment out the urls for #url(r'^$', views.IndexView.as_view(), name='index'), it will give me an error that it cant find /manage Page not found (404)Request Method:GETRequest URL:http://127.0.0.1:8000/ Using the URLconf defined in holon.urls, Django tried these URL patterns, in this

Django View Questions

2014-06-19 Thread G Z
so I have a problem when ever I go to /manage/ it takes me to index and im not sure why. Urls.py url(r'^', views.IndexView.as_view(), name='index'), url(r'^manage/$', views.ManageView.as_view(), name='manage'), Views.py from django.shortcuts import get_object_or_404, render from django.http

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Stodge
My problem seems to be this: * run custom management command * activate language from settings, which is "en-gb" * dynamically import module for a Django app and invoke custom bootstrap function * calling get_language() in bootstrap function returns "en-gb" * bootstrap function calls

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Stodge
No that's the code from the Django documentation. https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/#management-commands-and-locales On Thursday, 19 June 2014 09:39:34 UTC-4, Tom Evans wrote: > > On Thu, Jun 19, 2014 at 1:41 PM, Stodge > wrote: > > Yes

gunicorn myproject.wsgi:application invalid now.

2014-06-19 Thread Jacky
I use gunicorn to deploy my project all the time, but today, in my new project, it raise a error. I check here and there, google around, but it doesn't work. Maybe there was wrong with me. So I create a new project to test, here is all my process: $ virtualen env $ source env/bin/active $ pip

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Tom Evans
On Thu, Jun 19, 2014 at 1:41 PM, Stodge wrote: > Yes I'm aware of this thanks. However, the documentation also states that I > can activate a different language in my custom command: > > If, for some reason, your custom management command needs to use a fixed > locale different

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Stodge
Sorry, this is using Django 1.6.2. On Wednesday, 18 June 2014 12:48:47 UTC-4, Stodge wrote: > > My settings for languages are: > > LANGUAGE_CODE = 'en' > > USE_I18N = True > LANGUAGE_COOKIE_NAME='django_language' > ugettext = lambda s: s > LANGUAGES = ( > ('en', ugettext('English')), >

Re: Database problem in Django

2014-06-19 Thread Stodge
Read the documentation: https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by On Wednesday, 18 June 2014 08:06:18 UTC-4, Ashu Singh wrote: > > Hello everyone. My doubt is how to fetch the recent two database entries > in django. User may enter into database anytime but the query

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Stodge
Yes I'm aware of this thanks. However, the documentation also states that I can activate a different language in my custom command: *If, for some reason, your custom management command needs to use a fixed locale different from ‘en-us’, you should manually activate and deactivate it in your

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Tom Evans
On Wed, Jun 18, 2014 at 7:10 PM, Stodge wrote: > By override I mean I add this at the start of my handle() function in my > custom management command: > > from django.utils import translation > translation.activate(settings.LANGUAGE_CODE) > > Where

Re: Chat application

2014-06-19 Thread Cal Leeming [Simplicity Media Ltd]
+1. You may even be able to do this using uWSGI plugins and Redis which would be even faster. Django is certainly not the right tool for the job for this use case though. Cal On Thu, Jun 19, 2014 at 2:24 AM, carlos wrote: > Hi, maybe not all with django, maybe you

RE: Chat application

2014-06-19 Thread Ilya Kazakevich
Hello, You may use websockets on client and asyncio on serves as it is done here: https://github.com/throwable-one/chat-async/ But websockets require modern client and asyncio require python 3.4 (but asyncio is standard and worth using, anyway) Ilya Kazakevich, JetBrains PyCharm (Best

Re: Change help_text of a field in a derived model

2014-06-19 Thread Vladimir Chukharev
Answering my own question. No, there is no ready way to change help_text in model. The proposed solution is almost correct, just the get_form_class() function should be defined both in CreateViiew- and UpdateView-derived classes and be like the following. def get_form_class(self):

Re: PostgreSQL, queries, speed

2014-06-19 Thread Vladimir Chukharev
On Tuesday, June 17, 2014 3:42:56 AM UTC+3, Lachlan Musicman wrote: > > The db is hosted on the same server, it's not underpowered, and it is > less poorly tuned so much as untuned. > > Untuned is the same as poorly tuned when it comes to PostgreSQL. Or worse. Pg has defaults from last