Django and pydoc - ImproperlyConfigured

2015-02-24 Thread Gergely Polonkai
Hello, I'm trying to document my own webpage's code so I will remember each piece if I have to touch it later. I added docstrings to several functions already, and while this is generally enough, I couldn't help but tried pydoc blog.models.Post What I got instead of the craved documents was an Im

django-users@googlegroups.com

2015-02-24 Thread Hossein Rashnoo
I use below code to authenticate in SharePoint in my view: import sudsimport logging logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) from suds.client import Client url = 'http://portal:8080/rashno/_vti_bin/lists.asmx?WSDL' from suds.transport.ht

Gunicorn sock file is missing?

2015-02-24 Thread 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 /path/to/my/gunicorn.sock * and in nginx log file: *connect() to unix:/path/to/my/gunicorn.sock failed

TypeError: __str__ returned non-string (type bytes)

2015-02-24 Thread Mike Dewhirst
This is driving me insane so any hints will be greatly appreciated ... Thanks Mike Here is the entire unedited test sequence plus failing code ... Python: 3.4 Django: 1.6.9 SQLite3: memory Creating test database for alias 'default'... .E.E... =

Re: Read a csv file and save data in postgresql

2015-02-24 Thread carlos
or maybe used this app, in the admin https://github.com/bmihelac/django-import-export Cheers On Tue, Feb 24, 2015 at 7:57 PM, Kelvin Wong wrote: > Looking at your code, maybe this one is better > > https://pypi.python.org/pypi/unicodecsv/0.9.4 > > This thing will make a dict, which you can mak

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

2015-02-24 Thread Russell Keith-Magee
On Wed, Feb 25, 2015 at 7:30 AM, 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 options, and narrowed m

Re: Django GUI Frameworks?

2015-02-24 Thread Vijay Khemlani
Old platforms such as ASP.NET "Classic" (not MVC) have some sort of widgets (Web Forms in the case of of ASP) that rendered very customized (and very ugly) HTML that "worked" with their backend. The trend nowadays is to separate the backend and frontend as much as posible, allowing any frontend fr

Re: Read a csv file and save data in postgresql

2015-02-24 Thread Kelvin Wong
Looking at your code, maybe this one is better https://pypi.python.org/pypi/unicodecsv/0.9.4 This thing will make a dict, which you can make into a object by feeding it to a modelform. K On Tuesday, February 24, 2015 at 3:53:19 PM UTC-8, elcaiaimar wrote: > > Hello, > > I have a website and I

Re: Django GUI Frameworks?

2015-02-24 Thread Russell Keith-Magee
Hi Thomas, On Wed, Feb 25, 2015 at 4:29 AM, ThomasTheDjangoFan < stefan.eichholz.ber...@googlemail.com> wrote: > Hi ya, > > I wonder if Django has any gui-frameworks which give common solutions for > handling frontend data, p.e. in combination with Twitter Bootstrap? > Some time ago I had a look

Delete the file related on the FileField

2015-02-24 Thread Karim
I'm using a form that get an image and store it in the database. Doing my (manual) tests I discover that the deleting the FileField doesn't remove the associated file on the hard disk. Is there a design pattern to handle the remaining file? Thank you. -- Karim N. Gorjux -- You received this me

Re: Form Wizard: how to send instance_dict based on the request

2015-02-24 Thread Karim
On Fri, Feb 20, 2015 at 5:49 AM, Collin Anderson wrote: > You could instead just override get_form_instance(step). That way you'll > have access to self.request. > ​Thank you!​ -- Karim N. Gorjux -- You received this message because you are subscribed to the Google Groups "Django users" g

Form Wizard: store the session values

2015-02-24 Thread Karim
When I click on the link for my form, I would like to restore the session values if the user accidentally left the wizard or other cases happened. How I can restore the session and initialize the FormWizard with the session values? Everytime I click on the link to render the view I got an empty fo

Form wizard: how I can jump on a specific step?

2015-02-24 Thread Karim
Hi all! I'm moving a really long form on a FormWizard[1] using the class " SessionWizardView ​" everything is fine. All works in adding and editing of the model I'm using on the modelset. Now I have some questions to improve the "quality" of the wizard. I added a navbar with the active class for

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

2015-02-24 Thread Andrew Farrell
As Vijay said, most of the performance of a web app (in any framework) is database access. With django, you can use the Django Debug Toolbar or the db.connection.queries

Re: Read a csv file and save data in postgresql

