l need to include the code for the view that is being called, and
possibly your urls.py
Do you have a urls.py in your project?
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
the e-mail to our script
via a pipe.
The python script imports our Django models, and parses the e-mail
message with the email module, and does what it needs to.
This should give you a decent starting point.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
amount of load on the
mailserver to constantly check and download hundreds of messages all the
time, but my guess is that it might be less load than loading several
hundred instances of a python interpretor. It'd be interesting to test.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
James Bennett wrote:
> On Sat, Oct 25, 2008 at 2:09 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote:
>
>> We have an alias set up in postfix that sends the e-mail to our script
>> via a pipe.
>>
>> The python script imports our Django models, and parses the e-m
ic questions that come up, this is the place to ask.
It sounds like you're already headed in the right direction. Use
Django's auth system, the admin site, and build your own app for reptile
tracking. I'd use it, except I'm not a reptile owner– we only have a bird.
Happy C
Admins
should. It's there to make your life much easier, and it does that very
well. You'll still need to build views for your app, but if you need to
go in and change something manually, the admin interface is way better
than dropping to SQL.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
isn't
what you wanted to hear, but I disagree with the concept of running PHP
to get an html template into Django, though I think it's kind of cool
that someone has done it. :p
Take care!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
ou aren't familiar with AJAX, I suggest reading a tutorial about how
AJAX works, and then consider using an AJAX library.
Hopefully this gives you a good starting point.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
shi shaozhong wrote:
> Dear Jeff Anderson,
>
> Thank you for your email.
>
> It sounds very interesting to me. I must confess that I am not a
> programmer, and have no experience with Django. But I have a project
> in hand to do such a work.
>
> Have you ever tried
setup.py when I install Django, but I'm sure there's
a way to skip the byte compiling stage, at least for the gis stuff. As
long as you don't plan on using gis, ignoring those errors won't hurt you.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
I've never implemented it myself, but it's all
documented.
You can also have multiple admin sites installed on different URL paths.
Make one admin site for one app, and another admin site for the other.
I've never done that either though, but it too is documented. :)
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
his. I skimmed the admin doc for info
about a using a custom manager. I didn't see it, but that doesn't mean
it isn't there.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
he tools mentioned use an ssh
connection to provide their various services. There's plenty of info
"out there" about using the terminal.
Take care!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
fice document. You'll likely want to use PIL for the actual
manipulation/operation, but as long as you can get the binary content of
the image into Python, you're fine. Simply set the mime type and content
of the response, and you're good to go. There are examples in the
t_list' into a list, do the comparison there:
if item not in current_projects:
new_projects.append(item)
Of course, this won't work if you are getting a list as input, and not
the individual items.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Peter Bengtsson wrote:
> What's faster, locmem or memcache?
>
> I know that the docs rave on about how fast memcache is but what about
> locmem? That sounds pretty fast to me since it doesn't need another
> TCP service and just uses the RAM.
> My particular site (for mobile phones without any media
going on with wireshark. It very well could
be an issue with a header or something– especially if you're doing
something crazy weird in the view.
Have you checked the log to see if Safari is actually hitting the webserver?
Hopefully this will give you some idea as to how to start diagnosing the
#x27;s what Ajax is for. The javascript will send
a request to the server without reloading the page in the browser, and
can (optionally) change something in the loaded page based on data
received by the response, while the server can do whatever it wants–
including updating a database.
Ho
IN_MEDIA to something else. '/admin/media' makes sense to me, so
that's usually what I set it to. Some people set their MEDIA_URL url to
something like '/static'. Another logical way to set the URLs is to have
MEDIA_URL be '/media' and ADMIN_MEDIA_PREFIX set to '/media/admin'
Hopefully this is helpful and makes sense!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
ng switching to lighttpd. I've read it has a smaller footprint
than apache. I've also read that mod_wsgi performs better than mod_python.
Please let me know if you have any other ideas! I'm also curious to know
if anyone thinks that one of the things I mention trying would help or
hurt. Thanks!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
e.net/ - Windows only, uses IE for rendering
http://cutycapt.sourceforge.net/ - cross platform, uses the same
rendering engine as konquerer/google chrome/safari.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
hang, I don't imaging having a persistant python
thread hanging around processing for a minute or two would make the
webserver hang in a mod_python or mod_wsgi environment, but I didn't try
it. Why would this be the case?
From the "I've done it without a hitch" department,
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
dmin css files.
Correct. You have to tell apache that the location of the admin media
should be handled with the default handler, and then make an alias for
that location to point to the correct location on disk. This is in the
docs: http://docs.djangoproject.com/en/dev/howto/deployment/modpython
my osx terminal:
jeffe...@pax:~$ django-admin.py startproject mysite
jeffe...@pax:~$ cd mysite/
jeffe...@pax:~/mysite$
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
ly what you need to do. The
django-admin.py script exits on success with no output. That's what it's
supposed to do. Does the mysite directory not exist after you run that
command?
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
gy, you need to read up on some
unix basics. There are many tutorials about the unix shell out there. I
can't recommend one because I would just google for an introduction to
the unix/linux/macos terminal.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
I believe there is a python json module. I know that Django makes use of
it for importing/exporting database fixtures. It is bundled with django
at: django.utils.simplejson. I'd start there, and poke around in the
Django code for more examples. I'm no expert here, this is just where
I'd start looking.
Happy coding!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
i ?
>
I've never used this middleware, but its homepage seems to have an nginx
example:
http://superjared.com/projects/static-generator/#sample_nginx_configuration
I don't think that using fastcgi should affect anything if you're using
nginx.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
to put
that data into the final file format for the end user (html in most cases).
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
but people going to a programming blog might be more inclined
to disable javascript. As a fallback, you could simply use an iframe to
point to your analytic view. That'll probably cover most everything.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
g
all your available memory on your slice, and swapping. I had this same
problem. I posted about it to this group a couple weeks ago. Basically,
switch to mod_wsgi in daemon mode. It'll reduce your memory usage, and
increase the speed of the site. Search the archive for more details.
Je
Artem Skvira wrote:
> Is it worth asking this question is dev group?
>
No. Your usage question does not belong on the dev group. It belongs
here, on the user group.
signature.asc
Description: OpenPGP digital signature
least Integer fields (and quite possibly
other non-text fields) should behave the way that Mike is describing.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Malcolm Tredinnick wrote:
> On Mon, 2009-01-05 at 23:39 -0700, Jeff Anderson wrote:
>
>> Malcolm Tredinnick wrote:
>>
>>> The way to think about this problem is whether there's a situation where
>>> blank=True, null=False makes sense or is even
phoebebright wrote:
> Thanks for your response. Do you think a working knowledge of python
> is essential for django then? And do I import modules the same in
> django and python? Are there any python things you can't do in
> django?
>
Django *is* Python. In fact, Django is only a Python libra
varikin wrote:
> I agree with this. I use null=False, blank=True for some ImageFields
> and integers.
I'm interested in how a blank integer looks in a MySQL database. Can you
provide an example?
signature.asc
Description: OpenPGP digital signature
Eric Simorre wrote:
> it does not work , and I don't find what to do
>
Well, there's your problem. You should just make it work. :)
signature.asc
Description: OpenPGP digital signature
Karen Tracey wrote:
> On Wed, Jan 7, 2009 at 10:51 AM, Jeff Anderson
> wrote:
>
>
>> varikin wrote:
>>
>>> I agree with this. I use null=False, blank=True for some ImageFields
>>> and integers.
>>>
>> I'm intere
tofer...@gmail.com wrote:
> On 07.01-08:51, Jeff Anderson wrote:
>
>>> I agree with this. I use null=False, blank=True for some ImageFields
>>> and integers.
>>>
>> I'm interested in how a blank integer looks in a MySQL database. Can you
>
n.
I'm working on a set of examples of things I've implemented using
Django, but I haven't gotten my example for this one running quite yet.
Hopefully this is enough to give you an idea as to how to design things.
I don't really have any code that is sharable, but the concept is fairly
straightforward (I hope.) I'm happy to clarify anything if needed.
Happy Coding!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
time. You
would see a huge slowdown if you were using python to run cgi, and
python had to load itself into memory, compile the code, and run it for
each and every request. Fortunately with mod_python, this isn't the case.
Hopefully this makes a little more sense now.
Cheers!
e more, and 12 % 4 will evaluate to false.
The 'good fix' is set up to do the logic all at once. Because modulo
returns an integer, you can just set the number of blank fields to the
number that modulo returns.
Hopefully that helps!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
tures, and less
bugs than 0.96. It is also very near to 1.0 status. It would be silly to
start with 0.96 and then have to rework all your code for 1.0 in the
near future.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
do eso con algo más de Mysql? No sé si soporte unicode sqlite.
¿Sierve eso sin los opciones DATABASE_OPTIONS, o teine la misma problema?
Disculpa mí español. No lo uso en la computadora mucho.
¡Graciás!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
casos que requieren
otron opciones, pero nunca he visto un projecto que lo usa.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
get passed a value they don't need, they
discard it. Simple as pie.
Hopefully this is helpful!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
owhere near as convenient as the Django dev server. At least
for initial developing of Django projects, I'd recommend you stick with
the dev server-- it is there to help you be more productive and keep
things from getting in your way.
Hopefully this helps!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Matt wrote:
> Does anyone have ideas on running 0.96 and 1.0 side by side safely?
>
All I've done in the past is set my PYTHONPATH based on which
checkout/release of Django I want used in a particular instance. It
works quite well, even in production.
Jeff Anderson
signature.asc
Matt Conrad wrote:
> Thanks for the reply. I don't quite understand yet. Let's see how close I am.
>
> I have a Python application directory (on my machine,
> C:\apps\Python25\). Inside that directory I have
> \Lib\site-packages\django, which is currently v0.96.
>
> Right now, the PYTHONPATH envi
his information is in nearly every python book available, and
freely available on the internet. Try googling for "python path" and I'm
sure this information would have come up in your search. This isn't even
Django specific-- this is a python question.
Cheers!
Jeff Anderson
s
Frédéric Sidler wrote:
> What it the best Django stack today.
>
> In django doc, it says that apache with mod_python is the best
> solution in production. But in the same time I see that everyblock use
> nginx (probably in mode fastcgi).
>
> Did you some of you test different solution and can share
jeffhg58 wrote:
> I just recently upgraded to Django 1.0, but when I log in with users
> that I have created I get up a popup window
> stating syntax error and after I login the clock and calendar objects
> are lost.
>
You'll need to be much more specific. Where are you logging in. What do
you m
ve no way of knowing that it was doing something.
If a cronjob is really what fits the bill, consider switching your
hosting provider or plan to something that includes cronjobs-- its worth
it to not be hackish. :)
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
/init.d/httpd stop is just a wrapper script that uses the kill
command. You need to do the same thing to kill any process. ctrl+c sends
signal 2 to the running process. kill is exactly what you need to use.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
base, you
can do that. Look in the Django documentation for "legacy db" stuff to
get Django working with your existing tables.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Kenneth Gonsalves wrote:
> hi,
> when I open a jpg file directly in firefox, I get a magnifying glass cursor,
> which on clicking gives me a bigger more detailed image. The same file when
> served through the get_photo_url in a django template does not give this -
> how can I achieve this?
>
>
No, you just need to make sure that the html code spit out by Django
points to the proper location.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
SSL. There is also a middleware that
exists so Django can handle the redirects. There are a few different
incarnations of it here: http://www.djangosnippets.org/tags/ssl/
Hopefully this is what you need!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
x27;ll get an response
object back, and you can take the content of the response object, and do
whatever you want with it.
I ran into something similar and worked out how to implement it. I
haven't actually done it yet, so I can't share any gotchas that might
come up.
Cheers!
Jeff Ander
s, models, or urls. It
was more like a traditionaly CGI script.
You just need to import the appropriate Django libs in your Python
script, and you are good to go.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
there are plenty of examples
and the like out there. Its pretty straightforward to do-- you just need
to set your DJANGO_SETTINGS_MODULE to point to your settings, and write
models/use inspectdb.
The same type of thing is achieved when someone wants a cronjob to do
something with their Django m
put our generic views in a separate python
module (smug.genericurls for example)?
We'd really rather use the generic views, but they seem a bit picky for
some of the crazy stuff we're doing. If there's a way to turn that
behavior off, great. If not, we can split it out.
Thanks!
J
zjffdu wrote:
> I am a newbie of django, and want to know which IDE is suit for
> django?
>
I'd say that it'd be good to continue using whatever IDE you use for
your other Python development. Django is, after all, simply Python code
that you call from your code.
Jeff Anders
Harish wrote:
> Hi Friends,
>
> I configured a django site using apache, which is running on Fedora 9.
> Now I want to enable the
> HTTPS (secured ) service on that site
>
> Any ideas on how to achieve this?
>
Configure apache to do SSL-- no special setup needed for Django.
signature.asc
Desc
ot currently supported, how hard would it be to include?
> Would it use the readline library?
>
This is already implemented with a bash completion script. I'm not 100%
sure where in svn it lives, but its there, and it works.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
ython2.5/site-packages/django/contrib/auth/ldapauth.py in
> authenticate, line 113
>
> The full error is at: <http://dpaste.com/84838/>
>
> How can we set LDAP_OPTIONS to turn on TLS?
>
Hello,
LDAP_OPTIONS should be defined in your settings.py. Paste what you have
in your settings.py for the ldap configuration, and I can help diagnose.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Pythoni wrote:
> In PHP can be used
> include "http://url_address";;
> ?>
>
>
> How must I translate that to be able to use it in Django?
>
Use a Python library to fetch the content, and set a context variable
passed to a template to hold the included conten
view when running the
Django development environment, and turning that off in a production
environment.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
was removed, and newforms was renamed to
forms. This happened before the 1.0 release.
You just need to change your code to reflect this, and it should likely
work.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
e.
> http://dmiessler.com/blog/how-to-use-python-to-get-your-external-ip
>
There might be a Python networking library out there, or you could parse
the output of "ifconfig" on linux, or "ipconfig" on windows.
You could look at the SERVER_NAME environmental variable, whi
at hosts
your app that is separate from your domain's mailserver.
The third option is to use an imap or pop library and download the
messages that way. Python has the 'imaplib' module for imap, and
'poplib' for pop3. I haven't implemented this either. I'd be wi
thon projects,
and it's the documentation build system that Python and Django both use.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
tiple scripts
with their fingers in the same table.
Cheers!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
your home machine.
If you find otherwise, I'd be interested to know.
Thanks!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Hernan Olivera wrote:
details in http://www.alwaysdata.com/offers/shared/
Very cool! I don't speak French, but I know enough about words to get
the idea.
signature.asc
Description: OpenPGP digital signature
he same thing.
What method would you use, and why?
Thanks for the input!
Jeff Anderson
gitosis: |git://eagain.net/gitosis.git|
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users&qu
an add projects and/or apps as
submodules/externals. Generally speaking, a single site could/should be
a single Django project, and making this distinction doesn't come up
terribly often in the configurations I've seen.
Hopefully this was helpful and happy coding!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
k)
Have you tried the ldap backend contained in Ticket #2507? We've used
this in production as long as the code has been around (the original
author was my co-worker) We've had very few problems with it.
http://code.djangoproject.com/ticket/2507
Jeff Anderson
signature.asc
u have described calls for an SSO module. Basically you modify
Django and/or the other web app to use the same database table for
sessions Django makes this fairly easy, and many PHP applications don't.
There is probably a lot of resources "out there" by googling "Django SSO"
KG wrote:
> What needs to be done to make use of any other DB engine thru ODBC?
>
An ODBC database backend would need to be written for the Django ORM.
signature.asc
Description: OpenPGP digital signature
ate form tags? eg:
...
...
...
...
without enclosing your forms in separate tags, a browser might assume it
is all one form, and you would get strange errors like you describe. The
default action for a form is to use the current url as your action.
Good Luc
odule before.
There are times when I am revising a project, or starting a new one, and
I really appreciate all the work and time django saves me. I fully
recommend learning more about django and about python-- it will end up
being a time investment well worth it!
Good Luck!
Jeff Anderson
LRP
point for you:
http://code.djangoproject.com/wiki/CookBookNewFormsDynamicFields
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
hings. I haven't played with
permissions at all, but I imagine it would be possible.
The correct way is still to write your own code to do it.
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
.
Is this the best way to do this? or is there a cleaner way?
Thanks!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
have a
landing page so the admin can choose to view or print.
Thanks!
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
traight from the tarball. A different way to check the version would be
to open a python interpretor, import django, type django.__file__
that will tell you where the __init__.py is located for django. That is
the file that contains the VERSION variable.
*Feel free to e-mail me off list if you wa
James Bennett wrote:
Again, folks: please don't rise to the bait ;)
I don't know what that means!
signature.asc
Description: OpenPGP digital signature
to give it a whirl, but otherwise i expect your reaction to
be like "yeah, neat, but, wtf?" :)
anyway, link: http://gpapers.org/
ttyl,
derek
I actually started a thread along the same line a few weeks ago. We use
django at work for our print script that handles the accounting
asily after that. It shouldn't take too long
to write something like that.
It is also possible that some of the existing things may be able to
either disable the extras you don't need, or you could modify them to
just skip the code for those features.
Jeff Anderson
Rob Hudson wrote:
H
I'm no expert with any template system, but I believe you can write your
own template tags for django's template system.
http://www.djangoproject.com/documentation/templates_python/
At the section called "Extending the template system"
Hopefully this is a good starting p
e something I could learn to use in my templates, given it was
available.
Good luck!
Jeff Anderson
[EMAIL PROTECTED] wrote:
hi jeff, thanks for your response.
writing tags to replace macros looks like an overkill to me.
especially because a macro may hold a content that's specific
ng of transactions, I believe that they are there for
that reason... to make sure multiple processes aren't colliding and
mudding up your data.
Jeff Anderson
[EMAIL PROTECTED] wrote:
Let's say I have a model with an integer value. I'd like to increment
that value.
Multiple pro
, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do.
==End quote==
Jeff Anderson
almostvindiesel wrote:
Is it possible to change the python interpreter to treat a single tab
character the same as 4 space characters (rather than 8)?
On Jan 6
I have also written a patch for django to include a profanity template
filter. It replaces words with asterisks or random symbols.
http://code.djangoproject.com/ticket/6290
globophobe wrote:
I'm preparing my site for general consumption and would prefer that
naughty words not be presented in u
Yes, just import it!
django is still python!
In the docs, there is an example on how to dynamically generate pdfs.
This calls an external python module.
http://www.djangoproject.com/documentation/outputting_pdf/
I do this in one of my projects.
You can import any python module you want!
Jeff
use django-svn.
Just thought I'd let you know!
Jeff Anderson
bobhaugen wrote:
Installed the latest Django package from the Synaptic package manager
on Ubuntu 7.10. I understand the Django version to be 0.96.1 (package
says 0.96-1ubuntu0.1).
I'm on the first django tuto
You'll need to paste some code so we can see the problem.
Debugging advice: Double check everything!
Jeff Anderson
aym35 wrote:
hey Guys,
* warning: this is a beginner question!
I created a django project and a simple app... I added a simple class
in models.py (I put in an inner Admin
s you the error
message? What is running that is already listening on port 8000?
Jeff Anderson
signature.asc
Description: OpenPGP digital signature
Hello,
One way to tell is if they explicitly advertise supporting django.
Any other web host that supports fastcgi should be able to do it, even
if it takes a bit of tweaking on your end.
Jeff Anderson
Alfredo Alessandrini wrote:
Hi,
I'm a beginner about django. I've a doubt.
1 - 100 of 192 matches
Mail list logo