|
At the moment I'm using Django as part of a small project I'm doing for shits and giggles. So far I've got a project, 'imageupload', and an app, 'image', that seems to be working well enough. What it does is offer up an upload screen to the user and allows them to, obviously, upload an image. All of this works but now I need to move onto the next part and I'm lost with how to proceed. I have a Pythong script, separate from Django, that does a bunch of stuff to the image the user uploads. The specifics of what the script does isn't important. What I'd like to be able to do is have Django pass the file to my other script and have it kick off from there. The results are returned as 'results.xml' which are then formatted and displayed on the next webpage. Ideas?
|
# ¿ Mar 18, 2008 02:35 |
|
|
# ¿ May 3, 2024 10:11 |
|
ashgromnies posted:and put it in my /usr/lib/python2.5/ directory(and added it to source control). I understood everything but this
|
# ¿ Mar 18, 2008 06:15 |
|
Bonus posted:Kind of that ashgrommies said, only I wouldn't try to shoehorn it into a class if it doesn't need to be a class. If it's just a script that does something when execute it, I'd wrap that functionality into a function call inside the script and then in Django you can just do All the functions in my script are required.. And they're in class form already.
|
# ¿ Mar 18, 2008 09:42 |
|
Bonus posted:Oh, well then yeah, just import the stuff you need from the script and that's it. Unless I'm misunderstanding your problem somehow. Using views.py?
|
# ¿ Mar 18, 2008 10:26 |
|
Can somebody post an example of how to use the validators mentioned at the bottom of http://www.djangoproject.com/documentation/forms/ The one provided isn't to clear, for a newb like me, on the proper usage. Specifically I have three fields that are only required if the user selects 'Yes' on a BooleanField with the RadioSelect widget. If the user selects or No or selects nothing the fields aren't required. I'm thinking RequiredIfOtherFieldGiven but prove me wrong
|
# ¿ May 14, 2008 06:29 |
|
king_kilr posted:Don't use that, you should be using newforms. I am using newforms I'm just a bit to new to this to realise what's deprecated and what's not. Wulfeh posted:http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation I'll give this a try and post a trip report. Thanks!
|
# ¿ May 15, 2008 01:09 |
|
Can anybody help me out with creating an Object outside of the Django Admin console and the Python shell. I'd like to be able to run a script like this: 'createobject.py' code:
code:
|
# ¿ Sep 8, 2008 07:04 |
|
|
# ¿ May 3, 2024 10:11 |
|
The Real Ambassador posted:Put this in your codes at the top: I haven't tested this yet but I'll trust that it works... although to be honest it looks weird. In any case if no one posts a better solution I'll run with it.
|
# ¿ Sep 8, 2008 10:07 |