Re: Internal Server Error os:win8.1 django1.8+apache2.4.12(win64)vc10+wsgi4.4.11+python3.4.3

2015-05-13 Thread gnuhurd92 gnuhurd92
hi users django this error is in wsgi.py config this files need import sys for example import sys path = 'path/mysite' if path not in sys.path: sys.path.append(path) On 4/25/15, gnuhur...@gmail.com wrote: > > > [Sat Apr 25 17:07:18.811184 2015] [mpm_winnt:notice] [pid

Re: django-allauth without username, login with facebook doesn't work

2015-05-13 Thread Mario Gudelj
Sorry man. My mistake. So are you saying that you have a link with onclick or something? Do you get the JS error? Is it logged inside your browser's console? It's a bit hard to tell without more code or the URL... On 14 May 2015 at 03:12, Fellipe Henrique wrote: > Hi Mario,

Re: rollback the update query

2015-05-13 Thread Simran Singh
Hi Tom, Thanks a lot for your efforts. It worked with savepoint called before update query. Thank you Regards, Simran On Monday, May 11, 2015 at 4:27:50 PM UTC+5:30, Simran Singh wrote: > > I am really new to Django and I am using Django 1.8. Many of the > manual_transaction features have

Re: rollback the update query

2015-05-13 Thread Simran Singh
Hi James, Yes, it workedd :) I created the object outside the method and called it at every transaction point in the loop and when there is rollback, it rollbacks all the queries. Thanks James Regards, Simran On Monday, May 11, 2015 at 4:27:50 PM UTC+5:30, Simran Singh wrote: > > I am really

Re: rollback the update query

2015-05-13 Thread James Schneider
Did you try changing the position of the save point like I mentioned? -James On May 13, 2015 9:33 PM, "Simran Singh" wrote: > Hi James, > > Thanks for your feedback. I basically want to rollback that query where I > update the db. Basically I want to rollback all the

Re: rollback the update query

2015-05-13 Thread Simran Singh
Hi James, Thanks for your feedback. I basically want to rollback that query where I update the db. Basically I want to rollback all the updates that were made during that transaction. Tried out the method of custom Exception as suggested by Tom but somehow my bad luck that it is still not

Re: rollback the update query

2015-05-13 Thread Simran Singh
Hi Tom, I tried the code that you posted but somehow it is giving* UnexpectedNoAssetSpecificationException at /reservation/ *error. I am not sure but when this exception is raised, then control is not going to class UnexpectedNoAssetSpecificationException(Exception): pass and when it

Re: What is the ideal web server to use with Django?

2015-05-13 Thread reduxionist
On Wednesday, May 13, 2015 at 5:06:47 AM UTC-4, termopro wrote: > > > No. >> >> Cheers >> >> Tom >> > > OK > > > :) > That's only evidence that a lot of people don't know how to

Re: How to pass arguments when deleting an object? ex: object.delete(deleted_by=someone)

2015-05-13 Thread Stephen J. Butler
Model.delete doesn't take any arguments other than "using". If you want to pass more context, you'll have to override Model.delete in your project, create your own signal, and then pass the extra arguments to it. Same with QuerySet.delete if you want to override mass deletion also. Or, even

Re: Kivy and Djangp

2015-05-13 Thread john
Kivy is the client side of the project. Like any client (that includes Kivy) you would use http (that's the normal setup) or maybe pycurl (not to sure pycurl is pure python and you need pure python to work with Kivy) to access the URL (the address of your django URL). On the django side the

How to pass arguments when deleting an object? ex: object.delete(deleted_by=someone)

2015-05-13 Thread Neto
I want to pass an argument to delete an object, that argument will be handled by the signal. Car.objects.get(pk=1).delete(deleted_by=someone) models: @receiver(post_delete, sender=Car) def ref_person(sender, instance, **kwargs): who_deleted = ? How do I get this argument? -- You

Kivy and Djangp

2015-05-13 Thread steven kyalo
Hello everyone, Am doing a mobile app using Kivy. The app should be getting some data from a server, for which i have used Django to develop the server side requirements. My problem is where do i put my Kivy scripts so that i can access the Django application web services. Which scripts of

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

2015-05-13 Thread Russell Keith-Magee
Is there a setting to turn of a warning that someone is attempting to access your site in a potentially malicious way? No. When you get a warning like this, you investigate the cause, and fix the problem. You don't just silence the warning. Yours, Russ Magee %-) On Thu, May 14, 2015 at 3:44 AM,

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
Thanks Nik. Your right and I think that will work. Thanks for the suggestion. Henry On Wednesday, May 13, 2015 at 4:22:08 PM UTC-5, Nikolas Stevenson-Molnar wrote: > If I understand correctly what you want, then I think sessions will help > you here:

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Gergely Polonkai
Hello, I think the source of your frustration is that you started on the wrong track. If you create a global variable here, *all* your users will see the same fields. I guess it’s not really the thing you want. You have several other options here: 1) Add a user setting in the database If you

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Nikolas Stevenson-Molnar
If I understand correctly what you want, then I think sessions will help you here: https://docs.djangoproject.com/en/1.7/topics/http/sessions/ def view_1(self, request): request.session['display_key_list_updated'] = True def view_2(self, request): if

Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
I have a list of one or more items being returned back to my application as a response from a call to an API. In this particular part of the process depending on the data keys selected by the user, if any some data fields will be formatted automatically. When that happens I need to add the keys

