Re: rollback the update query

2015-05-11 Thread Simran Singh
Thanks Tom for your response. I am attaching piece of code of what I have done. I hope this could help. @transaction.atomic(None, True) def reservation(request): if request.method == 'POST': reservation_form = ReservationForm(request.POST) if reservation_form.is_valid():

Re: Use 3rd party django package in my own project (PYTHONPATH)

2015-05-11 Thread Mario Gudelj
Have you looked at https://django-model-report.readthedocs.org/en/latest/installation.html ? After you add it to "INSTALLED_APPS" (I guess that's what you meant by adding it to 'Installed_Packages') you need to create reports.py etc. The instructions on RTD are pretty good... On 12 May 2015 at 05

Re: Switching settings, in a non-webapp?

2015-05-11 Thread Doug Blank
This ended up being just a simple Python3 issue, and the solution below works fine, as far as I can tell so far. I post it here in case anyone finds it useful: I defined a "modules checkpoint" to which I can roll back to: >>> from modules_checkpoint import ModulesCheckpoint >>> checkpoint = Modul

Re: Defining base templates for reusable apps

2015-05-11 Thread Some Developer
On 09/05/15 11:47, Bruno A. wrote: Hi, I've never done it, but I myself want to do a similar thing, so I've been thinking about it a bit. The solutions I've thought of are the following: * Template inheritance, as you mention. You provide the base template, but it might not be straightfor

Re: Switching settings, in a non-webapp?

2015-05-11 Thread David Sieger
I think I understand now. Never mind, then. ;-) Am 12.05.2015 um 00:00 schrieb Doug Blank: > On Mon, May 11, 2015 at 4:44 PM, David Sieger > wrote: > > If restarting the whole http service is an option, you could think > about a setting up a separate servic

Re: Switching settings, in a non-webapp?

2015-05-11 Thread Doug Blank
On Mon, May 11, 2015 at 4:44 PM, David Sieger wrote: > If restarting the whole http service is an option, you could think about > a setting up a separate service that is capable of stopping/starting your > http service. You could then order this new service from within the http > service to rest

Re: Switching settings, in a non-webapp?

