How to implement a custom prerequisite action that is similar to login require for a class-based generic view?

2013-10-11 Thread Khanh Tran
In my models, there is a many-to-many relationship between User and Store that she works for. After authenticated, if the user want to access a view that is specific to a store that she belongs to, a prerequisite action would be prompting her for the store she want to work with, unless she only

Re: View not working / how can I test it in the shell?

2013-10-11 Thread Mario R. Osorio
>From the server; I am getting the page I need but the block where the data from the view in question is supposed to be comes out empty. >From the django.test.client's Client() response.status.code is 200. I am indeed geting the ALLOWED_HOSTS warning, which I don't fully understand and don't know

Re: View not working / how can I test it in the shell?

2013-10-11 Thread Kelvin Wong
In the shell: >>> from django.test import Client >>> c = Client() >>> r = c.get('/about') >>> r.context https://docs.djangoproject.com/en/1.5/topics/testing/overview/#module-django.test.client K On Friday, October 11, 2013 3:14:38 PM UTC-7, Mario Osorio wrote: > > You are right, I fixed that

Re: View not working / how can I test it in the shell?

2013-10-11 Thread Mario Osorio
You are right, I fixed that after posting as someone else point it out to me, but this is not working out for me nonetheless On Friday, October 11, 2013 6:11:54 PM UTC-4, donarb wrote: > > On Friday, October 11, 2013 2:48:13 PM UTC-7, Mario Osorio wrote: >> >> Hello all, working with mezzanine,

Re: View not working / how can I test it in the shell?

2013-10-11 Thread donarb
On Friday, October 11, 2013 2:48:13 PM UTC-7, Mario Osorio wrote: > > Hello all, working with mezzanine, I created in an app (newsroom) folder, > a views.py http://dpaste.com/1413587/. This view is an addition to the > blog app in site-packages. I then I put a section in my blog_post_list.html >

Re: Possible documentation/implementation bug for unique_together

2013-10-11 Thread Thomas Orozco
Those two tuples are stricly equivalent from Python's point of view, so the problem must be somewhere else, Did you change anything else? What's the error message like? Cheers, On Fri, Oct 11, 2013 at 11:46 PM, puff wrote: > I'm relatively new to Django and used unique_together in 1.5 per the

View not working / how can I test it in the shell?

2013-10-11 Thread Mario Osorio
Hello all, working with mezzanine, I created in an app (newsroom) folder, a views.py http://dpaste.com/1413587/. This view is an addition to the blog app in site-packages. I then I put a section in my blog_post_list.html template file to (supposedly) show the data from that view http://dpaste.n

Possible documentation/implementation bug for unique_together

2013-10-11 Thread puff
I'm relatively new to Django and used unique_together in 1.5 per the development documentation: unique_together = ("driver", "restaurant") This appears to cause run time errors leading to a transaction abort. However, unique_together = ("driver", "restaurant",) seems to work. Is this a do

Re: What is the best solution to deploy Django on a Windows server?

2013-10-11 Thread Javier Guerra Giraldez
On Fri, Oct 11, 2013 at 2:50 PM, Arnold Krille wrote: > Create a virtual machine, either with microsofts virtualization or with > virtualbox. Install linux in it, deploy your app as you are used to > do. while I agree that using Linux is the best solution, Django _does_ run on windows without an

Re: What is the best solution to deploy Django on a Windows server?

2013-10-11 Thread Arnold Krille
On Fri, 11 Oct 2013 08:35:06 -0700 (PDT) Augusto Destrero wrote: > A client of mine want to keep its existing Windows Server > infrastructure, so I'm forced to deploy my Django based web > application on Windows 2003/2007. > > The first question is: > > is Django production ready on Windows plat

Re: Looking for experienced Django Developers

2013-10-11 Thread Team UK
My email should be showing up now On Friday, October 11, 2013 8:05:34 PM UTC+1, Oscar Carballal wrote: > > Ok, where should I send my CV? :) > > > 2013/10/11 Team UK > > >> Remotely and Local applicants accepted. I can't really give you a >> detailed job description because we are working on mult

Re: Looking for experienced Django Developers

2013-10-11 Thread Oscar Carballal
Ok, where should I send my CV? :) 2013/10/11 Team UK > Remotely and Local applicants accepted. I can't really give you a detailed > job description because we are working on multiple projects. > > > On Friday, October 11, 2013 7:52:18 PM UTC+1, Oscar Carballal wrote: > >> Any more information a

