Re: Persist shopping cart data between computers.

2015-03-17 Thread mail4dk
Do I need to code this logic by myself or is there a build in mechanism or plugin that will allow me to have it like the shopping cart plugins available online that store the data in the session collection? On Sunday, March 15, 2015 at 4:45:38 PM UTC+2, Avraham Serour wrote: > > save it on the d

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-03-17 Thread Russell Keith-Magee
Hi, It's possible that you're getting this error for the exact reason that the check was added - someone is submitting requests to your site with a manipulated HTTP_HOST header. This may not be malicious - it could just be a badly configured robot making web requests. It might also point at a pro

Re: Django phonegap CORS

2015-03-17 Thread Filipe Ximenes
Hey, I wrote a blog post about CORS and Django with more details about the subject: http://www.vinta.com.br/blog/2015/django-cors.html =) On Fri, Mar 13, 2015 at 5:32 PM, Filipe Ximenes wrote: > Alright, I think I got what you want now. > > The first solution that comes to mind is to perform ev

Re: Testing template context processors

2015-03-17 Thread Gergely Polonkai
Hello, My processor sets some template variables based on request.user and some DB/redis query results, which are displayed on each page on a header bar, so I only need to create a mocked request with user set to something (AnonymousUser or a valid user object). I'm already using Mock[2] for midd

Re: implementing dynamic models

2015-03-17 Thread Guilherme Leal
I came up with the same conclusion. Em ter, 17 de mar de 2015 10:56, Django User escreveu: > yes, i did. however, none of those approaches look compelling for a > production system. > > > On Tuesday, March 17, 2015 at 6:06:11 PM UTC+5:30, Guilherme Leal wrote: > >> did you looked into some of th

Re: forms of 2 tables upload files

2015-03-17 Thread Filipe Ximenes
You can keep the ModelForm just like the tutorial and override the "save" method. It will look something like this: class MyForm(forms.ModelForm): the_file = forms.FileField(required=True) class Meta: model = Person fields = ('name', 'email', 'the_file') def save(self, commit=True): person = sup

Re: Testing template context processors

2015-03-17 Thread Carl Meyer
Hi Gergely, On 03/17/2015 10:52 AM, Gergely Polonkai wrote: > I wrote a context processor which makes some global variables of mine > available for templates. I cannot find a good (cough… any) article on > how to test such processors. Could you give me some directions on where > to start with writ

Testing template context processors

2015-03-17 Thread Gergely Polonkai
Hello, I wrote a context processor which makes some global variables of mine available for templates. I cannot find a good (cough… any) article on how to test such processors. Could you give me some directions on where to start with writing one? Thanks in advance! Best, Gergely -- You received

Uncaught TypeError: Cannot read property 'value' of null

2015-03-17 Thread elcaiaimar
Hello I wonder if somebody knows how to solve the next: I want to send a value from the template to a script and it seems it works but I get an error: Uncaught TypeError: Cannot read property 'value' of null Below it is my code: *Template:* {{ obra.id }} is an object sended from views.py *

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-03-17 Thread frocco
I am concerned because I have a value in ALLOWED_HOSTS, but it is not this value. On Tuesday, March 17, 2015 at 9:17:15 AM UTC-4, frocco wrote: > > SuspiciousOperation: Invalid HTTP_HOST header (you may need to set > ALLOWED_HOSTS): www.g3suprimentos.com.br > > I keep getting this error from ti

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-03-17 Thread Eric Davis
What is the value of ALLOWED_HOSTS in settings.py? Your site is serving requests that contain a "Host: www.g3suprimentos.com.br" header. Django doesn't recognize this as an allowed host, hence the error. https://docs.djangoproject.com/en/1.7/ref/settings/#allowe

forms of 2 tables upload files

2015-03-17 Thread dk
i have 2 tables, 1 table contain the fields for name, email, and I did another table with file, and date. and I am trying to populate the 2 tables when a user submit the form. I follow this amazing tutorial https://amatellanes.wordpress.com/2013/11/05/dropzonejs-django-how-to-build-a-file-uplo

Re: implementing dynamic models

2015-03-17 Thread Django User
yes, i did. however, none of those approaches look compelling for a production system. On Tuesday, March 17, 2015 at 6:06:11 PM UTC+5:30, Guilherme Leal wrote: > > did you looked into some of these > > > a

Reload App

2015-03-17 Thread Guilherme Leal
Is there a way to "reload" a django app? What i need is basically, re-run the Apps.populate, to trigger the discover of new apps and models. and now you're asking "What would he want this?". Basically, i'm trying to create a feature where the users of my project (who also will be devellopers) can

Invalid HTTP_HOST, can someone explain why I am getting this?

2015-03-17 Thread frocco
SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): www.g3suprimentos.com.br I keep getting this error from time to time. Is someone trying to hack my site? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: implementing dynamic models

2015-03-17 Thread Guilherme Leal
did you looked into some of these aproaches? Em ter, 17 de mar de 2015 às 09:07, Guilherme Leal escreveu: > I REALLY would appreciate some feature like this. If some > developer/engeneer has implemented some

Re: implementing dynamic models

2015-03-17 Thread Guilherme Leal
I REALLY would appreciate some feature like this. If some developer/engeneer has implemented something like it, please share your knowledge. The first thing i would test, is to save the model in a .py file (i think that saving the model might be important for the performance, since the python int

implementing dynamic models

2015-03-17 Thread Django User
hello, we are working on an application where users can register new types of data streams through Django. so it requires a mechanism to create new tables (cassandra) on the fly. what is the best Djangoish way to implement such dynamic models? pls. let us know. thanks in advance. -- You recei

Django Authentication Layer

2015-03-17 Thread Satya Dev
Hi , I have been working on Django for a few days and have been trying to implement a login page for the website similar to the login page of the admin interface. I have created an auth.html which asks for a username and password and have given the necessary links in views.py and urls.py I g

Re: Django beggining problems

2015-03-17 Thread Sergiy Khohlov
Answer is simple. Notepad opens python files.. Try to start python.exe djangoadmin 13 бер. 2015 18:55, користувач написав: > i am following the tutorial right now... > I use windows 7 > python 2.7.6 > and django 1.7.6 > > when i run "django-admin startproject mysite" > > it opens a

Re: Changing table name in response to a QuerySet

2015-03-17 Thread James Schneider
That sounds more like an exact use case for model inheritance. You would define a single model that matches the columns in both tables. You can define that model as abstract, then have the two real models (one for each table) inherit from that abstract model. In the definition for the child models,