Re: Edx LDAP Auth setting

2015-02-25 Thread 'Yip Terence' via Django users
Hi M, Actually, I can connect with our AD server, but I need to hardcode the user in the connection string so that I would like to ask for the solution about how can I get the %user value and create the profile. Maybe I can paste my connection string here for more easy to understand. I

Re: Gunicorn sock file is missing?

2015-02-25 Thread Kaloian
Hi Erik, No it doesn't start at all, running the gunicorn_start script gives: *[ERROR] Retrying in 1 second.* *[ERROR] Retrying in 1 second.* *[ERROR] Retrying in 1 second.* *[ERROR] Retrying in 1 second.* *[ERROR] Retrying in 1 second.**[ERROR] Can't connect to /path/to/my/gunicorn.sock *

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-25 Thread C. Kirby
Great. It is similar to django-filters. It looks like the maintainer of filters and I started our projects at about the same time. I think that my version provides more extension hooks out of the box, but also requires more development for filtering on string-based fields. I may build out on

Re: Can the new `Prefetch` solve my problem?

2015-02-25 Thread James Schneider
Well, the Desk model you provided is blank, but I'll believe you that there's a favorite_or_nearby_chairs attribute. ;-) Should be relatively simple. Just add a .select_related('nearby_desks') to your existing query and that should pull in the associated Desk object in a single query. You can

Re: Re: how to put files in different dirs

2015-02-25 Thread 163 email
yes , what i mean is "media files". there are so many file,may be several thousands ,to be uploaded from client to server. if all files in one dir , it'll be slow. but i don't find any way put files in different dirs just using django. now i write a function to put files in different dirs

Re: Form Wizard: store the session values

