The DjangoCon US 2014 CfP is open.

2014-06-11 Thread Christophe Pettus
The short version: Go here. Send us papers: http://www.djangocon.us/call_for_proposals/ Djangocon US is back in its home of Portland, Oregon for 2014, and we would like to get your contributions! We are looking for talk proposals (25 minutes, 45 minutes, and tutorials) from the

Re: Django on App engine

2014-06-11 Thread Adam Simon
This is a great question! I would also like to hear some answers ... Adam On Thursday, May 1, 2014 4:46:38 AM UTC-7, Venkatraman.S. wrote: > > Hi, > > Has anyone or is anyone running a reasonably large django webapp on GAE? > Looks like it has become >

Re: Re: Massive import in Django database

2014-06-11 Thread moqianc...@gmail.com
Hi, John: Sorry! The pseudo code write by me is not correct, and It's slow.. I will come back tonight. With Regards, Qiancong,Mo From: moqianc...@gmail.com Date: 2014-06-11 23:47 To: django-users Subject: Re: Massive import in Django database Hi, John: I think your code is right, except

Re: Change settings.DEBUG in response to a request's source

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
Although I can't comment on your individual use case, it's better to enable remote error collection using something like Sentry or BugSnag. Both also support integration with other languages, such as JS, which is very handy when tracking down front end problems. There are lesser alternatives such

Re: Admin site doesn't work

2014-06-11 Thread Glen J
urls.py: from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^mysite/',

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Understood, got that error cleared now. Just a last question - should my HoleImages not present their upload options in the Hole part of the admin?

RE: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Ilya Kazakevich
Instead of from holes.models import HoleImage write from holes.models import HoleImage, Hole Please read https://docs.python.org/2/tutorial/modules.html Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with pleasure!" >-Original

Change settings.DEBUG in response to a request's source

