form_invalid and missing ob

2015-05-14 Thread David
Hi When I submit my form with no errors it correctly processes and returns after completing form_valid. However, when I submit my form with errors I get a django dump stating that 'ShowForumPostsView' object has no attribute 'object_list'. I am struggling to make it return to the same page bu

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 ema

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"

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, request

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 <mailto:david-dja...@conceal.at>> wrote: > > If restarting the whole http service is an option, you could think > about a

Re: Switching settings, in a non-webapp?

2015-05-11 Thread David Sieger
x27;m thinking ZeroMQ, but there are definitely other ways to implement this.) David Am 11.05.2015 um 18:17 schrieb 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

Generic template; determining information about calling view/app

2015-05-08 Thread David
Hi Sorry if this is confusing, it's the best I can describe. I have been separating my templates for inheritance clarity. I have a generic template 'category_list.html'. This can be used by different apps because the layout is the same. What I need to do in order to use appropriate links in th

Re: Admin site in Django 1.8 tutorial giving CSRF errors

2015-05-07 Thread David Riddle
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 tutorial instructions. I am totally stumped. David On Thu, May 7, 2015 at 3:04 AM, aRkadeFR wrote: > Hey, > > You shouldn't see the

Admin site in Django 1.8 tutorial giving CSRF errors

2015-05-06 Thread David Riddle
is? Thanks, David R. -- 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

How do I use database views in django

2015-04-28 Thread David Levy
How do I use database views in django, many falão that view must be mapped same table, but it should certainly give problems using the migration. What is the best alternative to be used in this situation? heard in django- datatable-view is an alternative? -- You received this message because yo

Re: form_invalid redirection with CBVs

2015-04-27 Thread David
Got this working. See below: class CreateComment(MultipleObjectMixin, FormView): template_name = 'comment/comment_list.html' form_class = CommentForm model = Comment paginate_by = 5 def post(self, request, *args, **kwargs): if not request.user.is_authenticated(): return HttpResponseForbidden() se

Re: form_invalid redirection with CBVs

2015-04-24 Thread David
This is what I am working from btw: https://docs.djangoproject.com/en/1.8/topics/class-based-views/mixins/#an-alternative-better-solution -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

form_invalid redirection with CBVs

2015-04-24 Thread David
Following a form_invalid I need to redirect to the CreateComment view below with the errors shown in the form. Is this possible please? Highlighted is where I need help. Thank you for any assistance. class Comments(View): def get(self, request, *args, **kwargs): view = CreateComment.as_view()

Re: ListView CBV and a form

2015-04-24 Thread David
This appears to work. Using a view for 2 functions seems pretty fugly though. Are there better ways to achieve this? class CreateComment(ListView, FormMixin): model = Comment paginate_by = 2 form_class = CommentForm def post(self, request, *args, **kwargs): form = CommentForm(self.request.POST)

ListView CBV and a form

2015-04-24 Thread David
Hi I am using the following: class CreateComment(ListView): model = Comment paginate_by = 2 form_class = CommentForm def post(self, request, *args, **kwargs): if not request.user.is_authenticated(): return HttpResponseForbidden() self.object = self.get_object() self.object.creator = request.use

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-22 Thread David F
Got it to work-- changed permissions of my shared part of the server using the bash: chmod 755 . thanks james for thinking through this with me On Sunday, April 19, 2015 at 5:49:41 PM UTC-7, David F wrote: > > oh and yes-- I SSH into my part of the server that's how I'm able t

Re: Version

2015-04-21 Thread David Palao
Hello, Your question is too vague. Also some context would be helpful. What system you are working on? What Python version? How did you install django? What are you trying to do? What database you are interested in? For example. Best 2015-04-21 12:47 GMT+02:00 Parikshit Mishra : > hello everyone

Re: django

2015-04-21 Thread David Palao
Hello, I suggest you to go to https://www.djangoproject.com/ and have a look at the docs in there. Best 2015-04-21 7:23 GMT+02:00 Parikshit Mishra : > hello I want to learn django from scratch please help me > > -- > You received this message because you are subscribed to the Google Groups > "Dja

Re: Create models table from exists database?