Re: Mongodb + django

2015-05-13 Thread Babatunde Akinyanmi
That tutorial works when you are using django-nonrel which is a fork of django. To get a solution to the issue you are experiencing, you might have better luck by posting on the django-nonrel mailing list On 13 May 2015 03:14, "Abhijit Chatterjee" wrote: > > > On

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

2015-05-13 Thread frocco
Thanks for getting back to me. I am on django 1.5. Is there a setting I can use to avoid getting these emails? I get at least 5 a week. On Tuesday, March 17, 2015 at 6:58:00 PM UTC-4, Russell Keith-Magee wrote: > > Hi, > > It's possible that you're getting this error for the exact reason that

Re: best way change template base my app

2015-05-13 Thread André Luiz
extends should always be on first line of file and it accepts a variable as argument so you can define which template should be used on your view. # views.py def home(request): if request.session.type == 1: base = 'base.html' else: base = 'base_other.html' context =

How do I display a map with GeoDjango models?

2015-05-13 Thread Thomas Levine
I have multiple GeoDjango models (http://dada.pink/scott2/map/models.py) and want them to be layers on the same map. Surely there's a magic way to specify this. What do I do? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

How to resend the activation email using django-allauth?

2015-05-13 Thread Fellipe Henrique
Hello, I need in my dashboard a link to resend activation mail, from django-allauth. Any idea? I don't want to use ACCOUNT_EMAIL_VERIFICATION = 'mandatory' because I want user login in my site, but send again the email. Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: >

best way change template base my app

2015-05-13 Thread carlos
Hi, is posible change my base template with if tag example: {% if request.session.type = '1' %} {% extends "base.html"%} {% else %} {% extends "base_other.html"%} {%endif%} i have a error like that TemplateSyntaxError at /monito/cult/ Invalid block tag: 'endif' will to do change the

Re: TemplateDoesNotExist

2015-05-13 Thread Владимир Кубанцев
Hi! In documentation: ¶ DIRS Default:: [] (Empty list) Directories where the engine should look for template source files, in search order. So Django reads your string as a tuple and tries finds templates in each element of tuple.

Re: django-allauth without username, login with facebook doesn't work

2015-05-13 Thread Fellipe Henrique
Hi Mario, I`m not using python-social-auth... I choose to use all-auth[1] because it's given to me more the social login, like: password reset, email validation etc. My problem is: in template when I click on a button, nothing happen.. the link (javascript) is correct, but nothing happen...

Re: Improve Performance in Admin ManyToMany

2015-05-13 Thread Tim Graham
Are you sure it's the query that's slow and not the template rendering and/or JavaScript performance? On Wednesday, May 13, 2015 at 12:32:50 PM UTC-4, Timothy W. Cook wrote: > > I have a model with 13 M2M relations and some of those have a few thousand > instances. > This renders rather slowly

Re: TemplateDoesNotExist

2015-05-13 Thread Tim Graham
In what directory is the index.html template you expect to be loaded located? On Wednesday, May 13, 2015 at 12:38:18 PM UTC-4, Rashmi Ranjan Kar wrote: > > Hi > > Please go through the attachment. It contains settings.py, urls.py and > localhost:8080 page. kindly help me to solve this issue as

Re: TemplateDoesNotExist

2015-05-13 Thread Stephen J. Butler
See where it says "Django tried loading these templates, in this order"? Move your index.html template to the appropriate place. On Wed, May 13, 2015 at 11:12 AM, Rashmi Ranjan Kar wrote: > Hi > > Please go through the attachment. It contains settings.py, urls.py and >

Re: Django Report Builder Throws immediate error after installing

2015-05-13 Thread James Schneider
You should post the code for the view, model, and the entire traceback. I often get messages like this when using the SuccessMessages view mixin and I reference an invalid field name in success_messages within the view (usually due to copy/paste from a similar view). -James On May 13, 2015 7:01

Improve Performance in Admin ManyToMany

2015-05-13 Thread Timothy W. Cook
I have a model with 13 M2M relations and some of those have a few thousand instances. This renders rather slowly in the Admin. Thinking about improvements I wonder if it will help to setup prefetch_related queries https://docs.djangoproject.com/en/1.8/ref/models/querysets/#prefetch-related

Re: Getting self.request.user for form cleaning

2015-05-13 Thread David
Thank you for your reply. I had previously tried that, but must have had the syntax wrong. Am now using get_form_kwargs() as it looks nicer. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Getting self.request.user for form cleaning

2015-05-13 Thread Stephen J. Butler
If you're using FormMixin then you can also override get_form_kwargs: def get_form_kwargs(self): kwargs = super(MyForm, self).get_form_kwargs() kwargs['creator'] = self.request.user.pk return kwargs Then let FormMixin instantiate the form instance itself. On Wed, May 13, 2015 at

Re: How to load an object created from a model outside the project ?

2015-05-13 Thread Gergely Polonkai
Hello, if you don't have to modify the object, I would suggest using serialization instead of pickling. Best, Gergely On 13 May 2015 16:01, "Matthieu" wrote: > Hi, > > I saved with pickle an object created from a Django model : > > class Country(models.Model): >

Re: Getting self.request.user for form cleaning

2015-05-13 Thread David
For anyone else needing this: In form: def __init__(self, *args, **kwargs): self.creator = kwargs.pop('creator', None) In view: form = PostForm(request.POST, creator=self.request.user.pk) -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-13 Thread Simon Charette
Hi Guettli, This isn't part of the public API but you could rely on how Django loads fixture internally . parent = Restaurant.objects.get(name__iexact="Bob's

Getting self.request.user for form cleaning

2015-05-13 Thread David
Hi I am using both FormMixin, and ListView. When validating the form I need the users id. How can I get that into the form for cleaning? I am presuming somehow using get_form and then using the form's init to grab it, but am unsure of the syntax. Any ideas? Many thanks def post(self,

Django Report Builder Throws immediate error after installing

2015-05-13 Thread dbadmin
So I've figured out that there's nothing "wrong" with Django Report Builder and there's nothing technically "wrong" with my code. But I know I have to format my code structure in such a way that the Report Builder Can interact with it. Unfortunately, there is very little documentation on

How to load an object created from a model outside the project ?

2015-05-13 Thread Matthieu
Hi, I saved with pickle an object created from a Django model : class Country(models.Model): code = models.IntegerField(primary_key=True) name = models.CharField(max_length=30) def __str__(self): return (self.name) england = Country(code=1, name="England")

Re: Interaction of Python Code with Django.

2015-05-13 Thread SUBHABRATA BANERJEE
Hi Palansh, May I ask you two or three quick questions. a) Am I understanding fine? b) I wrote a Python Script, and wanted to port it with Django restonframework. I could do upto Django restonframework. How may I go next? If you may kindly suggest. Regards, Subhabrata Banerjee. On Tuesday,

Re: Interaction of Python Code with Django.

2015-05-13 Thread SUBHABRATA BANERJEE
Thanks, but that is more or less on Flask. In Django I could do Rest with restonframeworks. Now I have to integrate it with my existing code in Python. Palansh has developed almost similar but I am looking for an interactive rest based django api for my interactive python code. Seems bit

Re: Interaction of Python Code with Django.

2015-05-13 Thread sarfaraz ahmed
werkzeug is another debug tool which let you write and test code via browser itself. Regards, Sarfaraz Ahmed On Wed, May 13, 2015 at 3:43 PM, SUBHABRATA BANERJEE < subhabrata.bane...@gmail.com> wrote: > Hi Palansh, > > Thank you for your prompt answer, is it, > return

Re: Interaction of Python Code with Django.

2015-05-13 Thread palansh agarwal
Hi, Yes you got it right. On Wed, May 13, 2015 at 3:43 PM, SUBHABRATA BANERJEE < subhabrata.bane...@gmail.com> wrote: > Hi Palansh, > > Thank you for your prompt answer, is it, > return HttpResponse(template.render(context)) > > https://docs.djangoproject.com/en/1.8/intro/tutorial03/ > under >

Re: rollback the update query

2015-05-13 Thread James Schneider
> asset_spec = AssetSpecification.objects.filter(asset_id_id=inventory,utilized_value=0).values_list('asset_id', flat=True) > trans = transaction.savepoint() // Here I am trying not to commit the code and store it in transaction. > > if

Re: Interaction of Python Code with Django.

2015-05-13 Thread SUBHABRATA BANERJEE
Hi Palansh, Thank you for your prompt answer, is it, return HttpResponse(template.render(context)) https://docs.djangoproject.com/en/1.8/intro/tutorial03/ under Write views that actually do something and you have worked out views.py Regards, Subhabrata Banerjee. On Wednesday, May 13, 2015 at

Re: rollback the update query

2015-05-13 Thread Simran Singh
Hi Tom, All these conditions are to be verified before data received from the form is saved in database. I tried this Exception method but when the control goes to except block, new page is rendered but *all the transactions that were completed till this point are committed after this point*.

Re: What is the ideal web server to use with Django?

2015-05-13 Thread James Schneider
If you get enough traffic to trounce a (web server of choice) installation, you probably are making enough money to hire an expert with that system to tune it properly or recommend adding additional resources. Don't get bogged down in Apache vs. Nginx vs. uWSGI, etc. You're nowhere near that

Re: Interaction of Python Code with Django.

2015-05-13 Thread palansh agarwal
Hello, I suggest you go through django official docs first. The methods in views.py returns response on a HTML templates. Look for them and try to understand the workflow. On Wed, May 13, 2015 at 3:10 PM, SUBHABRATA BANERJEE < subhabrata.bane...@gmail.com> wrote: > Thanks Palansh. I have few

Re: Interaction of Python Code with Django.

2015-05-13 Thread SUBHABRATA BANERJEE
Thanks Palansh. I have few questions here. a) I saw you have created a job search engine. I found its html source. Nice. b) I found your Django codes. My questions are, i) Where you are calling html source in your django code. ii) Is there any tutorial to learn this? I wanted to know it.

Re: Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-13 Thread guettli
Thank you for this link. The InheritanceManager is good to know about. But it does not help creating the child_instance from a base instance. At least the docs don't tell about it. Or I was blind. Am Mittwoch, 13. Mai 2015 05:41:44 UTC+2 schrieb somecallitblues: > > Have you had a look at >

Re: Suggiestion on how split a views.py file

2015-05-13 Thread James Schneider
> > ​Thanks James for the answer, my problem is to update the various import in my app to refer to the new file with the code I moved into. At the moment, the only thing that can help is to have all the view tested to show an error in the import during the Test Harness. > ​ > ​Obviously I have not

Re: What is the ideal web server to use with Django?

2015-05-13 Thread termopro
> No. > > Cheers > > Tom > OK :) -- 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: What is the ideal web server to use with Django?

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 9:55 AM, termopro wrote: > >> >I have read that >> > Apache's performance degrades on high load. >> >> That is absolute nonsense. >> >> Cheers >> >> Tom > > > Doesn't Apache create new process for each request thus eating memory when > serving large

ANN: eGenix mxODBC Connect 2.1.3 - Remote Python Database Interface

2015-05-13 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Remote Python Database Interface Version 2.1.3 mxODBC Connect is our commercially supported client-server product

Re: What is the ideal web server to use with Django?

2015-05-13 Thread termopro
> >I have read that > > Apache's performance degrades on high load. > > That is absolute nonsense. > > Cheers > > Tom > Doesn't Apache create new process for each request thus eating memory when serving large amounts of static files during traffic peaks ? -- You received this message

Re: rollback the update query

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 9:37 AM, Simran Singh wrote: > Tom, basically I want to discard everything that is stored in > transaction.savepoint. As per my current case, it is getting committed no > matter where the flow goes. Yes, so you don't want savepoints. Savepoints

Re: rollback the update query

2015-05-13 Thread Simran Singh
Tom, basically I want to discard everything that is stored in transaction.savepoint. As per my current case, it is getting committed no matter where the flow goes. Regards, Simran On Monday, May 11, 2015 at 4:27:50 PM UTC+5:30, Simran Singh wrote: > > I am really new to Django and I am using

Re: What is the ideal web server to use with Django?

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 2:12 AM, akshat wrote: > I am new to Django. I am building a app which will have to handle several > concurrent requests. Which web server is suitable for this? Any and all. >I have read that > Apache's performance degrades on high load. That

Re: rollback the update query

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 6:36 AM, Simran Singh wrote: > Hi Tom, > > If you see then in if block, I am creating my savepoint. At any point of > time, if the condition is not met and control goes to else block then I want > to rollback all the changes that are saved in

Re: What is the ideal web server to use with Django?

2015-05-13 Thread kk
I would suggest using Nginx. happy hacking. Krishnakant. On Wednesday 13 May 2015 06:42 AM, akshat wrote: I am new to Django. I am building a app which will have to handle several concurrent requests. Which web server is suitable for this? I have read that Apache's performance degrades on