2015-02-25 Thread Karim
Solved with a very easy approach. I override the WizardView get method and I use a session variable to understand if the user want to restore the edit or create a new form def get(self, request, *args, **kwargs): """ This method override the WizardView handling the restore of

Re: TypeError: __str__ returned non-string (type bytes)

2015-02-25 Thread Mike Dewhirst
Erik and James I really appreciate your feedback. The problem is resolved. It was related to py3 development and py2 in production. Erik had hit the nail on the head which I discovered when I went looking at why other tests were passing and those two were not. I had been inconsistent in

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-25 Thread Ronaldo Bahia
Hi Kirby, It seems very interesting. I'll let you know if I try it. Just for curiosity, what differentiates your project from django-filters or django-datafilters ? Thanks. *Ronaldo Bahia * 2015-02-24 12:57 GMT-03:00 C. Kirby : > I'm sorry I missed this thread at the

MySQLdb Missing Module errors

2015-02-25 Thread Rootz
I recently installed the django framework ( v1.7.4 ) and the mysql database connector ( pymysql ) for python. It is my understanding that the MySQLdb python connector is depreciated and is no longer available for download through PIP . However I installed pymysql which is an alternate download

Re: Delete the file related on the FileField

2015-02-25 Thread Karim
On Thu, Feb 26, 2015 at 2:13 AM, Rodrigo Zayit wrote: > Hi Karim, > ​[]​ > > Thank you! -- Karim N. Gorjux -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: wsgi dont have permission to access /wsgi_app on this server

2015-02-25 Thread dk
found the reason!!! is not the permission is the group doing this to the folder put into the user and group that apache can read. chown -R apache:apache myfolder from here http://stackoverflow.com/questions/21498904/forbidden-you-dont-have-permission-to-access-on-this-server-centos-6-laravel

Fwd: Can the new `Prefetch` solve my problem?

2015-02-25 Thread Ram Rachum
Hi James, I've read the docs but I still couldn't figure it out. My queryset works great in production, I'm trying to optimize it because our pageloads are too slow. I know how to use querysets in Django pretty well, I just don't know how to use `Prefetch`. Can you give me the solution for the

Re: Can the new `Prefetch` solve my problem?

2015-02-25 Thread Ram Rachum
Hi James, I've read the docs but I still couldn't figure it out. My queryset works great in production, I'm trying to optimize it because our pageloads are too slow. I know how to use querysets in Django pretty well, I just don't know how to use `Prefetch`. Can you give me the solution for the

Re: Using Signals - request_finished

2015-02-25 Thread Rootz
Still not working On Wednesday, February 25, 2015 at 12:55:29 PM UTC-5, Rodrigo Zayit wrote: > > If it is being loaded and it is not working, try to do by this way: > > from django.core.signals import request_finished > from django.dispatch import receiver > > @receiver(request_finished)

Re: Can the new `Prefetch` solve my problem?

2015-02-25 Thread James Schneider
I assume that you are talking about the select_related() and prefetch_related() queryset methods? https://docs.djangoproject.com/en/1.7/ref/models/querysets/#select-related https://docs.djangoproject.com/en/1.7/ref/models/querysets/#prefetch-related Both of those sections have excellent

Re: Using Signals - request_finished

2015-02-25 Thread Rootz
how do I load the signals file at the same point? On Wednesday, February 25, 2015 at 12:29:57 PM UTC-5, Vijay Khemlani wrote: > > is the signals.py module being loaded at some point? > > If it isn't, then the connect function is never being called. > > On Wed, Feb 25, 2015 at 2:01 PM, Rootz

Migrations force me to have, forever, any name/reference I use in field validators=, choices=, whatever, valid forever (even if the requirements change).

2015-02-25 Thread Luis Masuelli
I have an issue with migrations. Suppose I declare (in my application, with name myapp) a field with a validators= declared. In such value (which is an iterable), I declare a function: class MyModel(models.Model): """ This one is identifiable. """ identifier =

Re: django deployment in a virtual machine.

2015-02-25 Thread felix
El 25/02/15 12:19, dk escribió: thanks guys, I installed Apache and I am setting everything, does my project really need to be in /etc/www/ No. It's even not recommended. or I can put anywhere in the computer? just making sure the apache.conf point to that address? Basic

wsgi dont have permission to access /wsgi_app on this server

2015-02-25 Thread dk
since I couldn't get my webpage to display I started from the basic, trying to debug and go step by step, so I am trying to see if I can get mod_wsgi to work, https://wiki.archlinux.org/index.php/Mod_wsgi and this is the tutorial that I am following, but when I go to check the website and

Can the new `Prefetch` solve my problem?

2015-02-25 Thread cool-RR
Hi guys, I'm trying to solve a problem using the new `Prefetch` but I can't figure out how to use it. I have these models: class Desk(django.db.models.Model): pass class Chair(django.db.models.Model): desk = django.db.models.Foreignkey('Desk',

Re: django deployment in a virtual machine.

2015-02-25 Thread James Schneider
I believe a2ensite is a Debian-specific shortcut that allows you to quickly enable/disable various site configurations through the use of symlinks. For CentOS you'll need to create a configuration file in your conf.d directory for your virtual host. I believe it will be included automatically by

Re: django deployment in a virtual machine.

2015-02-25 Thread dk
looks like centos7 doesn't have or need that, it comes with a folder call conf.d and if the .conf file I inside this folder, is like if was activate it. =) On Wednesday, February 25, 2015 at 1:01:57 PM UTC-6, Blazor wrote: > thanks I am watching >>

Re: django deployment in a virtual machine.

2015-02-25 Thread Blazor
> > thanks I am watching > https://www.youtube.com/watch?v=hBMVVruB9Vs > but i am stuck at min 20 since it say that I need to activate the website, > with a2ensite > they gave me a centos7 machine that doesn't have those commands. > a2ensite is basically a shortcut for creating a symbolic

Re: django deployment in a virtual machine.

2015-02-25 Thread dk
thanks I am watching https://www.youtube.com/watch?v=hBMVVruB9Vs but i am stuck at min 20 since it say that I need to activate the website, with a2ensite they gave me a centos7 machine that doesn't have those commands. On Wednesday, February 25, 2015 at 11:39:01 AM UTC-6, Andrew Farrell

Model field with default value and choices is always reported as changed, even if unchanged

2015-02-25 Thread Carsten Fuchs
Hi all, please consider this model definition: def PrevMonth(): h = date.today() return 12 if h.month == 1 else h.month-1 MONTHS_CHOICES = ( (1, "Januar"), (2, "Februar"), (3, "März"), (4, "April"), (5, "Mai"), (6, "Juni"), (7, "Juli"), (8, "August"), (9, "September"),

Re: Python / Django slow ? Deciding my next technological stack

2015-02-25 Thread Benj
Thanks for quality answers guys, I'll definitely go the Python route and follow my initial intuition. On Wednesday, February 25, 2015 at 5:57:21 PM UTC+1, Nikolas Stevenson-Molnar wrote: > > On 2/25/2015 6:27 AM, Tom Evans wrote: > > On Tue, Feb 24, 2015 at 11:30 PM, Benj

Re: Using Signals - request_finished

2015-02-25 Thread Rodrigo Zayit
If it is being loaded and it is not working, try to do by this way: from django.core.signals import request_finished from django.dispatch import receiver @receiver(request_finished) def request_finished_callback(sender, **kwargs): # . . . On Wednesday, 25 February 2015 14:01:24 UTC-3, Rootz

Re: django deployment in a virtual machine.

2015-02-25 Thread Andrew Farrell
Linode and Digital Ocean both have good tutorials on setting up a production deployment

Re: django deployment in a virtual machine.

2015-02-25 Thread Rodrigo Zayit
anywhere Atenciosamente, Rodrigo de Oliveira On Wed, Feb 25, 2015 at 2:19 PM, dk wrote: > thanks guys, I installed Apache and I am setting everything, does my > project really need to be in /etc/www/ > > or I can put anywhere in the computer? just making sure the

Re: Using Signals - request_finished

2015-02-25 Thread Vijay Khemlani
is the signals.py module being loaded at some point? If it isn't, then the connect function is never being called. On Wed, Feb 25, 2015 at 2:01 PM, Rootz wrote: > I have tried using the request_finished signal but nothing happens when I > tried testing it. > What

Re: django deployment in a virtual machine.

2015-02-25 Thread dk
thanks guys, I installed Apache and I am setting everything, does my project really need to be in /etc/www/ or I can put anywhere in the computer? just making sure the apache.conf point to that address? On Wednesday, February 25, 2015 at 6:29:25 AM UTC-6, Fernando Ramos wrote: > If there's

Using Signals - request_finished

2015-02-25 Thread Rootz
I have tried using the request_finished signal but nothing happens when I tried testing it. What suggestions or recommendations can I do to help fix the problem? Thank you. Below is a sample of the signals.py file (sample is taken from djangoproject.com ) ###SIGNALS.PY from

Re: Python / Django slow ? Deciding my next technological stack

2015-02-25 Thread Nikolas Stevenson-Molnar
On 2/25/2015 6:27 AM, Tom Evans wrote: On Tue, Feb 24, 2015 at 11:30 PM, Benj wrote: Hi, i'm going to invest lots of time and energy in various web projects (mostly community web sites), and want to pick up a language / framework and invest heavily on it. I've spent a lot

Re: how to put files in different dirs

2015-02-25 Thread Rodrigo Zayit
Hi! I didn't understand your question. You don't need to put all your files in the same dir... you can create folders like "images", "images/products", "css", "js", etc Or are you asking about "media files"? I mean, files that will be uploaded through admin area...? Best regards, Rodrigo

Re: Delete the file related on the FileField

2015-02-25 Thread Rodrigo Zayit
Hi Karim, You can do: from django.db.models.signals import pre_delete from django.dispatch.dispatcher import receiver @receiver(pre_delete, sender=ModelName) def modelname_delete(sender, instance, **kwargs): instance.field_name.delete(False) or on your model you can write your delete

Re: File upload error

2015-02-25 Thread Amirouche Boubekki
Héllo again (at last) On Mon, Feb 16, 2015 at 11:20 AM Sola Chong wrote: > I having a error "*expected string or buffer*" when submit to upload > avatar when edit profile. Can't figure out what is the problem.. > I've setup a small project with your code (and small

Re: Python / Django slow ? Deciding my next technological stack

2015-02-25 Thread Tom Evans
On Tue, Feb 24, 2015 at 11:30 PM, Benj wrote: > Hi, > i'm going to invest lots of time and energy in various web projects (mostly > community web sites), and want to pick up a language / framework and invest > heavily on it. > I've spent a lot of time evaluating the various

[ANNOUNCE] Django 1.8 beta 1 and 1.7.5 released

2015-02-25 Thread Tim Graham
In addition to a bug fix release for the 1.7 series, the Django team has made the second release on the way to Django 1.8. Check out the blog post: https://www.djangoproject.com/weblog/2015/feb/25/releases/ -- You received this message because you are subscribed to the Google Groups "Django

Re: template_dir , template_loader missing in settings.py

2015-02-25 Thread 严超
Also this is the info that you may need : http://stackoverflow.com/questions/3038459/django-template-path *Best Regards!* *Chao Yan--About me : http://about.me/chao_yan * *My twitter: @yanchao727 * *My Weibo:

Re: template_dir , template_loader missing in settings.py

2015-02-25 Thread 严超
TEMPLATE_DIRS = ( join(BASE_DIR, 'templates'), ) As a beginner, I would recommend using cookiecutter-django to initiate a project and take look. *Best Regards!* *Chao Yan--About me : http://about.me/chao_yan

how to return a form in ajax call from template?

2015-02-25 Thread SHINTO PETER
how to return a form in ajax call from template? -- 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 django-users+unsubscr...@googlegroups.com. To post to this

template_dir , template_loader missing in settings.py

2015-02-25 Thread Priya Panthi
hello all, I am beginner in django..As template_dir , template_loader are missing in settings.py, I am facing lots of problems..Please kindly suggest how I should include these. It would be a great help. I have spent hours sorting it out but in vain..Thanks in advance.. -- You received this

Re: django deployment in a virtual machine.

2015-02-25 Thread Fernando Ramos
If there's more than one person using it your site will only grow. The Django web server is meant for debugging, not production. Go the extra step and setup ngnix or another simple http server. You will thank yourself later. El martes, 24 de febrero de 2015, 14:49:16 (UTC-7), dk escribió: > >

Notify to other application instance running on different machine

2015-02-25 Thread Raghvendra Parashar
I am running Django application on multiple machines say m1, m2, m3. all of them are using centralized database hosted on my_db_host.com. I want to notify to m2, m3 instances from m1 on particular action/activity. I have explored crossbar.io, but could not find proper guideline to integrate

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-25 Thread Andreas Kuhne
Hi Alex, Correct. There seems to be something wrong with the configuration of mod_wsgi, because you are able to connect via dbshell (which loads all of your environment variables and is able to connect). The same thing with runserver. Check for a good tutorial on how to configure apache +

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-25 Thread alexandrosstylianou88
Hi Andreas, I did the following test... i used "python manage.py runserver" and i was able to use the admin page (http://127.0.0.1:8000/admin/) of Django and log into the DB. So that means the apache and the mod_wsgi as you said have a problem, correct ??? Regars, Alex On Tuesday,

How load a form in popup div through ajax and submit the data in django?

2015-02-25 Thread SHINTO PETER
How load a form in popup div through ajax and submit the data in django? -- 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: TypeError: __str__ returned non-string (type bytes)

2015-02-25 Thread Erik Cederstrand
> Den 25/02/2015 kl. 05.33 skrev Mike Dewhirst : > > == > ERROR: test_checkreference_exp (substance.tests.test_substance.TestSubstance) >

Re: Gunicorn sock file is missing?

2015-02-25 Thread Erik Cederstrand
> Den 25/02/2015 kl. 07.16 skrev Kaloian : > > I have an ansible provisioned VM based on this one > https://github.com/jcalazan/ansible-django-stack but for some reason trying > to start Gunicorn gives the following error: > > Can't connect to

Re: TypeError: __str__ returned non-string (type bytes)

2015-02-25 Thread James Schneider
What happens when you throw in a print(obj.__dict__[field]) before the val assignment? You should see on the console what value each iteration of the loop is using and see if you have a strange attribute that is throwing things out of kilter. -James On Feb 24, 2015 8:33 PM, "Mike Dewhirst"

Re:

2015-02-25 Thread James Schneider
A failure in name resolution indicates a DNS query failure. >From the machine where the script is failing, can you run 'ping portal' and/or 'nslookup portal' and see if an IP is returned (even if the ping fails)? Are the failures occurring in the view on the same machine (and virtual environment

How to save user to foreignKey field for new records in modelFormset case?

2015-02-25 Thread Mike
Hi, I have created modelFormset using SchoolHistory model and SchoolForm form. "SchoolFormSet = modelformset_factory(SchoolHistory, form=SchoolForm)" I get other content from Form, but should save current user to SchoolHistory model too. user=models.ForeignKey(User) school_name =

Re: Form Wizard: store the session values

2015-02-25 Thread Karim
I'm trying to get the data from the session. The SessionWizard store the data in the session session_data = request.session[wizard_key_form]['step_data'] at this point session_data is the dictionary with the data in the form filled by the user. But this doesn't work

Re: django deployment in a virtual machine.

2015-02-25 Thread aRkadeFR
Hello there, It's always good to take a look at how prodding a django website. As George Silva said, you need nginx/apache or other. They will serve your media and static files. Then for the django server, you need to run it in uWSGI or another wsgi, and link it to your nginx/apache.