Re: [OT] Is Trump planning to break the Internet?

2017-12-13 Thread Chris Seberino
Maybe this will shed some light https://medium.com/@cseberino/toll-equality-b11b07267456 > > -- 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+u

Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Chris Seberino
> > > > And what does your handle_404 function look like? As the error says, it > needs to accept an "exception" keyword argument. > > Note also that overriding the 404 handler is a very specialized thing to > do and is almost always not required. Why are you doing this? > > Here it is. The

Re: Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-12 Thread Chris Seberino
> > >> >> Please explain "TypeError: handle_404() got an unexpected keyword >> argument 'exception'" >> > > It means literally that "handle_404() got an unexpected keyword argument > 'exception'", how are you calling handle_404()? > > Thanks for your help. In my urls.py I have this... django.c

Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'"

2017-12-11 Thread Chris Seberino
I'm trying to get a 404 page to show instead of a 500 error when Django app sees a nonexistent URL. I'm still getting 500 errors with this clue in logs but I don't know what it means Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'" (The nonexistent U

Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Chris Seberino
I didn't have logging enabled in my settings.py. Problem solved. > > > > --- > % more nginx.conf > > server { > server_name ~^(www\.)?domainname\.(org|co

Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Chris Seberino
> > For more information, you need to show us your nginx configuration and > your wsgi server configuration. > > > Thanks a million. Here is what you asked for... --- % mor

Why get "Server Error 500" instead of 404 template?

2017-12-10 Thread Chris Seberino
I cannot track down why 404 page isn't being used. I can't get any help from syslog or Nginx log files. I tried adding DEBUG=True to settings.py and still no clues. I only get "Server Error 500". Here is settings.py TEMPLATES= [{"BACKEND" : "django.template.backe

How modify Django to set URLs with decorators on the view functions like Flask? (rather than using urls.py)

2016-09-09 Thread Chris Seberino
Flask has a neat design where instead of having a urls.py file they bind URLs to view functions with decorators. Possible to do something similar with Django? What modifications would be needed? Thanks, cs -- You received this message because you are subscribed to the Google Groups "Django

How make Django sites look as professional as WordPress just as easily as WordPress is easy?

2016-08-14 Thread Chris Seberino
I love Django. It is a beautiful system for developers. You seem to start at a lower level with Django than with WordPress which gives you more power and flexibility. Nevertheless, I also like how WordPress STARTS with a very professional looking sites and almost locks you into a nice looking

Re: Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )

2016-04-23 Thread Chris Seberino
at 7:50:21 PM UTC-5, Stephen Butler wrote: > > You mean on the standard login form? The hidden "next" form value? That > value isn't part of a URL so it isn't URL escaped. It's part of the HTML > attribute value, so it is HTML attribute escaped. > > On

Re: Why / added automatically to all urls but base url?

2016-04-23 Thread Chris Seberino
Nevermindthis is weird but the / at end was there but Chrome browser doesn't display it. When I pasted the url into a terminal is was there. Also, using curl I got the real info and it was there. Weird On Saturday, April 23, 2016 at 5:10:52 PM UTC-5, Chris Seberino wrote: > >

Re: Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )

2016-04-23 Thread Chris Seberino
But I still don't see why sometimes the slash is escaped then sometimes it isn't. I've seen both ways for query parameters The ugly Escape version shows up when I have handmade URLs but not when Django creates the next URL itself like for logging in -- You received this message because yo

Why / added automatically to all urls but base url?

2016-04-23 Thread Chris Seberino
I have this urlpattern to map base url (easycharting.tk/) to a view called home... urlpatterns = [django.conf.urls.url("^$", mvc.controllers.controllers.home)] If you visit easycharting.tk/ you'll notice it automatically REMOVES the ending /. Why? For all other suburls, it ADDS the missing /!

Re: Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )

2016-04-23 Thread Chris Seberino
On Saturday, April 23, 2016 at 2:47:58 PM UTC-5, François Schiettecatte wrote: > > Because the slashes are escaped, this is normal as they are a parameter > and not part of the path itself. > > Why URLs created by Django show /'s instead of %2F's? The Django code knows how to fix the appeara

Django not adding / to end of URLS and since urls.py expects /, I now get 404s. How fix?

