Send message to SMS Gateway

2012-06-22 Thread Setiaman
Hi, I want to create a web app to send the message to SMS Gateway. Try to google the suggested way is to use SMPP protocol. But I can't find any easy package to send message thru SMPP. Can any body give a pointer? Rgrds, Setiaman -- You received this message because you are subscribed to the

Race and Locking? was Re: Duplicate rows with same key in DB?

2012-06-22 Thread ydjango
Thank you, I also believe it is Race condition. I do not want to use get_or_create as I like to have control over DB writes and updates. I will try Unique_together and catch the integrity error exception as Kurtis suggested or check again before doing save(). or just thinking aloud, Is there a

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-22 Thread Kurtis Mullins
Oh man, it looks like my post got butchered. If you can't figure out where each line ends, let me know! On Fri, Jun 22, 2012 at 4:22 PM, Kurtis Mullins wrote: > Did you get an opportunity to type anything after "yes"? Or did it > just blow up at that point? > > Based on the traceback, it looks li

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-22 Thread Kurtis Mullins
Did you get an opportunity to type anything after "yes"? Or did it just blow up at that point? Based on the traceback, it looks like it is having trouble getting your system's default username. I've never really noticed that it has that functionality before but I wonder if there's something "weird

Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-22 Thread Bill Torcaso
Hi, I'm working through the tutorail. Part 1 was fine, and part 2 shows me the site with the light blue background. I proceed to make my first app, 'djangotest'. 1. I run django-admin.py and get a project 2. I edit settings.py to select sqlite3, and put in an absolute path to a sqli

Internationalization Issues