Re: Looking for experienced Django Developers

2013-10-11 Thread Team UK
Remotely and Local applicants accepted. I can't really give you a detailed job description because we are working on multiple projects. On Friday, October 11, 2013 7:52:18 PM UTC+1, Oscar Carballal wrote: > > Any more information about the job? Is remote available? Any other > requirements? > >

Re: Looking for experienced Django Developers

2013-10-11 Thread Oscar Carballal
Any more information about the job? Is remote available? Any other requirements? I'm interested in it btw. 2013/10/11 Team UK > ** > > Freelance Django developers. 2 years minimum experience required in > Django/python, CSS, HTML5, Bootstrap and JS backbone. > > Candidates will go through scr

Looking for experienced Django Developers

2013-10-11 Thread Team UK
Freelance Django developers. 2 years minimum experience required in Django/python, CSS, HTML5, Bootstrap and JS backbone. Candidates will go through screening before hire. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

What is the best solution to deploy Django on a Windows server?

2013-10-11 Thread Augusto Destrero
A client of mine want to keep its existing Windows Server infrastructure, so I'm forced to deploy my Django based web application on Windows 2003/2007. The first question is: is Django production ready on Windows platform? The second is: to your knowledge, what is the best way to deploy Djang

Re: deploy ?

2013-10-11 Thread Cody Chamberlain
Have you enabled the necessary WSGI modules in Apache and performed the necessary configuration? You have to remember that the Django python files need an application server to compile and process. Apache out of the box doesn't do that. mod_wshi is one option. The others are using Nginx as a re

Re: deploy ?

2013-10-11 Thread Lukas Nemec
Why do you want apache? It is not as good as say Nginx with UWSGI or gunicorn... And there is a lot of information about this. .. http://nemec.lu/en/how-to#django-nginx-uwsgi-ssl enjoy On 10/11/2013 05:40 PM, Diogene Laerce wrote: Actually the default django server works but I can't get apache

Re: deploy ?

2013-10-11 Thread Diogene Laerce
Actually the default django server works but I can't get apache to serve the app ? Anyone ? -- “One original thought is worth a thousand mindless quotings.” “Le vrai n'est pas plus sûr que le probable.” Diogene Laerce -- You received this message b

Re: Call method of the session template

2013-10-11 Thread Daniel Roseman
On Friday, 11 October 2013 13:45:01 UTC+1, Ricardo wrote: > I understand what you say, however I know only call methods using {% url > 'app.view.func'%} or {%}% app.view.func. > As I understand this django-aap carton, the shopping cart in the session > live. If it is in session I would have > ac

Re: How do I correctly encode filenames for use in https-response "content-disposition" header?

2013-10-11 Thread Bill Freeman
Not sure, but perhaps you need quotes around the file name to avoid having the user agent terminate the filename on space? E.g.; ..."attachement; filename=" + '"' + rep_setup..+ '.xlsx"' On Fri, Oct 11, 2013 at 6:27 AM, DJ-Tom wrote: > Hi, > > I'm serving files via HttpResponse and cur

Re: Django query from database

2013-10-11 Thread Leonardo Giordani
Ok, I think I got the point. So, correct me if I didn't get it right, you have to get users which have first_name, last_name, or other fields equal to the words in your list B. This can be accomplished by looking at each field for each keyword. I would also compile a dictionary keeping reference

Re: Django query from database

2013-10-11 Thread Kamal Kaur
On Fri, Oct 11, 2013 at 6:43 PM, Leonardo Giordani wrote: > Sorry, I forgot the User part of your question. > > Let me understand the exact relationship between codes, words and users: do > those words or codes come from a form? Or are saved in the DB for each user? Actually I have to search for

Re: Django query from database

2013-10-11 Thread Leonardo Giordani
Sorry, I forgot the User part of your question. Let me understand the exact relationship between codes, words and users: do those words or codes come from a form? Or are saved in the DB for each user? I ask this because I want to understand if you are trying to get a relationship that already exi

Re: Django query from database

2013-10-11 Thread Kamal Kaur
On Fri, Oct 11, 2013 at 4:06 PM, Leonardo Giordani wrote: > I think that you have to perform a query for each Code, extracting the list > of Word matching that Code and then merging all the lists. Exactly! > Since I don't know your models, I'll give you some general code, let me know > if you un

Re: deploy ?