2015-04-21 Thread David Palao
Hi, Yes, in principle you can.The keywords are "legacy database": https://docs.djangoproject.com/en/1.8/howto/legacy-databases/ Best 2015-04-21 9:15 GMT+02:00 Dario Concilio : > Hi to all! > I'm new of django, I've a question for you: Can I create a new project using > an exists database? > > I'v

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-21 Thread David Palao
Hi, Have you had a look at "psutil"? It is a python module to manage processes. Best 2015-04-21 9:20 GMT+02:00 SHINTO PETER : > Hi > François Schiettecatte , limit memory and CPU usage for python socket client > service > > On Mon, Apr 20, 2015 at 11:24 PM, François Schiettecatte > wrote: >> >>

Question about run bash scripts on Django-Python

2015-04-20 Thread David Pineda
ystem only recognize the 'echo' command but the another like grep, awk or sed they say 'command not found'. eg: "home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 70: xlsx2csv: command not found /home/david/Documents/WEB_PROJ/ges

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-19 Thread David F
oh and yes-- I SSH into my part of the server that's how I'm able to do all this :X the database file is in the project folder just... it's coming up with that message when I try to open it in shell -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-19 Thread David F
sqlite> .read db.sqlite3 Error: incomplete SQL: SQLite format 3pp_label", "model")) �ite_autoindex_django_content_type_1django_content_type P ++ Ytablesqlite_sequencesqlite_sequence CREATE TABLE sqlite_sequence(name,seq)�Y // �atabledjango_migrationsdjango_migrations CREATE TABLE "django_

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-19 Thread David F
Or I'm using sqlite should I switch to mysql? -- 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, s

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-19 Thread David F
Hey James Sorry I forgot to mention that I did run first ./manage.py syncdb to create a superuser for the database and the admin, and have run makemigrations and migrate several times throughout editing my models, still to no avail. I did it again after seeing your post just to be sure :p same

Django Server Deployment - OperationalError on shared hosting ASO

2015-04-18 Thread David F
Hi guys!! Great to be a part of the community. So as the title says, I am deploying a site I made locally to a shared hosting server through "A Small Orange" or ASO. My site structure is as follows: don't judge my naming structure :p (unless it actually is messing something up) /home/my_usern

Re: Django Admin should really support Twitter Bootsrap

2015-04-14 Thread David Gleba
I am a novice here with Django. I am trying to understand your question more deeply. I agree with your ideas. I tried the following and it seemed to work OK, although I may not have tried all aspects. https://github.com/django-admin-bootstrapped/django-admin-bootstrapped Is this close to what

Custom field definition for an iterable Python object

2015-04-07 Thread David Pick
I'm trying to write a custom field definition for a Python object that happens to be iterable. Most of the time it works, but sometimes I get an error generated in 'django/db/models/sql/where.py' in '_prepare_data' where the code tries to generate all the values in the iterable object because

Performance of file-based sessions vs database-backed sessions

2015-03-27 Thread David Riddle
appropriate for production environments with large amounts of traffic? Thank you, David Riddle -- 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-user

Re: newbie question

2015-03-20 Thread David Gleba
need python or django to get form input and do something with the input. Also, I am not an expert in Django yet, but I think you can use html and javascript in views. On Friday, March 20, 2015 at 12:03:51 PM UTC-4, VMD wrote: > > On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David

Re: newbie question

2015-03-20 Thread David Gleba
Does part 3 of the tutorial cover how to make a form, get the values without storing them in a database, perform the arithmetic and then display the result? I didn't see that in there. On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote: > > The other commenters are right tha

Can't run django!

2015-03-04 Thread David Zahedi
Hi there, I am using python 2.7 and django 1.75; when I run "manage.py runserver" I get the following error: CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False. An exception has occurred, use %tb to see the full traceback. My DEBUG is True. Thanks -- You received this me

Re: Melb Django School Second GO

2015-03-01 Thread David Mutton
Sounds great! I wish I was in Melb rather than Adelaide. On Monday, 2 March 2015 17:57:35 UTC+10:30, MelbDjango School wrote: > Hey Guys, > > Melb Django & Common Code is starting its second round of free classes on > Django. The classes are going to be held fortnightly starting March 12 from

Re: Django Wysiwyg and images (Summernote or Froala)

2015-03-01 Thread David Mutton
at is going wrong and the image does not appear. > > Sakis > > Τη Τετάρτη, 4 Φεβρουαρίου 2015 - 12:04:30 π.μ. UTC+2, ο χρήστης David > Mutton έγραψε: > >> Hi, >> I've been trying to integrate a WYSIWYG editor into my Django project. I >> first started

Django Wysiwyg and images (Summernote or Froala)

