2009-4-6
| 18:17 | resno | rozwell: The reason I ask is because I have encountered problems that have occured on the production server that didnt happen on the localhost. |
| 18:17 | rozwell | resno: well i recommend you code defensively |
| 18:17 | rozwell | resno: that is learn the differences between the two environments and keep them in mind while you're developing |
| 18:18 | resno | rozwell: Is there a major difference between running in Apache vs Lightspeed, etc? |
| 18:18 | rozwell | resno: but a staging setup will help you identify these problems before your code goes live |
| 18:19 | rozwell | resno: yes, there are differences between how different webservers work and interact with your projects |
| 18:20 | resno | rozwell: id figure nothing can be standard and easy. |
| 18:20 | rozwell | resno: well most code wouldn't run up against areas where there are differences |
| 18:20 | ivazquez|laptop | The nice thing about standards is that there's so many to choose from. |
| 18:20 | rozwell | resno: but as far as configuration, these things are vastly different |
| 18:23 | mgeary | so... any concerns about running django in python 2.4.3...? :) |
| 18:23 | rozwell | mgeary: no |
| 18:23 | mgeary | awesome. thanks |
| 18:23 | rozwell | mgeary: django works fine in any 2.x where x > 3 |
| 18:23 | mgeary | great |
| 18:27 | mgeary | hey, help me find a good solution to this webserver scenario |
| 18:28 | mgeary | i've got a client with a server something.client.com. That domain is already running apache+php on port 80. However, i'd like to run a django app on the same domain. |
| 18:28 | ivazquez|laptop | mod_wsgi |
| 18:28 | mgeary | well, right |
| 18:28 | mgeary | so can i just point the WSGIScriptAlias directive at a subdirectory? |
| 18:29 | mgeary | i've only set up mod_wsgi as wholly-django virtualhosts before |
| 18:29 | ivazquez|laptop | Don't put the Django app under DocumentRoot. |
| 18:29 | mgeary | no, i know |
| 18:29 | mgeary | but something like: |
| 18:29 | mgeary | WSGIScriptAlias /myapp/ "/path/to/my/django_projects/proj_name/apache/my_proj.wsgi" |
| 18:30 | ivazquez|laptop | That works. |
| 18:30 | mgeary | where /myapp is the subdirectory in the "normal" php instance? |
| 18:30 | mgeary | awesome |
| 18:30 | mgeary | very awesome |
| 18:30 | mgeary | thanks |
| 18:30 | ivazquez|laptop | The only issue is that your URLs will start with /mayapp/. |
| 18:30 | mgeary | that's okay |
| 18:30 | mgeary | you mean they'll be: something.client.com/myapp/<start here> |
| 18:30 | mgeary | right? |
| 18:31 | mgeary | 'cause that's fine |
| 18:31 | ivazquez|laptop | They will also start with /myapp/ in Django. |
| 18:31 | ivazquez|laptop | You'll need to compensate for that in urls.py. |
| 18:31 | mgeary | ah, right |
| 18:31 | mgeary | i can live with that |
| 18:31 | mgeary | thanks |
| 18:33 | juanefren | When I try to syncdb why I get this error ? Table 'myapp.auth_group_permissions' doesn't exist" |
| 18:34 | juanefren | auth_group_permissions was never created when I set my auth tables... |
| 18:45 | kack | Hi there. Had a question on this ticket: http://code.djangoproject.com/ticket/7561 |
| 18:45 | dabbish1 | my django trunk is in /usr/lib/python2.5... how do i change it so it uses another django version located at another place on my hdd? |
| 18:46 | kack | anyone have some good ideas on alternate signals / methods for a 'post_syncdb' that triggers AFTER the loaddata, etc. have all ben called? |
| 18:46 | m1chael | i have an imagefield.. and its working properly.. but.. how can i see the picture in the admin? without clicking on it |
| 18:47 | kack | the use case is for large fixtures that take >15 seconds to load and we want to load them selectively based on some flag |
| 18:47 | rozwell | m1chael: custom templates or widgets |
| 18:50 | bfrederi | I changed the name of my app and model, and now I need to change the authentication to reflect the changes. Do I just do a syncdb. If I do that , will it reload all the fixtures I have in my other apps. Is there a way to just update the authentication for that one app without messing with anything else? |
| 18:55 | drgalaxy | is it a "bad thing" to put business rules in overridden 'save' methods of my models? |
| 18:56 | mgeary | i wouldn't think so |
| 18:56 | Rembane | Nah |
| 18:56 | GotenXiao | they're not guaranteed to be called in certain conditions IIRC |
| 18:56 | drgalaxy | I couldn't think of any reason not to |
| 18:56 | drgalaxy | GotenXiao: I will be calling save () explicitly |
| 18:57 | lyaunzbe_ | Hey guys, anyone have an idea what this error may mean? "Unknown column 'xxxxx' in 'field list'", xxxxx being some field in my models.py |
| 18:58 | drgalaxy | lyaunzbe_: you changed your model definition but not your database structure |
| 18:59 | lyaunzbe_ | drgalaxy: Im not sure what you mean exactly. Doesn't executing syncdb correct this for you? |
| 18:59 | moobles | in general, it's not necessary to do form validation if your application's server is protected by a firewall, right? |
| 18:59 | mattmcc | moobles: ... |
| 18:59 | pbx | moobles: Orthogonal concerns. |
| 18:59 | BlackHand | moobles: wrong ^_^ |
| 18:59 | bfrederi | If you've already run a syncdb on an app, and you are going to syncdb for another app you are adding. Will the initial_data fixture get loaded again in the original app? Or does it only do it when you first syncdb the app? |
| 19:00 | mattmcc | moobles: Well, I guess that depends. Are the people behind the firewall infallible? |
| 19:00 | drgalaxy | lyaunzbe_: no, syncdb will only create tables if they don't exist. changes are not managed |
| 19:00 | pbx | lyaunzbe_: Django never alters existing tables. |
| 19:00 | lyaunzbe_ | drgalaxy: So then how would I make these changes then? |
| 19:01 | kazamatzuri | hi there, i have a form derived from a model. this model has a textfield named input. if i use that in a template with {{ form.input }} it gets rendered as textarea, which is fine. how can i adjust the size of that textarea? does form.input has any options i can pass to it? |
| 19:01 | mattmcc | kazamatzuri: The easiest way would be with CSS. |
| 19:01 | drgalaxy | lyaunzbe_: you can either modify the database yourself OR dump your data, blow away the the tables that changed, resync, and re-load |
| 19:01 | bfrederi | lyaunzbe_: manually alter the table, or drop the table and start over. |
| 19:01 | lyaunzbe_ | You guys mean just manage.py flush? |
| 19:01 | kazamatzuri | mattmcc: hm ok, i feared this would be the answer ;) thanks anyways |
| 19:01 | drgalaxy | lyaunzbe_: that would work.. if you don't need any data in there |
| 19:02 | sPeeDy | or look into the schema migration apps south or schema evolution |
| 19:02 | bfrederi | lyaunzbe_: if you need the data, do a manage.py sql appname, to see how your new sql will look. Then manually alter the table using sql. |
| 19:06 | hewer | hi all. i want to render an xml file as html within my django site. xslt seems to me to be the right tool for this, but i'm not sure how i would go about using my base django template alongside this, so that the xml (rendered as html) fits seemlessly within my site. do anybdy have any pointers? |
| 19:08 | drgalaxy | hewer: depends on your use case - is this one time (static) or every time? |
| 19:09 | m1chael | i have an imagefield.. and its working properly.. but.. how can i see the picture in the admin? without clicking on it <--- widgets or modifying template file.... which template? |
| 19:11 | ivazquez|laptop | Change the admin form to load it. |
| 19:13 | hewer | drgalaxy: the xml will change, but not requently |
| 19:13 | hewer | *frequently |
| 19:15 | Pavel__ | i'd like to augment the existing DateField by allowing entries such as "today" "a week from tuesday" and "april 18" |
| 19:15 | drgalaxy | hewer: unless XSLT is really necessary, I would just write a script to parse it into html and run it outside of the web context. then either {% include %} it in your templates (assuming it lives in a template dir), or read the html in your view and pass it in to your template context |
| 19:16 | carl- | damn .. i wanted my commentform to display as table .. whough when doing {% get_comment_form for entry_object as form %} {{ form.as_table }} |
| 19:16 | kcbanner | Is it possible to do a tag in a django template to see if a variable is greater than a number |
| 19:16 | carl- | it renders that hidden ugly field .. |
| 19:16 | hewer | drgalaxy: that's what i was originally thinking of doing, but it seems to me that xslt could save me quite a lot of work, if it's possidle to use it |
| 19:18 | hewer | writing scripts to parse xml isn't much fun, imo |
| 19:18 | hewer | :p |
| 19:18 | drgalaxy | hewer: I hear that, I guess it will depend on the data and your familiarity with the processes as to which is easier |
| 19:19 | ivazquez|laptop | You can have the XSLT generate Django template directives, then process through both XSLT and Django's template engine. |
| 19:19 | carl- | naaah .. rendering commentform as table seemed as it was not meant |
| 19:20 | drgalaxy | kcbanner: the general philosophy of the template language is that it shouldn't be treated as a programming language |
| 19:20 | alastairc | I have a strange error, and I'm looking for clues: Using mod_python I get the error: 'str' object has no attribute '_default_manager'. However, using the dev server it works fine! :( Full error: http://dpaste.com/25027/ Anyone has similar? |
| 19:20 | drgalaxy | ivazquez|laptop: good point |
| 19:22 | ivazquez|laptop wonders how nuts someone would have to be to wrap SymPy functionality in templatetags... | |
| 19:22 | hewer | ivazquez|laptop: i am a little unclear as to what you mean (my knowledge of the django template engine is minimal) - could you please elaborate or point me in the direction of any useful resources? |
| 19:22 | jos3ph | kcbanner: if you really want that type of functionality, you can add your own template tags. This one provides greater than, less than, and equality in an 'If" tag: http://www.djangosnippets.org/snippets/1350/ |
| 19:22 | kcbanner | thanks |