2015-05-11 Thread David Sieger
If restarting the whole http service is an option, you could think about a setting up a separate service that is capable of stopping/starting your http service. You could then order this new service from within the http service to restart the http service with a different settings module. (I'm thin

Use 3rd party django package in my own project (PYTHONPATH)

2015-05-11 Thread Kasra Khosravi
i am creating a susbcription management system and I want to use a third party django package for reporting : https://github.com/juanpex/django-model-report Since I am new to django, I'm not sure how to use it, First I install it using pip (I have also tried installing it using setup.py), after

Re: Two questions on Django Tutorial.

2015-05-11 Thread Tim Graham
You are using Python 2, but the tutorial is written for Python 3 as noted in part 1. If you aren't willing to switch to Python 3, you can rename the __str__ method to __unicode__ as the comment indicates. On Monday, May 11, 2015 at 12:35:39 PM UTC-4, SUBHABRATA BANERJEE wrote: > > Dear Group, >

Two questions on Django Tutorial.

2015-05-11 Thread SUBHABRATA BANERJEE
Dear Group, I am very new to Django, and started with Django on Windows. I am using Python 2.7.9. I have some issues learning it. (a) I was following the Tutorial given in https://docs.djangoproject.com/en/1.8/intro/tutorial02/ It is generally going fine I am using, 1.8.1 of Django as given i

Re: Django Limitation

2015-05-11 Thread aRkadeFR
Please refer to all existing project in django: http://stackoverflow.com/questions/886221/does-django-scale :) On 05/11/2015 06:15 PM, Arindam sarkar wrote: can django be used for large projects ? -- Regards, Arindam Contact no. 08732822385 -- You received this message because you are subs

DjangoCon US 2015 Proposals Deadline

2015-05-11 Thread Andrew Pinkham
There are only 4 days left to submit a proposal to DjangoCon US 2015 ! We want to hear about your experience with and around Django. However, talks: - Don't need to be about Django specifically - Don't need to be 100% fleshed out. - Don't need to be pure

Switching settings, in a non-webapp?

2015-05-11 Thread Doug Blank
Django users, We are using Django for two purposes: its ORM for a single-user desktop app, and for a regular Django webapp. For the desktop ORM, is there a way to switch between different settings.py? For example, we'd like to be able to load the default settings, but then later unload everything

Django Limitation

2015-05-11 Thread Arindam sarkar
can django be used for large projects ? -- Regards, Arindam Contact no. 08732822385 -- 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...@

Re: SETTINGS Error

2015-05-11 Thread SUBHABRATA BANERJEE
I misread so deleted the question -- 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 group, send email to

Re: SETTINGS Error

2015-05-11 Thread Sergiy Khohlov
You have not configured database in your setup. Your error is popped up in this case. 11 трав. 2015 18:57, користувач "SUBHABRATA BANERJEE" < subhabrata.bane...@gmail.com> написав: > Dear Group, > > I am pretty new to Django. I was using > https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to

SETTINGS Error

2015-05-11 Thread SUBHABRATA BANERJEE
Dear Group, I am pretty new to Django. I was using https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to learn aspects of Django. As I gave the command in IDLE, from django.db import models I am getting the error as, Traceback (most recent call last): File "", line 1, in from djang

Re: percentage or number data entry solution please

2015-05-11 Thread Mike Dewhirst
On 11/05/2015 11:42 PM, Derek wrote: I realise this is probably overkill for your needs; but django-suit allows for a ton of customisation options for the admin, one of which is the ability to supply "units" as part of the data entry forms - see: http://django-suit.readthedocs.org/en/latest/widge

Re: rollback the update query

2015-05-11 Thread Tom Evans
On Mon, May 11, 2015 at 11:44 AM, Simran Singh wrote: > I am really new to Django and I am using Django 1.8. Many of the > manual_transaction features have been depreciated in this. I have used > @transaction.atomic(None, True) nit; these are the defaults. You might as well just say: @transact

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
Puting plain, you just need to execute a POST request on the client side. That makes aviable the content on the request.POST property on your client side view. Wich tecnology you use to make the post request doesnt matter. The only thing you need to keep in mind is when you "navigate" through your

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
I want to display HTTP POST data from client side to on the server side and what am supposed do to achieve? On Mon, May 11, 2015 at 3:31 PM, Jani Tiainen wrote: > Hi, > > Sounds like you're mixing up terms and technologies here and really you > are trying something that Django was never designed

Re: percentage or number data entry solution please

2015-05-11 Thread Derek
I realise this is probably overkill for your needs; but django-suit allows for a ton of customisation options for the admin, one of which is the ability to supply "units" as part of the data entry forms - see: http://django-suit.readthedocs.org/en/latest/widgets.html#enclosedinput Your other opt

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Jani Tiainen
Hi, Sounds like you're mixing up terms and technologies here and really you are trying something that Django was never designed for. It would be really helpful to know what are you really trying to do, instead of just trying techniques that may or may not work for your case. On Mon, 11 May 20

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
Just to clarify, in your browser, if you simply "navigate" to the url of your view, the browser will issue a GET to the server. If you write the JavaScript function, you can specify the method of your request... preaty much the same thing as you did in the exemple that you sent. Its fairly trivia

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
Meaning write JavaScript code to make a request? how can achieve it other than writing JavaScript code? On Mon, May 11, 2015 at 3:13 PM, Guilherme Leal wrote: > The "navigation" of your browser always performs a GET method. If you're > trying to test that kind of request in the browser, the bes

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
The "navigation" of your browser always performs a GET method. If you're trying to test that kind of request in the browser, the best aproach would be open the JavaScript and make the request there. 2015-05-11 10:09 GMT-03:00 steve malise : > client code: > import httplib > import urllib > > data

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
client code: import httplib import urllib data = urllib.urlencode({'data':'data1'}) conn = httplib.HTTPConnection(myipaddr) headers = {"Content-type":"application/x-www-form-urlencoded", "Accept":"text/plain", "Content-Length:":len(data)} h.request('POST','/',data,

Re: How to fix the UnboundLocalError

2015-05-11 Thread François Schiettecatte
You have an ident issue of some sort. pre_ques is out of scope if the request.method is not POST. François > On May 11, 2015, at 7:24 AM, 田福顿 wrote: > > This is my code, > > def test_words(request): > if request.method == "POST": > i_d = request.user.id > pre_word = [] >

How to fix the UnboundLocalError

2015-05-11 Thread 田福顿
*This is my code, * def test_words(request): if request.method == "POST": i_d = request.user.id pre_word = [] pre_mean = [] pre_ques = {"word":"","option1":"","option2":"","option3":"","option4":""} key_list = ["option1","option2","option3","option4"]

rollback the update query

2015-05-11 Thread Simran Singh
I am really new to Django and I am using Django 1.8. Many of the manual_transaction features have been depreciated in this. I have used *@transaction.atomic(None, True)* to pack the transaction and rollback the updates if at any point the condition is not met. I tried to store the transaction

Django 1.7 - data migration which needs content types populated

2015-05-11 Thread Santiago L
Hi, I'm migrating an app from Django 1.6 to 1.7 and I need to create a data migration to load some initial data. Some of the migrations requires that Content Types are populated in order to create some objects with Generic Relations. # models.py class TincHost(models.Model): name = models.

Django inline formset(UI) delete/remove

2015-05-11 Thread Ajay Kumar
I'm trying to do a inline formset with UI not with dajngo built in inlineformset_factory form.Here i'm done with add_view and edit_view.Here in the edit view i can update the existing record for the both parent and child model,and can add new record to the child model.But i cant remove the exis

Re: Admin site in Django 1.8 tutorial giving CSRF errors

2015-05-11 Thread aRkadeFR
Can you provide us more information? Your url / views + admin.py and the settings at least? Thanks On 05/07/2015 05:36 PM, David Riddle wrote: No I have not made any changes to the admin templates. I simply followed the instructions in the tutorial. I am using Django's runserver per the tutoria