2014-06-11 Thread Silas Snider
I'm writing an app where it'd be super helpful for logged-in users from my company to see error pages and the like as though the app was running with DEBUG=True, while still preventing ordinary users from seeing that output. I see that the docs strongly warn me against changing settings at

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Thanks Ilya, I will go through that this evening - I tend to learn through hardship, banging my head off the wall, walking away and finding a moment of clarity, I'm quick to understand the logic and approach but I leant the language / syntax through repetition. On Wednesday, June 11, 2014

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Should it be this: from django.contrib import admin from holes.models import HoleImage class HoleImageInline(admin.TabularInline): model = HoleImage class HoleAdmin(admin.ModelAdmin): fields = ['hole_number', 'hole_name', 'hole_description'] list_display = ['hole_number',

RE: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Ilya Kazakevich
Hello, I believe you should start with Python tutorial: https://docs.python.org/2/tutorial/ After you complete it, you may go to Django tutorial. It is generally a good idea to study basic language concepts, syntax and standard library before studying any framework (you've learned PHP

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Jorge Andrés Vergara Ebratt
Oh and in the last line, admin.site.register, use the model you want to register in the Admin On Jun 11, 2014 3:41 PM, "Patrick C" wrote: > Hi Jorge, > > Thanks for helping out - I understand that and have just tried it but > still get the error: > > NameError at

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Jorge Andrés Vergara Ebratt
When you import HoleImage don't remove Hole :) On Jun 11, 2014 3:41 PM, "Patrick C" wrote: > Hi Jorge, > > Thanks for helping out - I understand that and have just tried it but > still get the error: > > NameError at /admin/ > > name 'Hole' is not defined > > Request

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Hi Jorge, Thanks for helping out - I understand that and have just tried it but still get the error: NameError at /admin/ name 'Hole' is not defined Request Method:GETRequest URL:http://127.0.0.1:8000/admin/Django Version: 1.6.5Exception Type:NameErrorException Value: name 'Hole' is not

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Jorge Andrés Vergara Ebratt
In admin.py you have from hotels.models import Hole Add HoleImage to that import On Jun 11, 2014 3:19 PM, "Patrick C" wrote: > Hi All, > > New to Django / Python (coming from PHP). > > Trying to make a site for a golf course where there is a hole by hole > guide,

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Hi Ilya, Thanks for the swift reply, sorry for the noob question but can you elaborate on "but you forgot to import HoleImage" - I'm not quite following, I'm sure I will understand it once explained. I'm only about 4 hours into my first workings with Python / Django, perhaps I'm jumping in a

Re: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Jorge Andrés Vergara Ebratt
You need to import HoleImage in admin.py On Jun 11, 2014 3:19 PM, "Patrick C" wrote: > Hi All, > > New to Django / Python (coming from PHP). > > Trying to make a site for a golf course where there is a hole by hole > guide, each hole has a number, name, description

RE: NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Ilya Kazakevich
To use any symbol (including " HoleImage" class) you need to import it first. You've imported Hole (from holes.models import Hole), but you forgot to import HoleImage. So, you got " name 'HoleImage' is not defined " error. It is better to use IDE, because it helps you in such cases :) Ilya

NameError at /admin/ name 'HoleImage' is not defined

2014-06-11 Thread Patrick C
Hi All, New to Django / Python (coming from PHP). Trying to make a site for a golf course where there is a hole by hole guide, each hole has a number, name, description then multiple images for the gallery. I've spend the last few hours googling how I'm going wrong here because I get the

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-11 Thread Rini Michael
Thank you Javier On Tue, Jun 10, 2014 at 6:47 PM, Javier Guerra Giraldez wrote: > On Tue, Jun 10, 2014 at 6:43 AM, Rini Michael > wrote: > > Thanks for your reply,i have been looking into celery as well,but i found > > that celery is used for periodic

RE: implementing a ticket submission system

2014-06-11 Thread Ilya Kazakevich
Hello, Use Primary Key: https://docs.djangoproject.com/en/dev/topics/db/models/#automatic-primary-key-fields Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with pleasure!" >-Original Message- >From: django-users@googlegroups.com

implementing a ticket submission system

2014-06-11 Thread Anurag Baidyanath
i am implementing a ticket submission system whose model.py file looks loke this: class Ticket(models.Model): user_id=models.ForeignKey(User) category_id=models.ForeignKey(Category) subject=models.CharField(max_length=100) message=models.TextField(help_text="enter message")

Re: Django and Javascript

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
This is quite an open ended question, and touches on the subject of asset pipelines. This also touches on the whole debate around how JS applications should be developed, libraries such as Ansible and Backbone may impact your style/preference. The closest library I've seen so far is

Re: Django and Javascript

2014-06-11 Thread César García Tapia
Not really. I'm not looking for an answer to a specific question. I'm just looking for a "good practices manual" on writing and deploying javascript in a django environment. El miércoles, 11 de junio de 2014 17:41:45 UTC+2, Cal Leeming [Simplicity Media Ltd] escribió: > > Have a look at how

Re: Massive import in Django database

2014-06-11 Thread moqianc...@gmail.com
Hi, John: I think your code is right, except "Doc.object" should be "Doc.objects"; The following pseudo code maybe fater than what you write: doc_map = {} for each xml: extract from the xml data -> mydoc_code, mydoc_text, myRelated_doc_codes doc = Doc.objects.create(doc_code=mydoc_code,

Re: Django and Javascript

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
Have a look at how Stripe do it [1]. https://js.stripe.com/v2/";> Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY'); I think this is what you're asking for (if I've understood your question correctly). Cal [1] https://stripe.com/docs/stripe.js On Wed, Jun 11, 2014 at 4:22 PM, César

Django and Javascript

2014-06-11 Thread César García Tapia
Hi. Probably this is an old subject, and it's been argued lots of times, but I guess I need some help to find the right resources. When building a real-world django application, you need javascript. Lots of it. Making JS talk to django is more or less easy: $.ajax(), django-rest-framework,

Re: django installation

2014-06-11 Thread Bill Freeman
Still, the OP's command should have worked. The most likely problem is that Django was installed to a different python than the one he gets when he types "python" at the shell. He does not say how he installed Django, so it is hard to advise. On Wed, Jun 11, 2014 at 6:23 AM, Daniel Roseman

Re: Empty Javascript translation array

2014-06-11 Thread Alexandr Berdnikov
It's been quite a while since 2009 but I'm really curious if you solved this problem :) I'm currently experiencing same issue and didn't find any answers\tips so far. On Tuesday, January 20, 2009 10:57:47 PM UTC+2, Scott wrote: > > Hi there, > > I've just got the JS catalogs working on my

LiveServerTestCase modifies production database when ran in python script

2014-06-11 Thread yakkadesign
When I run my tests in a python script it modifies my production database. If I run from the command line it doesn't. When I say modify, it wipes out my existing users and replaces them with the users I create for testing. I followed this for the setup:

Re: distinct().filter() applies filter before distinct

2014-06-11 Thread Derek
It might be worth comparing the SQL that Django generates versus what you would write (or want to write) by hand: MyModel.objects.all().query.sql_with_params() On Tuesday, 10 June 2014 23:17:30 UTC+2, John Rambo wrote: > > This better illustrates what I mean: > > >

simple comparison?

2014-06-11 Thread MikeKJ
if userform.is_valid(): name = userform.cleaned_data['name'] email = userform.cleaned_data['email'] username = userform.cleaned_data['username'] password = userform.cleaned_data['password'] orgs = Organisation.objects.all() #

Re: Re: Django Python roop

2014-06-11 Thread Javier Guerra Giraldez
On Wed, Jun 11, 2014 at 8:12 AM, moqianc...@gmail.com wrote: > write right code, write clean code, It's a basic rule for our develope > work. for that you have to learn what the code means. "while x !=[]:" will always be an endless loop. the "[]" doesn't do what you

Re: Django Python roop

2014-06-11 Thread hito koto
Ok, thank you! 2014年6月11日水曜日 21時52分54秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think the problems you asked should be post in python-lang mail-list. > For python program, I prefer "for", not "while"; It's more simpler. > But if you like while, I think the following code maybe helpful: >

Re: Django Python roop

2014-06-11 Thread Erik Cederstrand
Den 11/06/2014 kl. 14.49 skrev hito koto : > MemoryError , Why? idon't know. > I try this have Traceback (most recent call last): > File "", line 1, in > File "", line 5, in foo > MemoryError errors: > > I'm change to this code: have the Memory Error, > > def

Massive import in Django database

2014-06-11 Thread John Carlo
Hello everybody, I've fallen in love with Django two years ago and I've been using it for my job projects. In the past I found very useful information in this group, so a big thank you guys! I have a little doubt. I have to import in Django db (sqlite for local development, mySql on the

Re: Re: Django Python roop

2014-06-11 Thread moqianc...@gmail.com
Sometimes, I have to use while statement too. But any time, I think write right code, write clean code, It's a basic rule for our develope work. moqianc...@gmail.com From: hito koto Date: 2014-06-11 21:05 To: django-users Subject: Re: Django Python roop Hi, qiancong: Thank you, Do you not

Re: Re: Django Python roop

2014-06-11 Thread moqianc...@gmail.com
In your function, if x is not a empty list, then while will be a infinite loop, x always not be []; then the inner for-loop will append many many items into y list, Then your computer will say "have the Memory Error", to tell you the memory not enought. moqianc...@gmail.com From: hito

Re: Django Python roop

2014-06-11 Thread hito koto
Hi, qiancong: Thank you, Do you not use the while statement to Django? 2014年6月11日水曜日 21時52分54秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think the problems you asked should be post in python-lang mail-list. > For python program, I prefer "for", not "while"; It's more simpler. > But if

Re: Django Python roop

2014-06-11 Thread hito koto
hi, Ilya Kazakevich: I would like to change the while statement from the for statement 2014年6月11日水曜日 21時49分32秒 UTC+9 hito koto: > > MemoryError , Why? idon't know. > I try this have Traceback (most recent call last): > File "", line 1, in > File "", line 5, in foo > MemoryError errors: >

Re: Django Python roop

2014-06-11 Thread moqianc...@gmail.com
Hi, hito koto: I think the problems you asked should be post in python-lang mail-list. For python program, I prefer "for", not "while"; It's more simpler. But if you like while, I think the following code maybe helpful: def fff(x): y = [] i = 0 xlen = len(x) while i< xlen: y.append(x[i]) i

Re: Django Python roop

2014-06-11 Thread hito koto
MemoryError , Why? idon't know. I try this have Traceback (most recent call last): File "", line 1, in File "", line 5, in foo MemoryError errors: I'm change to this code: have the Memory Error, def foo(x): y = [] while x != []: for i in range(len(x)):

Re: Admin site doesn't work

2014-06-11 Thread Sanjay Bhangar
On 11 Jun 2014 18:04, "Glen J" wrote: > Sanjay, > Thanks for the reply. I've tried accessing it various ways using both > nginx and the included devserver on :8000. I've done both 127.0.0.1/admin > and 127.0.0.1/admin/ with the same results. I can post the contents of >

RE: Django Python roop

2014-06-11 Thread Ilya Kazakevich
Hello, What are you trying to do? Split string? Copy array? You probably need to use builtin functions for that. Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with pleasure!" >-Original Message- >From:

RE: error

2014-06-11 Thread Ilya Kazakevich
Hello, Try to use debugger. https://docs.python.org/2/library/pdb.html or http://www.jetbrains.com/pycharm/features/#debugger Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with pleasure!" >-Original Message- >From:

Re: Admin site doesn't work

2014-06-11 Thread Glen J
Sanjay, Thanks for the reply. I've tried accessing it various ways using both nginx and the included devserver on :8000. I've done both 127.0.0.1/admin and 127.0.0.1/admin/ with the same results. I can post the contents of my urls.py later today when I have access to my machine at home.

Re: Django python fuction

2014-06-11 Thread hito koto
hi, François : Thanks 2014年6月11日水曜日 1時22分04秒 UTC+9 François Schiettecatte: > > Wouldn't the deep copy module handle this for you: > > https://docs.python.org/2/library/copy.html > > François > > On Jun 10, 2014, at 12:17 PM, hito koto > wrote: > > > Hi,

Re: Admin site doesn't work

2014-06-11 Thread Sanjay Bhangar
hey Glen, Sorry if this is a silly question - but are you sure you are visiting /admin on your site? If you are and still getting this error, can you please paste the contents of your urls.py On Wed, Jun 11, 2014 at 4:24 PM, Glen J wrote: > I've tried it both on the

Django Python roop

2014-06-11 Thread hito koto
Hello, all I want to change to while statement from for statement, so how can i do to? this is my correct for statement codes: def fff(x): y = [] for i in range(len(x)): y.append(x[i]) return y and i want change to while statement So, this code have erroes: TypeError:

Re: Re: Django python fuction

2014-06-11 Thread hito koto
Thanks 2014年6月11日水曜日 10時37分43秒 UTC+9 Qiancong: > >  > Yeah, I think hito koto need a function like copy.deepcopy.. I think he > known copy.deepcopy before(as his example said), just not known how to > write a funtion work as copy.deecopy does for list. > > -- >

Re: Admin site doesn't work

2014-06-11 Thread Glen J
I've tried it both on the development server you indicate below as well as on a my own web server (nginx using uwsgi) and get the same results. No errors are displayed, simply the welcome page for Django. Syncdb works fine (using Postgresql) and shows output when I do it. One thing I did

Re: Poll App part 3

2014-06-11 Thread Daniel Roseman
On Wednesday, 11 June 2014 11:18:55 UTC+1, divyanshi kathuria wrote: > > In Django poll application part 3, url passed in index.html is 'detail'. I > doubt it should be 'index'. > If you think there's a bug in the tutorial, you should log a ticket in the ticket tracker and/or make a pull

Re: django installation

2014-06-11 Thread Daniel Roseman
On Wednesday, 11 June 2014 11:00:38 UTC+1, Srinivas Reddy T wrote: > > There is no need to install virtualenv to install Django. > While this is technically correct, it is not good advice to give to a newbie. Experienced developers should be encouraging best practice among newcomers, and to be

Poll App part 3

2014-06-11 Thread divyanshi kathuria
In Django poll application part 3, url passed in index.html is 'detail'. I doubt it should be 'index'. -- 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

Re: django installation

2014-06-11 Thread Sreenivas Reddy T
There is no need to install virtualenv to install Django. On 11/06/2014 1:56 pm, "Pavithra M H" wrote: > hi, first of all you should create an virtual environment and then u have > to install django, the detailed procedure is given here " > >

Re: django installation

2014-06-11 Thread Pavithra M H
hi, first of all you should create an virtual environment and then u have to install django, the detailed procedure is given here " http://www.openbookproject.net/courses/webappdev/units/webappdev2/resources/django_virtualenv.html; On Wednesday, June 11, 2014 11:10:01 AM UTC+5:30, David Moya

Re: django installation

2014-06-11 Thread Mike Dewhirst
On 11/06/2014 3:40 PM, David Moya wrote: So i supposedly installed Django because on the terminal, after going through the whole process of installation, it says "Successfully installed Django". However, when i try to run the command: python -c "import django; print(django.get_version())"I

"ResourceWarning: unclosed" error using mysql-connector-python

2014-06-11 Thread Zemian Deng
Hi there, I am using mysql-connector-python (1.1.6) with Django (1.6.5) and myapp is working fine. But each SQL call to DB will result the following warning messages: Exception ignored in: ResourceWarning: unclosed Has anyone seen this and know a way to resolve it? Also, FYI, I am using

django installation

2014-06-11 Thread David Moya
So i supposedly installed Django because on the terminal, after going through the whole process of installation, it says "Successfully installed Django". However, when i try to run the command: python -c "import django; print(django.get_version())" I get: ImportError: No module named django.

Re: Anyone interested in reviewing code for a hobby project - BookMarker

2014-06-11 Thread trojactory
Hi Aseem, > Is there some other layout? Yes. The current version of Django uses the layout mentioned in the tutorial itself: https://docs.djangoproject.com/en/1.6/intro/tutorial01/ > The second part about relative imports. I have never understood how relative imports work. I mean the syntax.