2008-3-17
| 23:40 | Magus- | lucasvo: no, I'm saying that's the wrong way to do it |
| 23:40 | dcramer[] | Magus-: would that work w/ the model calls as well |
| 23:40 | Magus- | dcramer[]: uh, it'd be useless if it didn't |
| 23:40 | Magus- | or do you mean can you decorate a model function |
| 23:40 | Magus- | if so, no |
| 23:40 | lucasvo | Magus-: well your "correct" way does not convince me |
| 23:41 | dcramer[] | nah i just want to wrap a block |
| 23:41 | dcramer[] | ok i gotta go learn how transactions work |
| 23:41 | Magus- | adding the project dir to pythonpath tends to give you confusing or unclear references |
| 23:41 | Magus- | dcramer[]: what do you mean a block? |
| 23:41 | neokeats | dcramer[]: you use model manager then use @commit_unless_managed if i have understand what you want |
| 23:41 | neokeats | +can |
| 23:42 | dcramer[] | Magus-: start transactions, stop transactions |
| 23:42 | dcramer[] | like a chunk of code i have |
| 23:42 | dcramer[] | needs to be one |
| 23:42 | dcramer[] | wait, myisam doesnt support transactions does it |
| 23:42 | dcramer[] | fuck |
| 23:42 | Magus- | nope |
| 23:43 | dcode | I'm trying to make my Django app as modular as possible. I want to create "breadcrumbs" for a given URL within the application. I don't want to include the URL prefix that the project may use for the app. is there a way to do this w/o hard coding it? |
| 23:43 | dcode | I considered using resolve() to get the view, but wasn't sure how to get the prefix for that view so I can exclude it in my breadcrumbs |
| 23:43 | gordonjcp | I'm having a really strange problem with django and mod_python |
| 23:44 | gordonjcp | if I run django under mod_python, I can't log in - the login page tells me my browser isn't accepting cookies |
| 23:44 | gordonjcp | if I run the app - same app, same directory - using the built-in server, it works just fine |
| 23:44 | dcode | so if the application handles all urls under /foo/bar/, I want to strip that from my list of bread crumbs |
| 23:44 | tie | gordonjcp: stop your antivirus/firewall/etc and try again |
| 23:44 | neokeats | dcode: you can define a tag then from other application call that tag with a prefix url parameter then the tag will return you the complete url |
| 23:45 | gordonjcp | tie: I don't have any antivirus software |
| 23:45 | tie | gordonjcp: a firewall? |
| 23:45 | gordonjcp | tie: also, if I use Django's built-in server, *even on port 80* it works just fine |
| 23:45 | gordonjcp | tie: a firewall is irrelevant her |
| 23:45 | gordonjcp | here |
| 23:45 | Magus- | dcode: no, you can't do that magically |
| 23:45 | tie | gordonjcp: well firewalls can treat different hosts differently *despite* the same port, you know |
| 23:46 | gordonjcp | the only thing I can think of is that the box is configured to use ISPConfig |
| 23:46 | Magus- | you need to hard-code it somewhere |
| 23:46 | gordonjcp | tie: yeah, it's not the firewall, ok? |
| 23:46 | Magus- | dcode: after all, there is no concept of a 'url prefix' anywhere |
| 23:46 | schnuffle | gordon: do you use the site app |
| 23:46 | gordonjcp | tie: other Django sites work perfectly |
| 23:46 | gordonjcp | schnuffle: no |
| 23:46 | gordonjcp | schnuffle: think it could be worth setting? |
| 23:46 | tie | gordonjcp: ZoneAlarm? |
| 23:46 | dcode | Magus-, yeah, I wasn't sure if there was some way I could figure it out by introspecting the urlpatterns |
| 23:46 | gordonjcp | tie: what's ZoneAlarm? |
| 23:46 | dcode | that might not be the right terminology |
| 23:47 | tie | a firwall :) that's known to block cookies sometimes |
| 23:47 | Rogi | extends cant be dynamic? |
| 23:47 | Magus- | tie: it'd be blocking the dev server too... |
| 23:47 | gordonjcp | tie: I don't have that - it looks like a windows thing |
| 23:47 | schnuffle | I only had some problems with it, resulting in a similar behaviour |
| 23:47 | tie | Magus-: not necessarily, firewalls can block selectively |
| 23:47 | Magus- | $10 says it isn't the issue here |
| 23:47 | gordonjcp | tie: out of about six django sites, *one* specific one isn't working, in very specific ways |
| 23:47 | gordonjcp | tie: I think I can safely rule out firewalls |
| 23:48 | tie | Magus-: I'm making a point, 90% of the times cookies dont work is a firewall issue |
| 23:48 | tie | ok, lets rule them out then |
| 23:48 | Magus- | with average users sure |
| 23:48 | Magus- | not developers |
| 23:48 | Magus- | ime |
| 23:48 | Magus- | anyway |
| 23:48 | gordonjcp | Magus-: not developers, who develop firewall firmware... |
| 23:48 | Magus- | gordonjcp: sanity check - you're logging in from the login view, not from an idnex page or such? |
| 23:48 | gordonjcp | ! |
| 23:49 | gordonjcp | aw, don't tell me |
| 23:49 | gordonjcp | hang on, let me check |
| 23:49 | Magus- | if you're putting a login box on a non-login view, you must call request.session.set_test_cookie() manually |
| 23:49 | gordonjcp | interesting, page not found |
| 23:49 | Magus- | otherwise it won't login the first time |
| 23:49 | Magus- | but will if you hit submit on the login view |
| 23:49 | gordonjcp | Magus-: actually even going to http://host/admin/ won't work |
| 23:50 | Magus- | good to know |
| 23:50 | Magus- | so it probably isn't this issue |
| 23:50 | tie | you sure your db is synced? |
| 23:50 | Magus- | ^ fair question |
| 23:50 | Magus- | not using relative paths with sqlite either? |
| 23:50 | gordonjcp | tie: I am sure my db is synced |
| 23:50 | gordonjcp | no, I'm using mysql as the DB |
| 23:50 | Magus- | have you changed SESSION_ENGINE ? |
| 23:51 | gordonjcp | not knowingly |
| 23:51 | gordonjcp | wouldn't that stop the built-in server working properly too? |
| 23:51 | tie | Magus-: you asked about sqlite because he mentioned firmware? :) |
| 23:51 | Magus- | using caching? |
| 23:51 | Magus- | tie: of course not |
| 23:51 | Magus- | I asked about it because relative paths can screw up database access |
| 23:51 | Magus- | and sessions rely on database access |
| 23:51 | gordonjcp | just to fill you in, this is a Django front-end for a MySQL database that configures virtual mail users |
| 23:52 | tie | Magus-: bad hostname can also scew db access... but, meh :) |
| 23:52 | Magus- | but more noticably |
| 23:52 | gordonjcp | I'm able to run with "python manage.py runserver host:port" and get the whole thing working perfectly |
| 23:52 | Magus- | a relative path can work, it'll just make a new file where you didn't intend |
| 23:52 | Magus- | so data can disappear |
| 23:52 | Magus- | so his users could've been no longer there, for instance |
| 23:52 | Magus- | whereas a bad hostname on mysql would just die flat out |
| 23:53 | tie | ok, ok, I get it lets focus on the problem:) |
| 23:53 | tie | the devserver is running on the same machine as the production server right? |
| 23:53 | gordonjcp | my gut feeling is it's more related to apache |
| 23:53 | gordonjcp | yup |
| 23:54 | gordonjcp | I'm just setting up a test user account so you can go play |
| 23:54 | tie | what do the apache logs say about http://host/admin/ not loading? |
| 23:57 | tie | also, are you using something like suexec/wrapper that could cut off some environment vars? |