2013-10-11 Thread Diogene Laerce
I decided to redo everything from the /var/www folder and it seems to work. But that leads me to another question : previously I formed the application in my home folder and I thought that transfering the app folder to the website test folder, and updating all links in settings.py would be eno

Re: Call method of the session template

2013-10-11 Thread Ricardo Kamada
I understand what you say, however I know only call methods using {% url 'app.view.func'%} or {%}% app.view.func. As I understand this django-aap carton, the shopping cart in the session live. If it is in session I would have access their methods and attributes. Well that's exactly what I'm not get

Re: Custom django menu and page

2013-10-11 Thread Yevgeniy Shchemelev
Yes. It's can be done on template layer. Just create custom index admin template. See example in django source . You need to create you own module table with appropriate model rows. For example: {% for

Re: Re : deploy ?

2013-10-11 Thread Diogene Laerce
Ah my bad. Damn URL autocorrrect. yeah I saw that later.. ^^ Thanks anyway. You didn't see anything wrong in the code ? It is enough simple to be right, isn't it ? On Fri, Oct 11, 2013 at 4:29 PM, Diogene Laerce > wrote: > The current URL, |site.test/acc

Re: Re : deploy ?

2013-10-11 Thread yati sagade
Ah my bad. Damn URL autocorrrect. On Fri, Oct 11, 2013 at 4:29 PM, Diogene Laerce wrote: > > The current URL, |site.test/accueil |, didn't > match any of these. > > This url is an auto corrected url by thunderbird, I did this test on the > right url > of course : > ht

Re: deploy ?

2013-10-11 Thread yati sagade
I assume `site.test` is set to point to localhost in your /etc/hosts file (or the HOSTS file on Windows). Then, try http://site.test/accueil/ (notice the trailing slash). If that doesn't work, just try `localhost:8000/accueil/` (replace 8000 with the port you're running on, of course) to see if all

Re : deploy ?

2013-10-11 Thread Diogene Laerce
> The current URL, |site.test/accueil |, didn't match any of these. This url is an auto corrected url by thunderbird, I did this test on the right url of course : http://127.0.1.1/site.test/accueil/ Thanks -- “One original thought is worth a thousand mindless quotin

deploy ?

2013-10-11 Thread Diogene Laerce
Hi, I'd like to deploy my first "hello world" app on localhost but I can't get through the first attribution url even after openclassrooms tuto : I've got : app/urls.py urlpatterns = patterns('', url(r'^accueil/$', 'portal.views.home'), ) app/portal/views.py from django.http import HttpRespons

Re: Django query from database

2013-10-11 Thread Leonardo Giordani
I think that you have to perform a query for each Code, extracting the list of Word matching that Code and then merging all the lists. Since I don't know your models, I'll give you some general code, let me know if you understand how to implement it exactly on your models. Assuming that the CodeTa

How do I correctly encode filenames for use in https-response "content-disposition" header?

2013-10-11 Thread DJ-Tom
Hi, I'm serving files via HttpResponse and currently I'm struggling with spaces in the filenames. This is how I contruct the response header: response = HttpResponse(report.reportfile.chunks(), mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") respon

Re: Image browsing in django

2013-10-11 Thread Tom Evans
On Fri, Oct 11, 2013 at 6:52 AM, Harjot Mann wrote: > When I am browsing an image in my form it is giving me this error even > after browsing the image. :( > http://screencloud.net/v/ch9e Forms containing files must have encoding type of "multipart/form-data" or the file will not be submitted wit

Custom django menu and page

2013-10-11 Thread Juan Antonio García Cano
In my django admin site, i have the menu with the name of my app and in this section all the models that i have registered in admin.py I want to know if it is posible to put in the main menu and submenu a custom entry, with custom templates. (These pages will be only for work and show data, the

Django query from database

2013-10-11 Thread Kamal Kaur
Hello there, Hope you are doing well :) I have a problem regarding querying a list from two tables, the procedure goes like: Considering two tables from mysql database: 1. UserProfile table, with complete client details: First name, Last name, Address, email id, Contact number etc. 2. CodeTable

Re: Call method of the session template

2013-10-11 Thread Daniel Roseman
On Thursday, 10 October 2013 20:29:32 UTC+1, ke1g wrote: > No. You can't pass an argument to a model method from the template. I > see two options for you: > > 1. Rework the method so that the argument is optional, and if the > argument is not provided, the method uses a reasonable default (m