2015-02-03 Thread David Mutton
Hi, I've been trying to integrate a WYSIWYG editor into my Django project. I first started with Summernote and I had no issue integrating the it into admin or a form. I followed the instructions on their github and everything works great except image uploading and inserting. The file is uploadin

Re: Processing uploaded csv on the basis of user input

2015-01-17 Thread David Mutton
h of these dropdowns is also passed to the hidden intfields. On save() the json is processed using the values in the intfields to populate a second model. The second model just has 4 charfields for the street address, suburb, state, postcode. On Friday, 16 January 2015 13:24:13 UTC+10:30, Da

Processing uploaded csv on the basis of user input

2015-01-15 Thread David Mutton
Please let me know if this is an inappropriate question. I feel it is a little broad. I am fairly new to Django and coding an app for educational purposes. What I am trying to achieve is to allow users to upload a CSV and then populate a model by specifying that datatype that is in each colum

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread David Palao
Hello, >From your post I understand you did not write unittests for your models? I would recommend to write some sensible tests for them and start tracing your problem from the failures you should get. Best, David 2014-12-15 8:15 GMT+01:00 Shazwi Suwandi : > I've added 'core'

Newbie help - running django-admin.py produces empty mysite folder

2014-11-27 Thread David Pride
Title says it all really. Have just installed Django 1.8, can test django version and get correct response so am *fairly* happy it's installed correctly. I have had Python 2.7 installed and been using perfectly for several months. Altered the PATH variable as discussed so it points to correct

Re: how to test an application that's using a legacy database

2014-11-12 Thread David Palao
2014-11-12 0:25 GMT+01:00 Carl Meyer : > Hi David, > > On 11/11/2014 08:37 AM, dpalao.pyt...@gmail.com wrote: >> Dear Carl, >> >> Thank you for the answer. >> >> On Tuesday, November 11, 2014 3:13:18 PM UTC+1, Carl Meyer wrote: >> >>

Re: running unit tests with legacy database: Error 1050, Table already exists

2014-11-06 Thread David Palao
line "managed = False" and run makemigrations, the test passes. But I have checked that "managed" is switched to True during the tests. Any ideas? Thanks in advance, David 2014-11-05 18:45 GMT+01:00 Collin Anderson : > Hi David, > > Interesting. Shouldn&#x

Re: Does Django detect changes in models Meta ?

2014-09-02 Thread David Los
Very, very good question. I am experiencing the same issues with Django 1.7rc2 and 1.7rc3. Syncdb and sql statements are intended for Django < 1.7. Would love to hear a solution! Op vrijdag 22 augustus 2014 09:32:43 UTC+2 schreef termopro: > > Hi there, > > I am using Django 1.7 RC2. > I have c

django installation

2014-06-11 Thread David Moya
So i supposedly installed Django because on the terminal, after going through the whole process of installation, it says "Successfully installed Django". However, when i try to run the command: python -c "import django; print(django.get_version())" I get: ImportError: No module named django. Wh

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread David Malcolm
thanks for your reply WB. I was hoping to avoid virtualenv. My webapp is a frontend to a vulnerability scanner in a large corporation. They are very picky about what I can use and what I can't. Is virtualenv suitable for such a production system? They insist that I cannot use mod_wsgi (it annoy

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread David Malcolm
Hi Timothy thanks for your suggestions. I'm still on the path. I'll put more details in my reply to WongoBongo below. cheers Dave -- 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

django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread David Malcolm
I have been tasked with finishing a build for production that was interrupted due to another staff member leaving at short notice. It's RedHat Enterprise Linux 5 and there are two versions of python on the box. If I type python I get version 2.7. However if I try and use django-admin.py I find

AssertionError: False is not true when moving to Function Based Views