2015-02-24 Thread Vijay Khemlani
Parsing a CSV file is not a particularly hard thing to do https://docs.python.org/2/library/csv.html You can change the example to read from the file in your model an instead of printing to the console, to store it in the database. On Tue, Feb 24, 2015 at 8:53 PM, elcaiaimar wrote: > Hello, >

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

2015-02-24 Thread Vijay Khemlani
It's true that the Global Interpreter Lock will prevent threads from a single process from running concurrently, but your server (uWSGI, gunicorn, etc) will spawn multiple process that don't conflict with the GIL. Also, if you need some form of multiprocessing celery is a good choice, and one that

Read a csv file and save data in postgresql

2015-02-24 Thread elcaiaimar
Hello, I have a website and I need that users can introduce a csv file and save their data in a postgresql database. I can introduce a file and save it in media_dir and in the database (only the url). But what I want is save each row as a register in a table. I've searched some examples but I h

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

2015-02-24 Thread Alex Mandel
On 02/24/2015 03: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 options, and narrowed my > choi

Python / Django slow ? Deciding my next technological stack

2015-02-24 Thread Benj
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 options, and narrowed my choice to 2 stacks: C sharp asp.net MVC or Python /

Django 1.6 vs Django 1.4, creation of child instance immediately referenced by parent?

2015-02-24 Thread Pongetti
Hello all, I started a project way back in the days of Django 1.4. I am trying to upgrade to version 1.6 to make use of some new features. Anyway, I am coming across this curious change. Its probably meant to be a fix rather than a bug, but its causing huge issues with my code and I did not

Re: Django App DB replicas - call for suggestions

2015-02-24 Thread Blazor
Hi Cal (and all others), >From what I can tell, you want to run a copy of the database on > multiple mini devices and have replication between them? I think I've actually made myself not perfectly clear. My plan would be to have a local portable django server for letting all the tablets in a

Re: django deployment in a virtual machine.

2015-02-24 Thread dk
its just a website with one link =) basicly shows one graph. and that's it. On Tuesday, February 24, 2015 at 3:41:14 PM UTC-6, george wrote: > not production i hope. > > in prod use nginx. if not on prod use runserver 0.0.0.0:8000 > Em 24/02/2015 18:37, "dk" > escreveu: > >> I got a virtual machi

Re: django deployment in a virtual machine.

2015-02-24 Thread George Silva
not production i hope. in prod use nginx. if not on prod use runserver 0.0.0.0:8000 Em 24/02/2015 18:37, "dk" escreveu: > I got a virtual machine with Linux centos that we are going to use for our > django webpage. > that machine will have the html service on. so when people go to the > computer

django deployment in a virtual machine.

2015-02-24 Thread dk
I got a virtual machine with Linux centos that we are going to use for our django webpage. that machine will have the html service on. so when people go to the computer typing the IP, will show them the webpage. is there any special trick to do? like make a service that lunch manage.py with th

Django GUI Frameworks?