2016-04-23 Thread Chris Seberino
I am trying to be consistent and make urls.py expect / after every url. The problem is Django isn't automatically adding / at the end and so now I get 404s when I try to access my web pages. How fix? Thanks! Chris -- You received this message because you are subscribed to the Google Groups

Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )

2016-04-23 Thread Chris Seberino
Why redirects to foo.com/?next=/some/folder show up as foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? ) Is there a function I can call on URLs built in a view to avoid that? cs -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Why authenticate not returning User object in this case?

2016-04-22 Thread Chris Seberino
Solved...must add AUTHENTICATION_BACKENDS = ["django.contrib.auth.backends.ModelBackend"] to settings.py On Thursday, April 21, 2016 at 5:20:38 PM UTC-5, Chris Seberino wrote: > > I can't seem to get authenticate to return a User object even when > password is corre

Why authenticate not returning User object in this case?

2016-04-21 Thread Chris Seberino
I can't seem to get authenticate to return a User object even when password is correct. I dropped into a Django shell to recreate the problem. >>> js >>> js.username 'jsmith' >>> js.check_password("test") True >>> django.contrib.auth.authenticate(username = 'jsmith', password = "test") >

Re: Looking for ways to improve my skills

2016-04-05 Thread Chris Seberino
On Saturday, April 2, 2016 at 5:37:22 PM UTC-5, Devrhoid Davis wrote: > > Hi All, > > I have been working with Python for just over 3 years now and have > recently taken up django. I have completed both the polls app and have > created an address book app by following a tutorial on youtube. I

Re: How use model objects in ver1.9 WITHOUT an app and get rid off "Model class doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS." error mssg?

2016-04-05 Thread Chris Seberino
> > > Just think of an app actually being a namespace rather than an app. > Django uses INSTALLED_APPS entries just like a search path added to the > BASE_DIR so it can find your models. > > Ah yes thanks. That helped a lot. I just needed to basically mention the directory in settings.py and

How use model objects in ver1.9 WITHOUT an app and get rid off "Model class doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS." error mssg?

2016-04-04 Thread Chris Seberino
I'm trying to create a simple stripped down skeleton Django application. Django ver1.9 forces everything to be in apps which are not needed for this application. When I try using models I get an error like the following: "Model class doesn't declare an explicit app_label and isn't in an applic

Re: Django app runs with DEBUG=True but gives "Bad Request (400)" error with DEBUG=False (Using Apache and WSGI). Why?

2014-08-14 Thread Chris Seberino
Ug!! That was it!! THanks!!! cs On Thursday, August 14, 2014 10:14:34 PM UTC-5, Collin Anderson wrote: > > a quick thing to check: is your ALLOWED_HOSTS set correctly? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Django app runs with DEBUG=True but gives "Bad Request (400)" error with DEBUG=False (Using Apache and WSGI). Why?