2014-04-10 Thread David Ingledow
I am using Test Driven Development methods to create a basic blog in Django 1.6. I followed [this tutorial](http://matthewdaly.co.uk/blog/2013/12/28/django-blog-tutorial-the-next-generation-part-1/) but wanted to change to using Function Based Views since I'm just starting with Django. I get

[newbie] -- Regex-matching ("Tango with Django")

2014-03-14 Thread David
sure this was intended. The author possibly wanted to create http://127.0.0.1:8000/about/instead of http://127.0.0.1:8000/rango/about/ Thanks for clarifying this issue for me! Cheers, David Here is my project/urls.py from django.conf.urls import patterns, include, url from django.contrib impo

Re: [newbie] BASE_DIR vs. SETTINGS_DIR

2014-03-09 Thread David
Dear Russell, thanks -- brilliant advice! Greetings from Copenhagen, David On 09/03/14 01:10, Russell Keith-Magee wrote: > > On Sun, Mar 9, 2014 at 5:09 AM, David <mailto:ld...@gmx.net>> wrote: > > Dear list, > > I follow > http://www.tan

[newbie] BASE_DIR vs. SETTINGS_DIR

2014-03-08 Thread David
(os.path.dirname(__file__)) that looks very similar to the next three lines I added. Am I reproducing code here? Do I make a mistake if I take the BASE_DIR~ line out? Thanks for your guidance! David settings.py (slection): # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import

Re: Newbie: ImportError during syncdb

2014-03-07 Thread David
Dear Robin and Jay, thanks, I was able to solve my problem: setting.py just wants the name of the app. Cheers, David On 06/03/14 08:42, Jay Parikh wrote: > Let say for example i am going to create new app say bookmarks then i > will do something like *"python manage.py startap

Newbie: ImportError during syncdb

2014-03-05 Thread David
following "Learning Website Development with Django" by Ayman Hourieh. I am not working in a virtualenv. Thanks for your guidance and hints! David settings.py: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contentt

Re: How to change language by clicking on link (using GET not POST) (set_language redirect)

2014-02-05 Thread David Seddon
It might be that you just want a link to the current page in another language. If you need that, see my comment here: http://stackoverflow.com/questions/11437454/django-templates-get-current-url-in-another-language/21573776#21573776 On Tuesday, 15 April 2008 01:03:56 UTC+1, Simon Tite wrote: >

Re: Encoding UTF 8 (añ,etc) and datetime function

2014-01-14 Thread David Pineda
(s), it will be %s." % (offset, dt) return HttpResponse(html) Whit utf8 SyntaxError at /time/plus/99/ Non-ASCII character '\xc3' in file /home/david/Documents/Django/tutorial2/base1/base1/views.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for

Encoding UTF 8 (añ,etc) and datetime function

2014-01-14 Thread David Pineda
Hello, i'm beginning to learn python+django and i'm doing that handbook https://github.com/jacobian/djangobook.com/blob/master/chapter03.rst In the example whit datetime i have a problem when i active the utf-8 encondig because i use á,ñ, etc (i'm chilean and we talk in spanish) So, when i deacti

Re: Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
erstand how :-) Thanks!! On Wednesday, January 8, 2014 6:36:02 AM UTC-6, Daniel Roseman wrote: > > On Wednesday, 8 January 2014 05:16:32 UTC, David Nides wrote: >> >> Greeting, >> >> I am trying to bind a jQuery grid to MySql database using PHP and serve >> u

Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
If it helps I am running Windows 7. Appreciate any guidance. Thanks!! David Nides -- 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 djang

Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
JQuery<http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/bind-jquery-grid-to-mysql-database-using-php.htm> demo? Any guidance is much appreciated. Thanks!! David Nides -- You received this message because you are subscribed to the Google Groups "D

Re: ModelMultipleChoiceField ignore invalid choices?

2013-10-09 Thread David Cox
This could be handled in the form clean() and/or save() methods using a try/catch block and passing on thrown exceptions. You'd have to figure out what would be an acceptable way to handle a form submission with an invalid selection, though. On Monday, October 7, 2013 11:15:43 AM UTC-5, Jon Du

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-09 Thread David Cox
I just rtfc, and it might have been a copy-paste mistake, but the 'str_value' field in your 'DirEnumVal' class has unmatched quotation marks for the default attribute. On Monday, October 7, 2013 8:40:33 PM UTC-5, Doug S wrote: > > I don't think I'm making a rookie mistake, I've looked over my co

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-09 Thread David Cox
There's a chance that running 'manage.py sqlall' might show errors that syncdb can't display before failing. 'manage.py sqlall' validates the SQL without trying to commit it, so to save time in the future, you should really run it before syncdb every time. If not, and the app is installed, che

Re: Have browsers broken post-redirect-get? best practice now?

2013-10-03 Thread David Durham
I think when they hit the browsers back button, the form will have the data they entered previously. When they submit it, since it was already submitted previously, you could just make it an edit action, or do whatever is appropriate given that they are submitting the same form again. I think the

Re: Dealing with redundant JS inclusions at template levels

2013-10-01 Thread David Cox
The second StackOverflow answer is probably your best bet. Assuming your looking for a solution that avoids editing any included app templates, you'd want to use the solution that HTML5 Boilerplate uses, which is a Javascript conditional inclusion: window.jQuery || document.write('