2015-02-24 Thread ThomasTheDjangoFan
Hi ya, I wonder if Django has any gui-frameworks which give common solutions for handling frontend data, p.e. in combination with Twitter Bootstrap? Some time ago I had a look at the YII PHP Framework and they have a great solution called Yiibooster (check it out at http://yiibooster.clevertech

Re: [solved] Migrating to initial migration: "ORA-00955: name is already used by an existing object"

2015-02-24 Thread Carsten Fuchs
Hi all, it seems like I found the culprit, along with a simple solution: https://code.djangoproject.com/ticket/24407 :-) Best regards, Carsten -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Why am I getting ValueError: Unable to configure logger 'django_request': Unable to add handler 'request_handler': 'request_handler'?

2015-02-24 Thread Deanna Robertazzi
I am making a Django site and when I run ./manage.py shell, I get this traceback: /home/deanna/django_test/static/ Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/deanna/django-deanna/local/lib/python2.7/site-packages/D

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

2015-02-24 Thread Andreas Kuhne
The file you wrote connects to the database itself, it doesn't use djangos connection, so the only thing you are testing is if you can connect to the database. And that we know (because you are able to do it with ./manage.py dbshell). What you need to check is if the settings.py file used by django

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

2015-02-24 Thread C. Kirby
I'm sorry I missed this thread at the beginning. I have an app that basically gives you the ability to build "advanced search" forms in almost the same way as model forms. You can take a look at it at https://github.com/ckirby/django-modelqueryform If you try it or at least look at it, please l

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

2015-02-24 Thread alexandrosstylianou88
Well i have created the below test script to check if i am able to connect to the DB using mod_wsgi and i get back the sysdate from the DB.. I have configured mod_wsgi under the alias /test to execute the below script and i always get the time.. So it seems that the configuration in mod_wsgi is

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

2015-02-24 Thread Andreas Kuhne
Hmmm You can use ./manage.py dbshell, so your configuration is correct in THAT case, however, have you set all the variables correctly for django when running apache + mod_wsgi? Has the connection ever worked there? What do the config files for mod_wsgi look like and are all of the paths correctl

Index(View) rendering template instead of view

2015-02-24 Thread Brad Rice
So I have a RedirectView.as_view() going to a page in an app called web. In the app web this is my view: class Index(View): def get(self, request, *args, **kwargs): return HttpResponse('Hello, World!') However, instead of showing that, when I get redirected to the app it shows my b

Re: Django sometimes shows partial (incomplete) json data in production env

2015-02-24 Thread Javier Guerra Giraldez
On Mon, Feb 23, 2015 at 11:54 PM, George Mejia wrote: > > Besides, this only happens on production env ... The code is fine and works > on production env, and the behaviour was normal before ... this also happens > for others queries (all only in production), I wonder what is cutting > conexi

Re: Using class based views.

2015-02-24 Thread Javier Guerra Giraldez
On Tue, Feb 24, 2015 at 1:51 AM, James Schneider wrote: > However, if you have working view functions, what is the"need" to switch to > CBV's? this. the switch to CBV, wasn't "modern Django views are classes instead of functions; Get rid of your functions!, FBV are dead!". Instead it's just t

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

2015-02-24 Thread alexandrosstylianou88
Is there any way to find out where the problem occurs ?? Is there a way to enable some debugging or trace in order to see which python scripts are called in Django and find out where the whole process is failing ?? In the last lines of the stack trace it tries to close the connection and for s

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

2015-02-24 Thread Andreas Kuhne
The reason I asked this is because that means that your connection parameters are correct, so it should work? Sorry I don't know what to do to help you more. Regards, Andréas 2015-02-24 12:49 GMT+01:00 : > Hi Andreas, > > I can connect using "python manage.py dbshell" it connects without any >

Django sometimes shows partial (incomplete) json data in production env

2015-02-24 Thread George Mejia
I request some json data by some url, sometimes it works fine and *sometimes doesn't* ... I looked another related cuestion here , but it seems to recommend not change content-length by middleware ... my json data incomplete is as i

Re: modelFormSet and csrf

2015-02-24 Thread joulu tervehdys
Hi,Yes csrf was missing, but got it working by changing render_to_response to render. Surprising that example code was not designed to work as such Still I would like to get action buttons for each row. Admin view has at least some kind of links in each row. -thanks 2015-02-24 12:52 GMT+02:00 aRk

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

2015-02-24 Thread alexandrosstylianou88
Hi Andreas, I can connect using "python manage.py dbshell" it connects without any error. Is there a difference, if i am not mistaken the dbshell test shows that the configuration of the DB is correct and that i can connect from the machine, correct ?? From the stack trace it seems that the

Re: Edx LDAP Auth setting

2015-02-24 Thread Mario Gudelj
To check the version go to shell and run this: >>> import django_auth_ldap >>> django_auth_ldap.version (1, 1, 2) >>> As for virtualenv, it's a good practice but it's not necessary. By the way, have you tried performing a simple search on the LDAP server? I think that your best bet is to star

Re: modelFormSet and csrf

2015-02-24 Thread aRkadeFR
Please, print your variable request.POST on your view and see if the csrf_token is missing or not? Same for your formset variable :) On 02/24/2015 09:55 AM, joulumaa wrote: Thanks, but I did exactly that and still 403 csrf error, attached my template and related code thanks for help {% csrf_t

Re: modelFormSet and csrf

2015-02-24 Thread joulumaa
Thanks, but I did exactly that and still 403 csrf error, attached my template and related code thanks for help {% csrf_token %} {{ formset }} def school(request): SchoolFormSet = modelformset_factory(SchoolHistory) if request.method == 'post': formset =

Re: modelFormSet and csrf

2015-02-24 Thread aRkadeFR
Hello :) The template indeed doesn't show the submit button in the documentation here: https://docs.djangoproject.com/en/1.7/topics/forms/formsets/#using-a-formset-in-views-and-templates In order to add the csrf token, you can use the template tag {% csrf %} inside the form tag. And add the subm