2012-06-22 Thread Ricardo Jacas
Hi Everyone, I'm having a lot of trouble with i18n. My templates don't display all the translations (i've already checked for the "fuzzy" tag). I have no idea what could it be, any thoughts? Anything may help, i've been reading forums for hours. -- lets reign all together -- You received this

Re: runserver cache my template files

2012-06-22 Thread Kurtis Mullins
Are you using a non-temorary caching mechanism like Memcache or DB Caching? If so, do you have caching directives in your templates? On Fri, Jun 22, 2012 at 3:21 AM, Tomás Garzón Hervás wrote: > Yes, and I reload the browser with empty cache. > thanks > > > On Friday, June 22, 2012 9:02:23 AM UTC

Re: Installing Django @ Shared Host

2012-06-22 Thread Kurtis Mullins
I recommend building your application locally (on your own computer). You can follow the tutorial and use Django's built in server for testing. Once your application is ready to go live, then find a Django-Friendly host. They're not too expensive. I wouldn't recommend getting a django-friendly ho

403 error with SAMEORIGIN in header

2012-06-22 Thread Mike
I developing a mac desktop app and I'm just making the first steps to add a feature that will connect to a Django server. I have the Django project running on the development server and the app running on the same machine. When I try to call a Django project view from the app, on 127.0.0.1:800

Re: Installing Django @ Shared Host

2012-06-22 Thread Segundo Acosta Delgado
De ninguna manera, lo mejor es que veas si el hosting soporta django, sino deberias cambiar de proveedor. El jueves, 21 de junio de 2012 16:51:46 UTC-5, Miguel Guirao escribió: > > Hi all, > > I have a hosting service from ApolloHosting.com. I don't have SSH access > neither unsecure telnet to m

Re: Where I am wrong in loading static files ?

2012-06-22 Thread Surya Kasturi
Okay.. I am on it. On Fri, Jun 22, 2012 at 9:44 PM, Melvyn Sopacua wrote: > On 22-6-2012 15:53, surya wrote: > > This is my project folder hierarchy: > > > > project \ > >project \ > > __init__.py > > settings.py > > ur

Re: Where I am wrong in loading static files ?

2012-06-22 Thread Surya Kasturi
Its not working.. I even tried with static links.. On Fri, Jun 22, 2012 at 9:37 PM, Kurtis Mullins wrote: > For your URLs, use {{ STATIC_URL }}/css/index_css.css (or maybe {{ > STATIC_URL }}/app_name/css/index_css.css -- I've never tried this approach > before) > > > On Fri, Jun 22, 2012 at 11:55

Re: Where I am wrong in loading static files ?

2012-06-22 Thread Melvyn Sopacua
On 22-6-2012 15:53, surya wrote: > This is my project folder hierarchy: > > project \ >project \ > __init__.py > settings.py > urls.py > views.py > ... etc >templa

Re: Where I am wrong in loading static files ?

2012-06-22 Thread Kurtis Mullins
For your URLs, use {{ STATIC_URL }}/css/index_css.css (or maybe {{ STATIC_URL }}/app_name/css/index_css.css -- I've never tried this approach before) On Fri, Jun 22, 2012 at 11:55 AM, surya wrote: > Well.. apart from that mistake.. > > Is everything alright?? > > > On Friday, June 22, 2012 8:37:

Re: Where I am wrong in loading static files ?

2012-06-22 Thread surya
Well.. apart from that mistake.. Is everything alright?? On Friday, June 22, 2012 8:37:55 PM UTC+5:30, Kurtis wrote: > > Here's a vaguely similar post: > http://stackoverflow.com/questions/6409920/django-static-files-from-app-directories > > Like one of the respondents recommended, try adding a

Re: Select * from users,country where country.id = users.id in Django using amin.contrib

2012-06-22 Thread Kurtis Mullins
> > > With that said, I'd recommend changing the naming conventions of your > Model fields. For example: > > User > - name > - country > > Goals > - name > - description > - country > > Country > - name > Sorry, wanted to mention a small fix on what I imagine would be better naming conventions (ju

Re: Select * from users,country where country.id = users.id in Django using amin.contrib

2012-06-22 Thread Kurtis Mullins
Hey, Here's some sample code just from reading what you've provided. from django.contrib.auth.models import User users_in_country = User.objects.filter(cUser__name="some_country_name") if bool(users_in_country): # Check to make sure there's at least one User in the Country for user in users:

Re: Select * from users,country where country.id = users.id in Django using amin.contrib

2012-06-22 Thread django noob
Bump! On Monday, June 18, 2012 9:13:50 PM UTC+1, django noob wrote: > > Greetings Django Experts! > > Say for example i have the following on my models.py > > > class Country(models.Model): > name = models.CharField(max_length=50) > > def __unicode__(self): > return u'%s %s' % (self.name

Re: Import error

2012-06-22 Thread Emily
Kurtis, Adrian and Daniel, thank you so much for your help, it actually worked I have programmed in java 70% of my life Now I want to send sms to my users when they sign up in the website. There is some package I have seen which looks like it is from an email to the phone. Does it work with messa

Re: Where I am wrong in loading static files ?

2012-06-22 Thread Kurtis Mullins
Here's a vaguely similar post: http://stackoverflow.com/questions/6409920/django-static-files-from-app-directories Like one of the respondents recommended, try adding a "print str(STATICFILES_DIRS)" in your settings.py and then run "runserver" so you can see what actual directories are being inclu

Re: Taking advantage of multiple cores

2012-06-22 Thread Kurtis Mullins
Basically, you just need to run multiple instances of your Django web-application. I've never used Apache for this (I'm an Nginx + uWSGI fan, myself) but you'd just run multiple worker processes and your WSGI handler should "balance" between them. Like the others mentioned, make sure to use a comm

Re: Duplicate rows with same key in DB?

2012-06-22 Thread Kurtis Mullins
You could also put a unique_together statement in your Model. If you do this, you'll need to update your database as well to enforce the constraint at the database level. On Fri, Jun 22, 2012 at 10:52 AM, Daniel Roseman wrote: > On Friday, 22 June 2012 06:23:32 UTC+1, ydjango wrote: >> >> I have

Re: Import error

2012-06-22 Thread Kurtis Mullins
+1 on pulling the "random_password()" method out of the Class and setting it up as a module object. I'd still suggest using this sort of an import statement on it, though: from myproject.myapp.helpers import random_password Where in this example you'd substitute your Project name with "myproject"

Re: Django learning

2012-06-22 Thread Kurtis Mullins
> > You're supposed to load the shell with `./manage.py shell` rather than > going directly into Python. That is explained in the tutorial. > -- > DR. > > +1 -- However, I recommend installing the package "ipython" when using the Django Shell. For example, run: "pip install ipython". This will giv

Re: Import error

2012-06-22 Thread Daniel Roseman
On Friday, 22 June 2012 15:49:31 UTC+1, aid wrote: > > > Hi Emily, > > On 22 Jun 2012, at 15:46, Emily wrote: > > > This is the class I created... > > > > import string > > import random > > > > class Helpers: > > > > def random_password(): > > Take random_password outside of the Help

Re: Duplicate rows with same key in DB?

2012-06-22 Thread Daniel Roseman
On Friday, 22 June 2012 06:23:32 UTC+1, ydjango wrote: > > I have code as > > view_a(request): > Populate my_a, my_b and my_c... > try: > tp = TP.objects.get(a__exact = my_a, b__exact = my_b) > except TP.DoesNotExist, e: > tp = TP() > tp.a = my_a > tp.b = my_b >

Re: Import error

2012-06-22 Thread Adrian Bool
Hi Emily, On 22 Jun 2012, at 15:46, Emily wrote: > This is the class I created... > > import string > import random > > class Helpers: > > def random_password(): Take random_password outside of the Helpers class and you should be OK. On the import statement you need to refer to a 'top

Re: Import error

2012-06-22 Thread Emily
This is the class I created... import string import random class Helpers: def random_password(): '''a method to generate random password''' lengthOfPassword = random.randint(6,10) password_len = lengthOfPassword password = [] for group in (string.asci

Re: Import error

2012-06-22 Thread Emily
This is the views.py file from helpers import random_password from django.views.generic.edit import CreateView from django.views.generic.list import ListView from Prototype.forms import StudentForm, LecturerForm, PaymentForm from Prototype.models import Guideline, Student, Lecturer, Payment from P

Re: Taking advantage of multiple cores

2012-06-22 Thread Javier Guerra Giraldez
On Fri, Jun 22, 2012 at 9:35 AM, Oleg Korsak wrote: > > That's what mod_wsgi does! exactly. specifically, Django is by itself, a shared-nothing library. that means that you can run many instances of it. not only on several cores but also on many different hosts. Just be sure that anything tha

Re: Taking advantage of multiple cores

2012-06-22 Thread Oleg Korsak
That's what mod_wsgi does! 2012/6/22 Jonathan Hayward > Will a slightly older version of Pinax, installed on top of a newer > version of Django, take advantage (or be configurable to take advantage) of > multiple cores? > > In other words, if one request is rendering and another request comes in

Taking advantage of multiple cores

2012-06-22 Thread Jonathan Hayward
Will a slightly older version of Pinax, installed on top of a newer version of Django, take advantage (or be configurable to take advantage) of multiple cores? In other words, if one request is rendering and another request comes in while the first is rendering, will Django or Pinax offload the se

Re: Import error

2012-06-22 Thread Kurtis Mullins
Hey emily, I think the other guys were just wanting to see your import statement that's broken. It should be something along these lines if you want to give it a try: from myproject.myapp.myhelpers import random_password Of course you'd substitute your project name, the application name, and the

Re: Django learning

2012-06-22 Thread Daniel Roseman
On Friday, 22 June 2012 07:15:53 UTC+1, lovetoprogram wrote: > > I tried to do this according the tutorial. > >>> from django import template > >>> t = template.Template('My name is {{ name }}.') > >>> c = template.Context({'name': 'Adrian'}) > >>> print t.render(c) > My name is Adrian. > >>>

Re: Import error

2012-06-22 Thread Emily
so your point is that I should post my code. When I did that some time, I was told that the people who were trying to help me did not want to know what is in my code so I should just explain what I want them to help me with. But thank you any way, you point has been driven home. On Fri, Jun 22, 20

Re: Any clue why Facebook iframe would be blank?

2012-06-22 Thread Kurtis Mullins
On Fri, Jun 22, 2012 at 3:59 AM, Gabriel - Iulian Dumbrava < gabriel.dumbr...@gmail.com> wrote: > Hi, > I think something similar happen to me when I set the width of the iframe > to be too narrow. I'm not very sure, but maybe you cand check it out. > > Gabriel > Hey Garbiel, I actually figured

Where I am wrong in loading static files ?

2012-06-22 Thread surya
This is my project folder hierarchy: project \ project \ __init__.py settings.py urls.py views.py ... etc templates \ css \

Re: Import error

2012-06-22 Thread Cal Leeming [Simplicity Media Ltd]
Hi Emily, Here is a really good article (written by the very people who contribute to this list) on how to ask questions on the mailing list: https://code.djangoproject.com/wiki/UsingTheMailingList It tells you what you can do to try and resolve the issue yourself, and what sort of information y

How to render a modeladmin dynamically?

2012-06-22 Thread Thomas Weholt
In a view, I need to get a modeladmin for a model provided dynamically, change some of the attributes of the modeladmin ( add an aggregated field to the queryset, order the queryset by that field and add a column for that new field in the list_display of the modeladmin ) and render the request usi

Re: Import error

2012-06-22 Thread Marcin Tustin
Dear Emily, Do you expect us to already have a copy of your code? If not, we need to have a short, self-contained, and correct example demonstrating your issue. Marcin On Fri, Jun 22, 2012 at 8:43 AM, Emily wrote: > Dear Marcin, > > I do not understand. > I think I have done everything right a

Re: Import error

2012-06-22 Thread Emily
Dear Marcin, I do not understand. I think I have done everything right and I am trying to find the source of the error where if there is someone who has experienced it they might be knowing where it is coming from.. Emily On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin wrote: > Please take a loo

Re: Import error

2012-06-22 Thread Marcin Tustin
Please take a look at: Short, Self Contained, Correct Example There's also some good advice at: What have you tried? - Matt Gemmell On Fri, Jun 22, 2012 at 8:10 AM, Emily N wrote: > Hi django users, > I seem to have gotten a problem. > > I create

Import error

2012-06-22 Thread Emily N
Hi django users, I seem to have gotten a problem. I created a helper class in my project and I have failed to import the methods in it. Please help... This is the error I get... ImportError at /admin/ cannot import name random_password Request Method: GET Request URL: http://127.0.0.1:8000/

direct_to_template (with same name template) in a multi-app project

2012-06-22 Thread Joris A
Hello all, I am developping a second app in the same project and want to use a simple.direct_to_template view. Both of my app require a login from user, thus I have in both app a login page. With a lot of creativity I named both of my login pages and index pages ; login and index, with the corres

Re: custom db field as filter in admin

2012-06-22 Thread Melvyn Sopacua
On 22-6-2012 12:58, Bram de Jong wrote: > On Fri, Jun 22, 2012 at 12:27 PM, Melvyn Sopacua > wrote: >> On 22-6-2012 12:09, Bram de Jong wrote: >> >>> However, when I turn this field into a filter in the admin, instead of >>> seeing the filter-versions as my string (i.e. "1.0.5rc3") I see it as >>

Re: Time zone (Django 1.4) questions

2012-06-22 Thread Klaas van Schelven
Hi Aymeric, Thanks for the answers! I've decided to postpone the migration on one of our bigger projects to USE_TZ = True until after I have some experience with proper time zone handling in a greenfield project. This won't last forever, though, and once I get to it I'll report back with any glob

Re: custom db field as filter in admin

2012-06-22 Thread Bram de Jong
On Fri, Jun 22, 2012 at 12:27 PM, Melvyn Sopacua wrote: > On 22-6-2012 12:09, Bram de Jong wrote: > >> However, when I turn this field into a filter in the admin, instead of >> seeing the filter-versions as my string (i.e. "1.0.5rc3") I see it as >> the underlying database type (i.e.1301) > >

Re: custom db field as filter in admin

2012-06-22 Thread Melvyn Sopacua
On 22-6-2012 12:09, Bram de Jong wrote: > However, when I turn this field into a filter in the admin, instead of > seeing the filter-versions as my string (i.e. "1.0.5rc3") I see it as > the underlying database type (i.e.1301) I suspected there is another code path that doesn't call to_python

Re: PicklingError: Can't pickle : it's not the same object as pytz._UTC

2012-06-22 Thread Florian Apolloner
Hi, I've never ran into this and the only way I can reproduce it is: http://bpaste.net/show/29LVTwRDX5DIgUSDE6D9/ -- So my question to you is: What exactly are you doing, how are you deploying, do you have code reloading active somewhere? Cheers, Florian -- You received this message because

custom db field as filter in admin

2012-06-22 Thread Bram de Jong
Hello all, I have a custom DB field: a version string like "1.0.5rc3" which is actually stored as an int in the db. After fidling around a bit I managed to make the field so that everything you would think should work works. It looks like a version string everywhere, I can input it as a version s

Re: django.contrib.humanize naturaday not working with USE_TZ = True

2012-06-22 Thread Aymeric Augustin
Le dimanche 13 mai 2012 04:33:33 UTC+2, James Zheng a écrit : > > has anyone else run into the problem below? Hi James, Since you're talking about USE_TZ, I suppose you're using Django 1.4. But the code you're quoting no longer exists in that version: https://github.com/django/django/commit/9b1

Re: Time zone support enabled in Django 1.4, yet "Django does not support timezone-aware times"

2012-06-22 Thread Aymeric Augustin
Le mardi 22 mai 2012 02:57:05 UTC+2, Arthur a écrit : > > I recently upgraded one of my machines to Django 1.4 to patch a bug > related to the use of PostGIS 9.1. I read the documentation on the new > support for time zones and added USE_TZ=True to my settings.py file. > Nonetheless, when I atte

Re: Time zone (Django 1.4) questions

2012-06-22 Thread Aymeric Augustin
Le jeudi 21 juin 2012 13:36:53 UTC+2, Aymeric Augustin a écrit : > > I haven't written that script and I don't know anyone else who has. No > promises, but since you need it, I may find the motivation to write it. > Here you go: https://gist.github.com/2971450 The script is designed to handle a

Re: Any clue why Facebook iframe would be blank?

2012-06-22 Thread Gabriel - Iulian Dumbrava
Hi, I think something similar happen to me when I set the width of the iframe to be too narrow. I'm not very sure, but maybe you cand check it out. Gabriel marți, 19 iunie 2012, 23:03:36 UTC+3, Kurtis a scris: > > *Bump* > > I've been trying to diagnose this problem. I have no idea what's going

Re: Monitoring memory usage of an external component

2012-06-22 Thread Eugene Gavrish
> *Does anyone here use a tool to monitor memory usage by individual > processes (or groups thereof), and run commands when certain levels are met? > * I'd like to kill and restart my java service (through supervisor) when it > gets above a certain size. simple bash-script with ps aux | grep java

Re: Django learning

2012-06-22 Thread Tomás Garzón Hervás
Hi, you have to indicate where is the settings file to django. You can use the environment variable DJANGO_SETTINGS_MODULE. More info: https://docs.djangoproject.com/en/dev/topics/settings/#using-settings-without-setting-django-settings-module On Friday, June 22, 2012 8:15:53 AM UTC+2, lovetop

Re: runserver cache my template files

2012-06-22 Thread Tomás Garzón Hervás
Yes, and I reload the browser with empty cache. thanks On Friday, June 22, 2012 9:02:23 AM UTC+2, bruno desthuilliers wrote: > > I assume you did check your browser cache ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussio

runserver cache my template files

2012-06-22 Thread bruno desthuilliers
I assume you did check your browser cache ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/vcMDF4DurtYJ. To post to this group, send email to django-users