Re: Django Troubleshooting

2012-10-22 Thread Sun Simon
Thank you sir. It works! On Sunday, October 21, 2012 7:55:23 AM UTC+8, Amyth wrote: > > Yeah, > > those are CLI commands. Although "tar" and "sudo" would not work with > windows as they are linux terminal commands. you may follow this easy step > by step procedure on how to setup django on > wi

Re: environment variable DJANGO_SETTINGS_MODULE is undefined.

2012-10-22 Thread Mike Dewhirst
On 23/10/2012 8:37am, DjgoNy wrote: I have problem importing from django_tables import tables and when i do it on manage.py shell i get this error. >>> import django_tables2 Traceback (most recent call last): File "", line 1, in File "build\bdist.win32\egg\django_tables2\__init__.py", l

Re: urls.py and default values...

2012-10-22 Thread Lachlan Musicman
On Mon, Oct 22, 2012 at 5:39 PM, Tomas Ehrlich wrote: > Hello, > you need to make 'year' argument optional: > > def student_reports(request, year=None): > year = year or datetime.date.today().year > ... Perfect - thanks > > Another option could be passing extra option to you view funct

Re: invalid literal for int() with base 10

2012-10-22 Thread Nathan Knight
Just so you know, it is bad practice to use "import * " when importing modules in python. With many modules being used, you can run into conflicting definitions. Plus, it increases overhead - potentially an exponential decrease in performance! -- You received this message because you are subs

environment variable DJANGO_SETTINGS_MODULE is undefined.

2012-10-22 Thread DjgoNy
I have problem importing from django_tables import tables and when i do it on manage.py shell i get this error. >>> import django_tables2 Traceback (most recent call last): File "", line 1, in File "build\bdist.win32\egg\django_tables2\__init__.py", line 3, in File "build\bdist.win32\egg

strange problem with dajaxice and javascript