2014-08-14 Thread Chris Seberino
If I set DEBUG=True this Django app runs fine. If I remove DEBUG=True I get a "Bad Request (400)" and apache error logs show lots of this.. [Fri Aug 15 03:04:27.400567 2014] [core:warn] [pid 2011:tid 140575764432768] AH00045: child process 2015 still did not exit, sending a SIGTERM [Fri Aug 15

Re: Why this error when run manage.py?-->AttributeError: 'module' object has no attribute 'execute_manager'

2014-08-11 Thread Chris Seberino
ODULE", "philfour.settings") django.core.management.execute_from_command_line(sys.argv) On Monday, August 11, 2014 11:00:22 AM UTC-5, Chris Seberino wrote: > > My fresh Django install on Ubuntu 14.04 works fine. WSGI starts the app > up just fine. > > I can run m

Why this error when run manage.py?-->AttributeError: 'module' object has no attribute 'execute_manager'

2014-08-11 Thread Chris Seberino
My fresh Django install on Ubuntu 14.04 works fine. WSGI starts the app up just fine. I can run manage.py without getting this error... % ./manage.py Traceback (most recent call last): File "./manage.py", line 6, in django.core.management.execute_manager(settings) AttributeError: 'modul

Anyone got Django working on Google App Engine? Seems there are inconsistent, incomplete and conflicting docs. Any advice appreciated....SOS

2014-07-31 Thread Chris Seberino
Is this the latest greatest docs for Django on Google AppEngine? http://django-nonrel.org/ There seems to be another page high on a search: http://www.allbuttonspressed.com/projects/djangoappengine#installation With the first doc I was able to get a toy Django app running wit

Re: user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-31 Thread Chris Seberino
Is there a way to answer your question "is user x logged into the website right now" in Django code? On Thursday, July 31, 2014 11:05:29 AM UTC-5, cmawe...@gmail.com wrote: > > Right, the question isn't "is user x logged into the website right now", > it actually only makes sense for for request

user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-29 Thread Chris Seberino
I tried viewing the value of is_authenticated() for a user and it always is true...before and after logging in and after signing out. I'm trying to determine if a user has logged in or not. Is this the right variable to use? Why not changing? Thanks. cs -- You received this message becaus

Why this database error in shell? (Query looks valid to me.)

2012-05-26 Thread Chris Seberino
I have Homework objects that are related to Course objects for a school related Django app. I can access Course and Homework objects but there is one Homework query at the end of this email that bombs and I don't know why. === First

Re: Problems extracting valid form data lately

2012-04-16 Thread Chris Seberino
> Field clean methods do not return cleaned_data dict, they return > specific data from within that dict. Tom Thanks so much! That fixed it! For the life of me I can't understand how my site has been operating for MONTHS without this bug manifesting itself. I guess my site didn't have to use

Re: Problems extracting valid form data lately

2012-04-16 Thread Chris Seberino
INVITATION_CODE = "You should have received one of these." PAR_EMAIL_ADD = "Will be used for all communications." PASSWORD= "" STUD_FIRST_NAME = "Enter what the student prefers to go by." STUD_LAST_NAME = "" COURSE_1= "Select the course enrolled in and/or getting tutoring in." CO

Problems extracting valid form data lately

2012-04-15 Thread Chris Seberino
The following code extracts the user info from a registration page on my Django site. Lately it isn't extracting the different fields from form.cleaned_data. When I print cd["username"] (i.e. form.cleaned_data["username"]) it gives the ENTIRE form.cleaned_data dict!?!?! Why can't I extract ele

Problems extracting valid form data lately

2012-04-14 Thread Chris Seberino
I don't know what changed but I can't seem to extract valid form data. (It was working for months previously.) Below is the function that creates new users when they register. I store the data in cd. I can print the contents of cd and confirm cd is a dictionary but I can't access any values!!! Fo

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-21 Thread Chris Seberino
On Jan 21, 2:43 pm, JohnA wrote: > How are you finding these objects?  That might point to the answer. > > Probably the likeliest explanation is that you are creating the > objects but not saving them. In the Django shell I do quests = Question.objects.all() quests[579].delete() Why does the ob

Re: Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

2012-01-21 Thread Chris Seberino
> Check your apache logs. Last line below says error is that there is no handler500. I thought a missing web page for some URL was a 404 error so I'm not sure why this error is popping up. cs [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] mod_wsgi (pid=19346): Exception occurred pr

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-21 Thread Chris Seberino
On Jan 21, 6:44 am, Tom Evans wrote: > Models are representations of rows in a database. > Deleting a model instance implies removing a row from a database. > Model instances have an id attribute which denotes their row in the database. > Models whose id is None don't exist in the database, and s

Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

2012-01-21 Thread Chris Seberino
I am proxying my Django app behind Apache. I created a 404.html in my template directory but when I try to test it I get the following error that appears to come from Apache... Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your requ

Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-20 Thread Chris Seberino
I get the following error when attempting to delete an object of my model... "AssertionError: Question object can't be deleted because its id attribute is set to None." The class definition is thus... class Question(django.db.models.Model): """ Represents a database table.

Re: Why when upload PDFs, Django says the content type is "application/text"?

2011-12-25 Thread Chris Seberino
On Dec 25, 7:53 am, Ivo Brodien wrote: > > I was getting "application/pdf" a few days ago with same client, > > server, browser, etc. > > If this really is the case and the code is exactly the same, maybe it depends > somehow on the PDF itself? Did you check that? I used the Linux/Unix file co

Advice/tips on how make private directory for each user?

2011-12-25 Thread Chris Seberino
I want some files to only be accessible by certain users. For example, imagine a teacher wanting to distribute graded exams on a Django server w/o violating any student's privacy. Is there an easy way to do this?I am aware of the access control decorator for specific views but not for specifi

Why when upload PDFs, Django says the content type is "application/text"?

2011-12-24 Thread Chris Seberino
I printed the content_type of an uploaded file in Django and noticed that for PDFs I was getting "application/text"? I was getting "application/pdf" a few days ago with same client, server, browser, etc. Anyone know what would cause content type to show wrong kind for PDFs? cs -- You received

Re: Why can't "directly" change array elements of model objects in Django shell?

2011-10-07 Thread Chris Seberino
On Oct 7, 10:39 am, Jacob Kaplan-Moss wrote: > On Fri, Oct 7, 2011 at 10:30 AM, Chris Seberino wrote: > > > I've noticed that this doesn't often work in Django shell... > > > x = MyModel.objects.all() > > x[3].some_field = "new value" > >

Why can't "directly" change array elements of model objects in Django shell?

2011-10-07 Thread Chris Seberino
I've noticed that this doesn't often work in Django shell... x = MyModel.objects.all() x[3].some_field = "new value" x[3].save() Rather, I must often do this... temp = x[3] temp.some_field = "new value" temp.save() *Sometimes* the first works and I don't know why. Please advise. Chris -- Y

Re: How control access to static pages that are *not* part of a Django app?

2011-08-01 Thread Chris Seberino
On Aug 1, 7:11 am, DrBloodmoney wrote: > You can look into protecting them with mod_xsendfile for Apache Thanks. I'll look into that. Is there no way to have a view hand off a page to Apache? If there was, I could have a view that was password protected and only when I was in the view would I

How control access to static pages that are *not* part of a Django app?

2011-07-31 Thread Chris Seberino
My Django app only allows someone to access a /books page, that is part of the Django app, if they are signed in. The pages below that URL are just static directory listings of PDFs all handled by Apache. For example /books/book_1, /books/book_2, etc. Because these directory listings aren't handl

Re: Unsafe to continue Django session unencrypted? (i.e. login with HTTPS then drop to HTTP after that?)

2011-06-14 Thread Chris Seberino
On Jun 14, 10:47 am, Tom Evans wrote: > Yes, of course it is - HTTP is stateless, so how else would sessions > work if the session id is not transmitted back to the server by the > browser? I agree. Yet, eBay, Google Groups & Godaddy drop down to HTTP after login. Why aren't they worred? cs -

Unsafe to continue Django session unencrypted? (i.e. login with HTTPS then drop to HTTP after that?)

2011-06-14 Thread Chris Seberino
I have Apache in front of my Django app. It forces login pages to use HTTPS but then forces rest of pages to only use HTTP. Is client browser sending sensitive login or session info in the clear when I am not using HTTPS? My nonencrypted pages don't present or ask for sensitive info. The only d

Re: Why errors when restart but goes away after reload again! How fix?

2011-05-22 Thread Chris Seberino
Mateusz Thanks for the feedback. Those docs you pointed to were about missing views. I checked and my views are not missing. I looked more closely at the error message and noticed it appears to be complaining that my models are missing. I don't know if that helps. (see below) Could it also b

Re: Why errors when restart but goes away after reload again! How fix?

2011-05-21 Thread Chris Seberino
On May 21, 6:35 pm, Mateusz Marzantowicz wrote: > What server are you using? What is your configuration? Do you have mod_wsgi, > mod_python or something else? What is your browser, OS, etc. Please do not > let us guess. I am using mod_wsgi which uses Apache 2.2.16 I use Firefox on Ubuntu Linux 10

Why errors when restart but goes away after reload again! How fix?

2011-05-21 Thread Chris Seberino
When I restart my server, I get an error on the first page reload and then all is fine on the second page reload! The error is this... -- ViewDoesNotExist at /blog Tried blog in module mvc.controllers.controllers. Error was: 'module' object has no attribute 'models' I get a similar err

Re: failing to pass model objects to template for some reason....

2011-05-21 Thread Chris Seberino
On May 21, 5:22 am, Duane Griffin wrote: > Is the messaging framework configured (note that it is by default)? Wow. I thanks so much! I never would have caught this! I renamed Message to Annoucement and now it works! cs -- You received this message because you are subscribed to the Google G

failing to pass model objects to template for some reason....

2011-05-20 Thread Chris Seberino
I have a model class called Message with an attribute called text. ** When I pass a list of these objects called messages to my template, it doesn't show up. ** When I instead create this derivative called fred, that *does* work... fred = [e.text for e in messages] Why would fred work f

how transfer password hashes between old and new mysql databases for django app?

2011-05-18 Thread Chris Seberino
I am migrating my Django app from an old database to a new one with DIFFERENT model classes. How can I copy my passwords/hashes over? Is there some special way to copy over the hash? Is that even possible? A MySQL command line would be fine. cs -- You received this message because you are su

Error when try to do ManyToMany relation with User class...

2011-05-17 Thread Chris Seberino
I have 3 classes that have a ManyToMany relation with the User class. When I try to do syncdb I get this error Error: One or more models did not validate: mvc.course: 'users' has an m2m relation with model User, which has either not been installed or is abstract. mvc.homework: 'users' has an

Re: How change field to "unique" in existing mysql database?

2011-05-14 Thread Chris Seberino
Shawn Thanks! Is South just a script that runs? Can I uninstall after the conversion if desired? Or, does it permanently alter a Django app somehow? cs On May 14, 10:53 pm, Shawn Milochik wrote: > The best way is to use South. > > http://south.aeracode.org/ > > In your current situation, aft

How change field to "unique" in existing mysql database?

2011-05-14 Thread Chris Seberino
I have a typical Django app using MySQL. I've decided to change a model and make some fields unique=True AFTER tables and data exist in MySQL. I noticed that "python manage.py syncdb" doesn't automatically modify MySQL database to make desired fields unique now. Is there some MySQL command line

Re: How pass custom data to login template? (Seems only some like 'next' param are allowed!?)

2011-04-11 Thread Chris Seberino
Perhaps can wrap the default login view by calling it in my own view? I really just need to add a few elements to dict I assume gets emitted by it. cs On Apr 11, 5:00 am, bruno desthuilliers wrote: > On 11 avr, 01:20, ChrisSeberino wrote: > > > How pass custom data to login template?  (Seems onl

How pass custom data to login template? (Seems only some like 'next' param are allowed!?)

2011-04-10 Thread Chris Seberino
How pass custom data to login template? (Seems only some like 'next' param are allowed!?) The reason for this problem is the Django auth system doesn't ask user to write the view for login page. cs -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: How adjust Django form input elements generated so they don't have "/>" at end and hence will VALIDATE?

2011-04-08 Thread Chris Seberino
Sorry n/m. Apparently this is a long running discussion. I just found the start of a big part of it... http://groups.google.com/group/django-developers/browse_thread/thread/bbf75f0eeaf9fa64/59822bbce1e0be22?#59822bbce1e0be22 cs On Apr 9, 12:08 am, Chris Seberino wrote: > By the way...

Re: How adjust Django form input elements generated so they don't have "/>" at end and hence will VALIDATE?

2011-04-08 Thread Chris Seberino
By the wayby "validate" I meant to say that I want it be be *valid HTML*. cs On Apr 9, 12:06 am, Chris Seberino wrote: > I'm using Django authentication for myhttp://phil4.com/sign_inpage. > > You notice all the Django form input elements generated on that page >

How adjust Django form input elements generated so they don't have "/>" at end and hence will VALIDATE?

2011-04-08 Thread Chris Seberino
I'm using Django authentication for my http://phil4.com/sign_in page. You notice all the Django form input elements generated on that page don't validate (They have a "/>" at the end rather than just ">".) How fix!? cs -- You received this message because you are subscribed to the Google G

How dynamically set "next" parameter in login template to protected page tried to visit?

2011-04-02 Thread Chris Seberino
My views have the standard decorator to automatically bounce clients to the login page if they are not logged in @django.contrib.auth.decorators.login_required I would like to dynamically set the hidden next parameter in the login template to the aforementioned page they were trying to access

Re: How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-21 Thread Chris Seberino
Ian Thanks for the reply. Your solution makes perfect sense. My forms are automatically generated by Django via Form classes. So I can't embed this suggested input element in any form element present in my template. Where should I put this code in since there is no form element? cs > >    

How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-14 Thread Chris Seberino
My Django app's html won't validate because CSRF middleware adds hidden tags like this... The only problem is the slash "/>" at the end. How make Django templates not automatically add hidden tags that won't validate? Thanks! cs -- You received this message because you are subscribed to the

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-04 Thread Chris Seberino
Nevermind. I figured it out. To only have subdirs by static you need to add a "/" at the end of an Alias line... e.g. Alias /books/ /some/static/dir/ Thanks! cs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-04 Thread Chris Seberino
On Jan 4, 2:48 am, Graham Dumpleton wrote: > If using Apache/mod_wsgi it is quite simple, and wouldn't even need URL > rewriting as suggested by others. > > So, what are you hosting it with. Yes I am using mod_wsgi. The following line sends all URLs to WSGI script WSGIScriptAlias/

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-03 Thread Chris Seberino
How configure Django to handle /books URL and yet allow access to PDFs and images in subdirs of /books? Specifically, I want /books to be a dynamic page with lots of links to PDFs and images of book covers contained in subdirectories of /books like /books/some_book_1 and /books/some_book_1/book_co

Subclassing User class or User class "profiles" recommended for extra attributes?

2010-09-20 Thread Chris Seberino
Adding extra attributes to User classes seems to be handled originally by a "profiles". A new way seems to be to subclass the User class. One problem with the shiny new way is that lots of code is written to handle User classes instead of subclasses. The suggested way to fix this is nontrivial.

Re: Need help setting up dynamic options for select (drop down) box of form.

2010-08-03 Thread Chris Seberino
On Aug 3, 3:29 am, Daniel Roseman wrote: > Anyway, I suspect the cause is setting the widget. I found my bug. To convert a textbox to a drop down box, it isn't enough to reset the widget and choices settings. It is also necessary of course to reset the field type from a CharField to a Choices

Need help setting up dynamic options for select (drop down) box of form.

2010-08-02 Thread Chris Seberino
I'm trying to make the options of a particular drop down box be determined at runtime. I added a __init__ constructor to my django.forms.Form subclass as follows... def __init__(self, data= None, error_class = d

*Unnecessary* instances of HTML escape sequences like λ ?

2010-07-30 Thread Chris Seberino
I understand the need for web pages to denote the 5 HTML special characters >, &, <, ', and " with alternate representations like ". (These 5 are the *only* special characters in HTML right?) What I don't understand is why an HTML page encoded with UTF-8 would use this &#...; format for other

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-21 Thread Chris Seberino
On Jul 17, 11:16 am, Justin Myers wrote: > or just put that one line (with a semicolon at the end, since it's > missing one) in a

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-16 Thread Chris Seberino
On Jul 15, 3:57 am, Oleg Lomaka wrote: > First without javascript. You cat check URL of HttpRequest and if it is > without #anchor element, then send redirect to the same URL with #anchor. Yes redirection is a great non-Javascript way to do this. Is there ANY way to preserve the old form data t

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-16 Thread Chris Seberino
On Jul 15, 3:44 am, Daniel Roseman wrote: >      window.location = window.location + '#whatever' I added that code to script element in head and it didn't work. I have a TinyMCE javascript editor that gets run too. I don't know if that is conflicting or if there is something else I need to do t

How can view tweak response object to go to a specific *anchor* on the template?

2010-07-14 Thread Chris Seberino
How can a view tweak the response object so that client sees a specific anchor instead of the top of the page? Chris -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubs

"SESSION_SAVE_EVERY_REQUEST = True" performance hog? Any other cons?

2010-07-10 Thread Chris Seberino
SESSION_SAVE_EVERY_REQUEST = True (in settings.py) seems to avoid a lot of potential bugs from forgetting to set request.session.modified = True when necessary. Is this a serious performance problem? If not, I would think this would be a good *default* value for Django no? Chris -- You receiv

Re: What causes request.session to be erased?...When you go to different view?

2010-07-10 Thread Chris Seberino
Wow beautiful. Thanks. I needed that. cs On Jul 10, 12:14 am, Javier Guerra Giraldez wrote: > On Fri, Jul 9, 2010 at 11:36 PM, Chris Seberino wrote: > > elif form.is_valid(): > >        ... > >        request.session["posts"].append(form.cleaned_data) >

What causes request.session to be erased?...When you go to different view?

2010-07-09 Thread Chris Seberino
Ever time a web page is visited, a view is called and a NEW request object is passed in right? Then if I'm not mistaken, it appears you can't maintain request.session when you visit a new web page and a new view because a NEW request object is passed in to the new view right? My personal co

How interate over just a slice of form fields in template? (I tried {% for e in form|slice:":5" %} )

2010-07-05 Thread Chris Seberino
How interate over just a slice of form fields in template? I tried {% for e in form|slice:":5" %} but it appears the slice part is just ignored. cs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us.

How set initial form field value in the view function?

2010-07-04 Thread Chris Seberino
How set initial form field value in the view function? The initial keyword is great when defining a subclass of Form if you the initial values is ALWAYS the same. What if it varies?...I'm guessing I must set it in the view. How set this initial value in the view? Chris -- You received this me

Re: mod_wsgi sometimes gives error on first reload but not thereafter

2010-06-16 Thread Chris Seberino
On Jun 15, 6:42 pm, Graham Dumpleton wrote: > This occurs when Apache is first reading HTTP headers for request and > long before it hands it off to any Django application or even > mod_wsgi. Is there anything I can do about this? I assume this means we should pronounce the mod_wsgi setup I hav

Re: mod_wsgi sometimes gives error on first reload but not thereafter

2010-06-15 Thread Chris Seberino
I found the Apache error for this mod_wsgi error that only appears the first time I reload an app after restarting Apache [Tue Jun 15 18:12:39 2010] [error] [client ] request failed: error reading the headers, referer: http:// -- You received this message because you are subscribed to the Go

Re: mod_wsgi sometimes gives error on first reload but not thereafter

2010-06-15 Thread Chris Seberino
On Jun 14, 7:02 pm, Graham Dumpleton wrote: > Use WSGI script described in: > >  http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html In mod_wsgi's defense, remember that this error happens sporadically and is NOT a showstopper as a reload makes it go away completely (until a

mod_wsgi sometimes gives error on first reload but not thereafter

2010-06-14 Thread Chris Seberino
1. Restarting Apache+mod_wsgi 2. Clearing Firefox cache and 3. Visiting Django app URL are all done often when debugging/developing a DJango app under Apache +mod_wsgi. I've noticed with mod_wsgi, I will *SOMETIMES* get an error after this triad. Reloading the Django URL makes it go away so it o

Good idea to process form data in separate thread or process to avoid blocking? How?

2010-06-07 Thread Chris Seberino
I don't want Django site to block while form data is being processed. What is easiest way to run a separate script in a separate thread or process with form data as input parameters? e.g. commands.getoutput("my_script arg1 arg2") or os.system("my_script arg1 arg2") <--- possible to run the

Issues running Djano app as Apache's www-data user with mod_wsgi.

2010-06-06 Thread Chris Seberino
My Django app runs great with Apache+mod_wsgi. Apache now runs my Django app as user www-data. This causes issues since my Django app is sitting in my non-root user's $HOME directory. Best solution seems to be to add my user and www-data to same group and then put my Django app directory in that g

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-28 Thread Chris Seberino
On May 27, 6:56 pm, Graham Dumpleton wrote: > You also need to add '/home/seb/MAIN/seoconquer'. Read: > >  http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html I tried both versions of the wsgi script on your blog. And I still get this same error. ImportError: No module na

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
On May 27, 10:51 am, Nuno Maltez wrote: > > ImportError: No module named mvc > > What's the "mvc" module? Python can't seem to find it. Is it in your > python path? My project is called seoconquer. My app is called mvc. My absolute directory path to mvc is /home/seb/MAIN/seoconquer/mvc. I have /

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
I fixed the path issue that was causing the spinning but now I'm back to getting import errors even with __init__.py in my apache directory. Here is the exact error from Apache's error.log. ... [Thu May 27 10:18:18 2010] [error] [client 99.159.221.130] _default = translation(settings.LANGUAG

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
On May 25, 9:03 pm, Kenneth Gonsalves wrote: > you need to add the path to the *parent* directory of your project, and your > project should have __init__.py in every folder where there are python files Thanks. I added __init__.py to an apache directory I created in my project directory that inc

mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-25 Thread Chris Seberino
I can successfully run a toy WSGI app with my Apache/mod_wsgi set up. When I try to run my Django app with mod_wsgi it can't ever find the modules to load and Apache's error.log gives ImportError's. I tried adding paths to sys.path in the wsgi file. Not what else to try. cs -- You received th