2012-10-22 Thread cingusoft
hi all i have a javascript callback function that return a data json string from a dajaxice view this is the callback function function message_callback(data){ alert(data.id); var id_book = data.id; var uploader = $('#uploader').pluploadQueue({ url : '/admin/ecommerce/b

Re: django doesnt accept the serializeArray POST data

2012-10-22 Thread Doug Ballance
I'm guessing it is a result of not having a csrf token set for the post: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups

FormWizard for shop checkout

2012-10-22 Thread KentH
Hi, I'm trying to use FormWizard for an e-checkout application. Trying to perform the actual "charge" in the "done" step is problematic as you can't go back if the charge fails. Is there a right way to do this? For example of what steps look like, just imagine the steps as listed in the FormW

Re: Profiling tools?

2012-10-22 Thread Nikolas Stevenson-Molnar
I recommend django-debug-toolbar: https://github.com/django-debug-toolbar/django-debug-toolbar _Nik On 10/21/2012 7:25 PM, zweb wrote: > > I am using Django 1.3.1 > > I want to know in my application how much time is taken by a) database > access b) creation of XML c) other parts of code. What wo

django doesnt accept the serializeArray POST data

2012-10-22 Thread David Lee
Hi,all! I got a problem, https://github.com/blueimp/jQuery-File-Upload/issues/1792 , does Django doesnt accept the serializeArray POST data request or how to do it ? any help will greatly appreciated. -- You received this message because you are subscrib

Re: Getting a strange error message when setting mysql database

2012-10-22 Thread alfa
I've just figured out that the password set was wrong. I previously passed as the root one, which was wrong. Now, it worked out of the box. On Monday, October 22, 2012 3:35:44 PM UTC+2, alfa wrote: > > Hi, > > After setting the following: > > 'ENGINE': 'django.db.backends.mysql', # post

Re: Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-10-22 Thread Tommy DANGerous
Thanks everyone for the help. I've gone through several tutorials, such as the one on the Django website and at http://lightbird.net/dbe/. Just trying to get more familiar with Django before I start trying to write it on my own. I'll take a look at the Django Book and the youtube videos you all

Re: Raising a ValidationError in a custom field's to_python method?

2012-10-22 Thread Nicolas Dandrimont
On lun., oct. 22 2012, Nicolas Dandrimont wrote: > #--8<{ fields.py }>8--# > import netaddr > > from django.core.exceptions import ValidationError > from django.db import models > > [...] > def to_python(self, value): > if not isinstance(value, netaddr.EUI): >

Getting a strange error message when setting mysql database

2012-10-22 Thread alfa
Hi, After setting the following: 'ENGINE': 'django.db.backends.mysql', # postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'testdb', # Or path to database file if using sqlite3. 'USER': 'testuser', # Not used with sq

Raising a ValidationError in a custom field's to_python method?

2012-10-22 Thread Nicolas Dandrimont
Hello, I'm trying to write a custom field for use with the netaddr.EUI python class (which allows manipulations on MAC Addresses, access to the OUI database, and other fancy stuff). To do so, I'm subclassing model.Field, and overriding the to_python and get_prep_value methods. The class instantia

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-22 Thread Louise OTT
I found where the problem is... It is not a problem in the ManyToManyField but in the intermediate table. Django refused that my intermediate table doesn't have an unique id ! So, in the sql which created django, it created automatically an unique id named "id", but in my database I didn't cr

ImportError on apache server

2012-10-22 Thread Dae_James
When I run my website on apache, the error as the following picture shows happened. However, when I run it on development server, the error doesn't happened. -- You received th

Only one profile type of multiple user profiles types gets created.

2012-10-22 Thread Nicolas Emiliani
Hi! I'm trying to use different types of profiles on django 1.4, I basically followed this : https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users The thing is that the docs only apply if you have one profile type, and i have four. Doing some research i fo

Re: My page cound not load image, help!

2012-10-22 Thread Xavier Ordoquy
Le 22 oct. 2012 à 15:13, Dae_James a écrit : > I use ImageField(with upload_to = 'photos') to receive user-uploaded images. > And in my template, I want to use (image > is the object of ImageField) to display them. However, images can't be > displayed. I think it's not about static files. If

Re: My page cound not load image, help!

2012-10-22 Thread Dae_James
I use *ImageField*(with upload_to = 'photos') to receive user-uploaded images. And in my template, I want to use **(image is the object of ImageField) to display them. However, images can't be displayed. I think it's not about static files. If it is, what's the use of ImageField's url property.

Re: My page cound not load image, help!

2012-10-22 Thread Amyth Arora
Serve the image as a static file. in your settings.py file set the following: STATIC_URL = '/static/' STATICFILES_DIRS = ('/path/to/your/image/directory',) # Without a trailing slash and then load your image as On Mon, Oct 22, 2012 at 5:14 PM, Joel Goldstick wrote: > On Mon, Oct 22, 2012 at 6

In future can we expect things like Annotation based urls , validation , manytomany relationships etc in django like in symfony2 and hibernate

2012-10-22 Thread Pasha
I Initially i was using Symfony1.4 framework and i didn't liked that much but was good. Then when Symfony2 came i never looked back at other php framework with things like annotation , service classes , repository classes , it almost similar to Spring/Hibernate of java at enterprise level. No

Re: Gunicorn vs Chaussette vs Meinheld

2012-10-22 Thread Tarek Ziadé
On Monday, October 22, 2012 1:09:56 PM UTC+2, Santiago Basulto wrote: > > Hello people. Reading about Circus[1] I ran into a couple of different > "WSGI servers" that I haven't heard before (Chaussette[2] and Meinheld[3]). > My question is if those are all similar to Gunicorn (and can be used >

Re: Gunicorn vs Chaussette vs Meinheld

2012-10-22 Thread Tarek Ziadé
Oh sorry, that was the other way around - I was getting confused too :) Meinheld can act as a worker in gunicorn, and in this case you don't use the meinheld web server but just its nice async features like gevent Meinheld also provide a built-in wsgi server, that is used in Chaussette -- Yo

Re: My page cound not load image, help!

2012-10-22 Thread Joel Goldstick
On Mon, Oct 22, 2012 at 6:00 AM, Dae James wrote: > The returned html code by my app is : > The "image.jpg" file is in "project_dir/photos/" directory. PS: project_dir > is my django project's root directory. > > So why the image could not be loaded. Please help~ > Thank you~ > Because your image

Gunicorn vs Chaussette vs Meinheld

2012-10-22 Thread Santiago Basulto
Hello people. Reading about Circus[1] I ran into a couple of different "WSGI servers" that I haven't heard before (Chaussette[2] and Meinheld[3]). My question is if those are all similar to Gunicorn (and can be used instead of the last) or are just complementary servers. One thing that really

Re: Struggling with static files

2012-10-22 Thread DJ-Tom
Am Montag, 22. Oktober 2012 12:06:44 UTC+2 schrieb DJ-Tom: > > If I add this to STATICFILES_DIR: > > '/el_test/static' > > AHHH - I was missing the trailing comma after the path name... so STATICFILES_DIR was not a valid list. Everthing's fine now. Thanks anyways :-) Thomas -- You

Re: Struggling with static files

2012-10-22 Thread DJ-Tom
Am Montag, 22. Oktober 2012 11:19:42 UTC+2 schrieb Xavier Ordoquy: > > Hi, > > Your static folder should be declared in STATICFILES_DIRS if you want him > to be served (see > https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage about > that). > > > All the documentation ref

My page cound not load image, help!

2012-10-22 Thread Dae James
The returned html code by my app is : The "image.jpg" file is in "project_dir/photos/" directory. PS: project_dir is my django project's root directory. So why the image could not be loaded. Please help~ Thank you~ Dae James -- You received this message because you are subscribed to the G

Re: Django Troubleshooting

2012-10-22 Thread Jani Tiainen
19.10.2012 7:07, Sun Simon kirjoitti: https://www.djangoproject.com/download/ I am installing Django for Python on Win XP and came across this problem during installation: |tar xzvf Django-1.4.2.tar.gz cd Django-1.4.2 sudo python setup.py install What does "cd" mean? DOes it mean that I have

Re: Struggling with static files

2012-10-22 Thread Xavier Ordoquy
Le 22 oct. 2012 à 11:25, Pervez Mulla a écrit : > something like this in your setting.py > > STATIC_ROOT = ''/home/john/yourprojectdir/yourappdir/staic/" This is precisely what you shouldn't do. The STATIC_ROOT is where files are copied to for production using the collectstatic command. This

Re: Struggling with static files

2012-10-22 Thread Pervez Mulla
something like this in your setting.py STATIC_ROOT = ''/home/john/yourprojectdir/yourappdir/staic/" On Mon, Oct 22, 2012 at 2:48 PM, Xavier Ordoquy wrote: > Hi, > > Your static folder should be declared in STATICFILES_DIRS if you want him > to be served (see > https://docs.djangoproject.com/en

Re: Struggling with static files

2012-10-22 Thread Xavier Ordoquy
Hi, Your static folder should be declared in STATICFILES_DIRS if you want him to be served (see https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage about that). Please take care to give another name to STATIC_ROOT for production settings. Regards, Xavier Ordoquy, Linovia.

Re: Struggling with static files

2012-10-22 Thread Pervez Mulla
Give path to your STATIC_ROOT of your static folder. Pervez On Mon, Oct 22, 2012 at 2:26 PM, DJ-Tom wrote: > Hi, > > I'm fairly new with Django and currently I'm only "playing around" to get > a better feeling for the framework. > > I have read the documentation and almost all of the posts her

Struggling with static files

2012-10-22 Thread DJ-Tom
Hi, I'm fairly new with Django and currently I'm only "playing around" to get a better feeling for the framework. I have read the documentation and almost all of the posts here about configuring static files with the development server but can't get it working. I wanted to modify the admin lo

Re: querying data from Django userena profile.

2012-10-22 Thread Subhodip Biswas
Hi all, I have done a workaround the initial problem, all i did was add the custom field into my apps models.py. This led to the data entered in the custom field of signup form is shown in the edit_details page of the user profile. However, unlike other data fields in edit_profile, this custom fie

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-22 Thread Louise OTT
Ok, it is still not working. Django can't find the intermediate table. And I can't put an "inlines" into an "inlines" ! My RunHasSample are already in a field "inlines" in the RunAdmin, so I cannot put the lines in an "inlines" field into the class RunHasSamplesInLine -- You received this me

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-22 Thread Louise OTT
> > In [10]: run1= Run(project=Project.objects.get(pk=1), > sequencing_type=SequencingType.objects.get(pk=1)) > In [11]: run1.save() > In [12]: Run.objects.all() Out[12]: [] > In [13]: s1=RunHasSample(run=run1, sample=Sample.objects.get(pk=1), > dna_quantification_ng_per_ul=1) > In [14]

Re: Profiling tools?

2012-10-22 Thread Larry Martell
On Sunday, October 21, 2012, zweb wrote: > > I am using Django 1.3.1 > > I want to know in my application how much time is taken by a) database > access b) creation of XML c) other parts of code. What would be some good > tools to profile my application? > > The code to be profiled is in django vi