MEDIA on remote server only accessible over FTP and HTTP
Hi all, One of my clients has asked me to implement a Django site where they host the application side on their own Internet connection (low latency 2Mbit fibre pipe) while hosting the static content on their ISP's provided web space. Which is high speed (I tested it as likely having multiple 100Mbit connections OR a Gigabit pipe). Reason for this is 2 fold, 1 being that the total bandwidth allotment for their local pipe is limited to around 600GB/mo, 2 being that as I stated above, the web space is very high bandwidth and has a virtual unlimited allotment in bandwidth for them. The problems I'm facing: A). The web space is only accessible trough FTP and HTTP, FTP being the only factor when talking uploads. B). They want the site to be transparent with the remote web space, so that if they upload files trough the website like in any normal fully local Django site, the content is immediately accessible. One possible solution is the following: http://www.djangosnippets.org/snippets/1269/ Which is a pluggable storage plug that transfers files over FTP on forms upload. But the author of the app states that this solution isn't viable for larger files since the uploaded files are stored in memory during transfer to FTP. The client of course needs large files to work. They have gigantic images that need to be uploaded and shared (think gigantic in terms of 16k x 9k TIFF's ...). If uploads happen one by one, do you think a 2GB ram server that has 1GB unused would be able to handle it in a stable fassion if the files stay under 1GB in size? Do you know any other way to do this other then to use the above snippet or setup a high refresh FTP sync schedule that would resync the files between local and FTP every 5 to 10 minutes? Also, isn't with an FTP sync the danger present that large files being uploaded get whacked by the server trying to upload it to the webspace at the same time? r/Jan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django Sites -> Users
I don't find the functionality in the admin interface, so I'm guessing its not implemented in the trunk. I thought that maybe it would be a handy thing to extend the sites framework into the users and groups framework. For my firm, we have several branches which run mostly the same website (all run the exact same apps) but with their own graphics and unique flatpages and with the articles and inventory, certain sites show certain articles and certain sites sell certain inventory. This all was very easy to implement with the sites framework. It took a while to filter out but we have a 250k unique item inventory assigned to one or more branches. The main office sells just about anything, while 2 of the smaller branches are specialized in and only sell industrial electronics and industrial installation materials. Industrial clients also have different pricing when they buy their gear from the branch specialized in those materials then when they order it trough us. The medium sized branches mostly wholesale home electronics and housebuilding electronics and installation materials. Now to what I wanted to request. What I now really need is to give people permissions and access to functions on one, several or all of the sites or at least limit their login to one, several or all of the sites. If the sites framework extended into the users and groups framework, this would be as simple as assigning a flatpage to a specific site. You simply would mark one or more sites for a given user. Since we are a wholesaler, our clients need to request a login that has buying rights, our branches are located all trough the country and clients are assigned to their nearest branch, while the general public can simply register for a limited account that has access to downloads and store prices which are mostly equal on all sites. So, am I missing something here, did I implement Django wrong by using one single database for all my instances or is this a rather usefull feature for the sites framework which isn't implemented (yet?) r/Jan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ANN: Making some changes to djangoproject.com
Rewrote Django in PHP. Rewrote Django in ASP. Rewrote Django in Java. Dropped Django development and defected to Ruby on Rails. Rewrote Django to be the root of all online evil (but then again, doing any of the above would qualify it for this by default :p) If your server move messages have anything to do with it, I'm guessing you changed something on the old server to check if it would run better on up to date hardware and software on the new server. On Sep 8, 12:51 am, Tim Chase <[EMAIL PROTECTED]> wrote: > >> These changes are in preparation of some exciting news, but I'll leave > >> y'all in suspense until next week. > > > You're rewriting Django in Java! Finally, enterprise capability! > > I thought it was one of the following: > > - adding "2.0" to the official name to make it a "Web 2.0" > buzzword-compliant technology... "Django 2.0, now with more AJAXy > goodness for your RESTful/SOAPy SaaS! Paradigm! Synergy!" > > - the addition of Cobol data-stores and hierarchical databases > > - support for SilverLight > > - Django has been ported from Python to PostScript and can now > run on any PostScript compatible printer with minimal syntax changes > > - a complete reimplementation of Emacs in Django > > - a complete reimplementation of Django in Emacs > > - ability to use use Prolog as your backing fact database > > Any other guesses? :) > > TGIF... > > -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ATTN: (NOT) Moving djangoproject.com to a new server!
Hrm, I ran Django on configs from old to bleeding edge python, mod_python and apache and haven't had a problem with the auth layer (aka apache 2.2, python 2.5.1, latest mod_python etc) What trouble is it giving you? On Sep 14, 8:32 am, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Hi all -- > > OK, so I've run into some problems setting up the new box, so this > isn't going to happen tonight. (If anyone can help me get Django's > authentication handler working with Apache 2.2 / mod_python 3.3, > please get in touch!) > > So chances are I'll put this off until after the sprint. Sorry for the > false alarm :( > > Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re:
I wish google would finaly start enabling their Gmail spam filters on these frigin boards. Spam is getting rediculous. On Sep 14, 11:38 am, "Useful Database" <[EMAIL PROTECTED]> wrote: > Hello friends and group members, > > I recently happened to see the below information ... just thought that it > could be useful to you people ... > > Thanks. > > -- > > *Introducing for the first time in **India**, a Product that could be > required for all types of Industries and Consultants in **India** and across > the World.* > > *We have Quality Databases of all types of Doctors, Engineers and Graduates > in **India**.* > > *Engineers*: Computer, Software, Electronics, Civil, Mechanical, Production, > Chemical, Pharmacy, PhDs, etc. > > *Medical*: Doctors, Surgeons, Physicians, PhDs, etc. > > *Graduates*: Physics, Chemistry, Biology, Agriculture, etc. > > The database is in the form of Excel Sheets and Word Documents. The word > format document contains the resume of the concerned person. > > The database is divided into the following catagories: > >1. *By Functional Area*: Basically technical people working in >projects, production, maintenance, software, quality control, research & >development, etc. The number of resumes in each category, are around > 30,000. > >2. *By Industrial Segment*: Pharmaceutical, Drugs, Chemical, Marine, >Electronics, Medical, Shipping, Construction, Automotives, Hotels, >Computers, Rural Areas, and Government of India Companies (Railways, >Municipality, Atomic Energy, Electricity, Power, Water Supply, etc.) The >number of resumes in each segment, are around 30,000. >3. *Infotech & Software Personnel*: MCAs, BCAs, Computer/Electronics > Engineers, etc. Around 1,00,000 resumes. >4. Company wise data are also available, around 50 reputed companies >in India. > > *The basic purpose of this database is that the consumer can market his > product/s sitting from his office, making cold calls or by mailing directly > to the concerned personnel. * > > The Resume Database comprises of people who have maximum experience in their > relevant field. > > The Resume Database does not contain personnel from the Accounts/Finance, > Sales & Business Development department and the Banking Sector. The reason > is that these people are comparatively easily accessible. Although Engineers > (Technical personnel) working in sales, marketing and business development > fields are available. > > *This Database is most suited and useful for Recruitment Consultants in ** > India** and Abroad. *If the consultant is not subscribed to the expensive > portals then this data would be most useful to them. > > *This Data is also useful to small and medium sized companies who have > limited resources, who cannot employ a battery of sales personnel.* Sales > people who keep on moving around in the market are susceptible to change > their job. They can spare some time to apply for other jobs and attend the > interview, while on outdoor field. Hence sales and marketing people keep on > changing their jobs after having short stints with companies. Once a > Salesman leaves a company, he also takes away with him the market > information and the intellectual database, sometimes. > > *Frequently Asked Questions* > > *Why Resumes as a database?* > > Resumes don't lie ! > > A Resume gives the full detail of a person for example, the residential > phone no. and address, the mobile/cell phone no., the email address, the job > responsibilities, the references, etc. These details help to contact that > key person with ease and perfection. Most importantly it saves time and > money. > > *Money! How does it save money?* > > You save money on phone calls. For example you want to contact the > Maintenance Manager of M/s.XYZ Corporation, you visit the companies website > wherein you may not find the required details (like the plant address, the > contact details, the contact person, the email address of that Manager, > etc.). You hence call the telephone operator, who will give you the half > information only (the telephone operator is normally not allowed to disclose > the cell phone numbers, email IDs, etc. of key contact personnel). > > Ultimately to reach that department or that key man you spend some good > amount of money on phone calls. > > *Is the database perfect and totally updated? * > > Honestly we believe that our database is nearly 94% correct. Because people > change companies; they give the temporary home address in their resumes; > sometimes email IDs are also changed; etc. But in India normally people > mention their permanent address in their resumes which rarely changes. > > *How do we search in this huge database ? * > > By using the Microsoft search method, typing out the key words and selecting > the particular folder in the options. The simplest method is to open each
Re: Django suddenly loses DJANGO_SETTINGS_MODULE running locally
This is why, eventhough its noted in the docs as optional, I add the pythonpath to my site in the apache vhosts file by default. Adding the path globally isn't really a good thing to do but adding it whenever your webserver starts the site its needed for, even if its already defined somewhere else, is imho a good practice. On Aug 28, 5:49 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 8/28/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > > > Has anyone else noticed this? Isn't "./manage.py" supposed to set up > > the settings module correctly? > > manage.py just tries to import the settings module directly; it > basically assumes that '.' is on your sys.path, that "settings" is the > name of your settings module, and that the current working directory > contains the settings module. > > Is it possible any of those things changed? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: modpython and python2.5
mod_python needs to be compiled against the python version your using. On windows mod_python even trows errors in the logfile (although it still functions) when you use the mod_python for python 2.5, while your using python 2.5.1. On Aug 28, 1:48 pm, Leandro Zanuz <[EMAIL PROTECTED]> wrote: > You'll need to recompile your apache/mod-python. When you > compile the mod-python you'll need ro inform the python path > that you want to use. > > Grupo Django escreveu: > > > This is not a django related problem, but I thought that maybe someone > > could help me. > > I have a Debian 4 server with apache2, modpython 3.3., python2.4 and > > python2.5 > > PYthon 2.4 is required by Debian to solve some dependency problem, I > > have just installed python2.5 and made it the default interpreter, but > > modpython is not using it, I have no idea why. > > Now I have a web down because I can't solve this problem. > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
DEBUG = False yet debug shows.
Am I loosing my marbles or is this normal, that if your logged into the admin with your super account, debug gets enabled automaticly for you? Any idea why django is showing a mix of my 404's, 500's and django's debug 404's and 500's in this scenario? Not just all custom errors or all django errors. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Database cached?
How long is the cache lifetime? On Aug 17, 5:41 pm, Doug B <[EMAIL PROTECTED]> wrote: > The caching is intentional, and designed to save you expensive > database queries. You can reset the cache in the shell by doing > something like this: > > qs=ModelName.objects.all() > # do stuff with your queryset > # do your external database manipulation > qs._result_cache=None # setting _result_cache none will make the > query set re-query the db next time it's used > # do stuff with updated queryset --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: 404 Page not found handling
Forest: Those were the same arguments I made for using them, added that that it might also be handy to incorperate the following conditions into the 404: 1: There is nothing related to their typo, so we return the normal looking 404. 2: There is 1 page that relates to their typo, so we automaticly redirect the user from the 404 page (not without returning the 404 first so that the status is kept), to the related page and puts a visible warning at the top of that page telling them they were redirected there because the url they used was bad and this page is related to what they seemed to be looking for. 3: There are multiple pages that are related to their typo, so we return the normal looking 404 with links to the related pages added in the body. 4: If they are registered users or have an active session, give them the option to use either the result of condition 3 or we redirect to the best match and put a warning at the top to the search page that shows the other pages that are related to their typo. Would the redirects be to much or would that still be acceptable? The ones against dynamic 404's have their opinions fueled by personal experiences visiting sites that get overly zealous using the abundance of space on 404 pages to put loads of ads and such. Imho, if you want to give your users the best experience on a website, you have to try and make the information you provide as easily findable as possible and even try to help users find information they are looking for if they don't use the normal search facilities you provide, as long as you don't screw with web standards (not returning the correct codes so that search engines go wild on your site), don't try to provide to much help, because that could make things cluttered and turn the attempt to be helpful into an annoyance and definably don't do funky stuff like placing banners, ads and redirects to external sites on your 404 pages. On Aug 16, 5:19 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-08-15 at 23:12 -0400, Forest Bond wrote: > > Hi, > > > On Wed, Aug 15, 2007 at 08:04:20PM -0700, TheMaTrIx wrote: > > > Is it, in your opinions, "nice", "appropriate" and "correct", in other > > > words, ethical, for an internet site to setup 404 pages so that when > > > for instance: > > > >http://www.domain.com/banana/ > > > > that doesn't exist, gets called, the user gets a 404 page inline with > > > the sites main layout + a bunch of suggestions for pages that might > > > fit what the user was looking for, like there are pages relevant to > > > banana at > > > >http://www.domain.com/recipies/milkshakes/banana > > >http://www.domain.com/gallery/dancingbanana > > >http://www.domain.com/music/RotterdamTerrorCorps/bananenlied > > > > Kinda like automated search results appended to the 404's. > > > I've had this talk with co-workers before, too. My take on it is this: > > > * If you don't have what the user is looking for, you should return a 404 > > status > > code. > > * There's nothing wrong with including additional information in the HTTP > > response body that may help the user find what he's looking for. > > * If your 404 page is overly complicated, it may not be immediately obvious > > to > > the user that an "error" condition has occured. This can be confusing, > > and > > should probably be avoided. > > > Does that sound reasonable to other folks? > > Absolutely. I think they're very good recommendations. The last item is > sometimes overlooked, but it is important: make it clear that the > intended target was not found and you aren't actually showing them the > target page. But providing helpful information or a search box is just > being user-friendly. > > Regards, > Malcolm > > -- > If it walks out of your refrigerator, LET IT > GO!!http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
404 Page not found handling
We're having a bit of a discussion here about an idea I came up with. The Django site we're developing is the first friendly URL site we're building (with php we never bothered, mostly because we mainly do intranet sites and SEF urls havent ever been a requirement and in PHP with mod rewrite, SEF urls are a nightmare) and after watching the presentation video's about Django before we started contemplating switching to it and hearing the developers say that they set their sites to send emails to the devs whenever a 404 PNF was invoked, so that they could create content to fit that request. Is it, in your opinions, "nice", "appropriate" and "correct", in other words, ethical, for an internet site to setup 404 pages so that when for instance: http://www.domain.com/banana/ that doesn't exist, gets called, the user gets a 404 page inline with the sites main layout + a bunch of suggestions for pages that might fit what the user was looking for, like there are pages relevant to banana at http://www.domain.com/recipies/milkshakes/banana http://www.domain.com/gallery/dancingbanana http://www.domain.com/music/RotterdamTerrorCorps/bananenlied Kinda like automated search results appended to the 404's. This might sound like a silly and noobish question, but hey, I'm a systems admin that comes up with idea's for the devs to work out, I'm not a programmer or developer. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Weird problem with memcached enabled
Extra note, eventhough Iarsholm's suggestion fixed one problem, I immediately got another error. (2 params passed to a function while it requires 3) This with v1.38 of python-memcached. (still didn't get cmemcached to build first gona learn some python so I can work my end of running Django sites a bit better aka systems administration) It was released a couple days ago and seems to have had a bug, v1.39 was released today and fixes that problem. On Aug 14, 9:10 pm, larsholm <[EMAIL PROTECTED]> wrote: > Hi > > What the error says is that it cannot add this together "time.time() + > cache_timeout" because on is float and the other is a string, so I > suspect that you somewhere have specified *cache_timeout* as a string > in quotes instead of just a number (without quotes). Either in the > settings.py or in manually in one of the views. > > Cheers, > Lars > > TheMaTrIx wrote: > > Firefox > > = All pages OK > > > Internet Explorer > > =http://www.domain.comgives HTTP500 error with info: > > > [error] PythonHandler django.core.handlers.modpython: Traceback (most > > recent call last): > > [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ > > python2.4/site-packages/mod_python/apache.py", line 299, in > > HandlerDispatch\nresult = object(req) > > [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ > > python2.4/site-packages/django/core/handlers/modpython.py", line 178, > > in handler\nreturn ModPythonHandler()(req) > > [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ > > python2.4/site-packages/django/core/handlers/modpython.py", line 155, > > in __call__\nresponse = middleware_method(request, response) > > [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ > > python2.4/site-packages/django/middleware/cache.py", line 81, in > > process_response\npatch_response_headers(response, > > self.cache_timeout) > > [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ > > python2.4/site-packages/django/utils/cache.py", line 86, in > > patch_response_headers\nresponse['Expires'] = > > formatdate(time.time() + cache_timeout)[:26] + "GMT" > > [error] PythonHandler django.core.handlers.modpython: TypeError: > > unsupported operand type(s) for +: 'float' and 'str' > > > =http://www.domain.com/?randomstringgives the normal frontpage. > > > Any idea whats up here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Weird problem with memcached enabled
Firefox = All pages OK Internet Explorer = http://www.domain.com gives HTTP500 error with info: [error] PythonHandler django.core.handlers.modpython: Traceback (most recent call last): [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\nresult = object(req) [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ python2.4/site-packages/django/core/handlers/modpython.py", line 178, in handler\nreturn ModPythonHandler()(req) [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ python2.4/site-packages/django/core/handlers/modpython.py", line 155, in __call__\nresponse = middleware_method(request, response) [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ python2.4/site-packages/django/middleware/cache.py", line 81, in process_response\npatch_response_headers(response, self.cache_timeout) [error] PythonHandler django.core.handlers.modpython: File "/usr/lib/ python2.4/site-packages/django/utils/cache.py", line 86, in patch_response_headers\nresponse['Expires'] = formatdate(time.time() + cache_timeout)[:26] + "GMT" [error] PythonHandler django.core.handlers.modpython: TypeError: unsupported operand type(s) for +: 'float' and 'str' =http://www.domain.com/?randomstring gives the normal frontpage. Any idea whats up here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
DjangoSnippets.org is down
Seems DjangoSnippets is down. Yesterday it took 10 minutes to load a page and now its simply erroring out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: cmemcached etc
No, its not reasonable to assume people know everything about python from day 1. I only just started using Python and primarily started using it because of Django. I had no problem installing Python, hooking it into Apache, configuring Django, etc etc, sys administration is my main field of expertise. But I'm not a programmer(eventhough I know my way around PHP better then most devs I know), am brand new to python and brand new to djagno. Where is the problem in putting: -- To install type: python setup.py install -- in the INSTALL file anyway? Why have an INSTALL file in every archive you release if you can't even be bothered to type that tiny line in it? You don't even have to write it with every release you make, just the very first time. Anyway, thanks for the information on the tutorial and the info about how to install these modules. On Aug 14, 1:28 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 8/13/07, TheMaTrIx <[EMAIL PROTECTED]> wrote: > > > Neither of these apps has any kind of information on their sites or in > > the archives on how you can install those modules so you can enable > > memcached in the django config. They seem to think that everyone knows > > everything about Python or something ... > > To be fair, you're trying to use a python library; it's reasonable to > assume you know how to use python. Do you think every library should > explain the same stuff every time? > > You should go read the python tutorial:http://docs.python.org/tut/ > > But if you're impatient: > wgetftp://ftp.tummy.com/pub/python-memcached/python-memcached-1.38.tar.gz > tar xfz python-memcached-1.38.tar.gz > cd python-memcached-1.38 > sudo python setup.py install --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
cmemcached etc
Ok, I've used memcached for quite some time with PHP sites and that was rather easy. Now I see you can use it with Django, but to get memcached support you need to either install cmemcached or python-memcached. Neither of these apps has any kind of information on their sites or in the archives on how you can install those modules so you can enable memcached in the django config. They seem to think that everyone knows everything about Python or something ... Anyone know how to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django database API - What is it good for?
Also, if I'm not mistaken, when you use the database api, the input validation steps are taken care of by the framework, you don't just tell in the models what format fields should be in the database, but at the same time are telling the framework what input it should accept for that field. If a field is EmailField, it'll only accept an actual [EMAIL PROTECTED] type input. It'll also escape everything correctly for you. Why is this important you ask? Using the database api almost completely removes all the SQL injection whoes developers have so they can focus on the important stuff. The philosophy behind django is to automate the repetitive and boring stuff from developing highend websites. I for one am very happy with this because I spent most of my PHP development time fixing SQL injection bugs in peoples apps (writing loads and loads of validation code) and creating admin interfaces for websites that up to that point used nothing but phpMyAdmin to do the administration of their sites. If your going to use pure SQL instead, you don't just have to write all those query's (in the long run, when using the API you'll end up writing much less code), but will also have to write routines to clean up the input into your app, while they are already part of the framework On Aug 13, 11:20 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/13/07, Amirouche <[EMAIL PROTECTED]> wrote: > > > What do you mean, I can't understand. > > OK, suppose you are running an online store, so you have a database > table "orders", which lists orders customers have placed, and another > "addresses" which lists the addresses to ship the orders to. To > calculate the shipping cost for an order, you need the total amount of > the order and the address it ships to; calculating it with an > application which does pure raw SQL looks like this: > > query = "SELECT orders.amount, addresses.address FROM orders INNER > JOIN addresses ON addresses.id = orders.address_id WHERE orders.id = > %s" > cursor.execute(query, [23]) > row = cursor.fetchall()[0] > shipping_amount = calculate_shipping(amount=row[0], address=row[1]) > > Doing it with an ORM looks like this: > > order = Order.objects.get(id=23) > shipping_amount = order.calculate_shipping() > > The fact that the ORM automatically gives you instances of > domain-specific classes means that you immediately have access to your > customized business logic, and that you can encapsulate it in those > classes and rely on their availability, which improves the design of > your code. It also significantly cuts down the amount of code you need > to write, and makes it clearer what's going on: you're calculating the > shipping price of Order #23. > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: application/xhtml+xml MIME won't take
For the site in question yes. It'll be an intranet site where only a tested version of Firefox is allowed for web browsing and they demanded the latest stable versions of all standards to be used. And for other sites where xhtml 1.1 is wanted, I'm planning to use a middleware that'll dynamically change the header depending on the browser. And for why we won't use that on this site is that its another trap for users to see if they didn't tamper with the computers they worked on and installed an app that isn't allowed by company policy. Most of the previous work I did for this company is design ADS policy's and scripts to make sure people don't change anything on these workstations, if they call up to say their "browser" gives a download prompt instead of giving the intranet site, the helpdesk techies only need to go over there and slap them over the head instead of wondering why some users are complaining that some parts of the site doesn't work. The idea there is that once they log off a computer, it needs to be as if no one ever worked on it since its completely Gigabit connected in there, installing apps at login is about as transparent as loading a roaming profile. All their personal stuff is loaded at login, including apps they specifically might need, apps that can run of the network (office for example) are mounted at login. For me personally the idea has always been to stay on the stable edge of the standards. I've always done this with php in the past and I'll do the same in the future with Django. On Aug 13, 7:09 pm, "John Lenton" <[EMAIL PROTECTED]> wrote: > On 8/13/07, TheMaTrIx <[EMAIL PROTECTED]> wrote: > > > > > I'm developing a site that needs to be xhtml 1.1, my page validates > > just fine except that the server keeps spitting it out as text/html > > instead of application/xhtml+xml. > > > How the heck do I make django set application/xhtml+xml for the pages > > it serves? > > > I tried changing the text/html entry in my mime.types file for apache > > to application/xhtml+xml but that does squat. > > do you want to do that, given that a large portion of your (average) > clients will now get a download dialog instead of a web page? > > -- > John Lenton ([EMAIL PROTECTED]) -- Random fortune: > The trouble with a lot of self-made men is that they worship their creator. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
application/xhtml+xml MIME won't take
I'm developing a site that needs to be xhtml 1.1, my page validates just fine except that the server keeps spitting it out as text/html instead of application/xhtml+xml. How the heck do I make django set application/xhtml+xml for the pages it serves? I tried changing the text/html entry in my mime.types file for apache to application/xhtml+xml but that does squat. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django built-in web server
You could use something like XAMPP if your really unconfortable setting up apache and mysql by hand. Xampp's base install gives you apache and mysql preconfigured and there is a python addon thats also preconfigured. And if you can install and develop python/django apps, don't be to afraid of installing Apache, its not that hard. On Aug 10, 1:25 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > hi, > > > Can I use the django's built in web server in an intranet enviroment > > where the maximum users could be not more than 50 users? I am just > > asking this for the purpose for easy deployment :). I am very newbie, > > and trying to avoid apache > > Unless something changed recently, the built in server is *not* > threaded, meaning you can only service one request at a time. Even if > only 50 people have access to the server, that might start causing > problems for you. > > Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Page generation times
In PHP its handy and easy to setup a function to use during development where you can see page generation times, your linux load averages, a count for database calls in a page and compare between how much time spent between generating the PHP output and waiting for the database. Is there something like this available in the Django framework? If not is there an easy way to do this with Python? Any info and pointers is much appreciated. I'm constructing a site that is really heavy on data (it won't grow to GB's of data, it'll actually start with around 8GB, not counting images and files ...) and knowing all details on how python and django react to loading alot of data and types of data to a page will be really helpful --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Admin shows "BlaBla object" for every item in lists instead of the actual names of the objects.
Thanks for the quick reply and it works perfectly. Would be good if this was added to the docs on the site, I saw this was the way it was done in some old screencasts where they were still calling models out of django.core and after reading the official docs and seeing that the simplest way to call admin was class Admin: pass, I thought the __str__ and __unicode__ method wasn't needed anymore. Also, please don't confuse a printer with a movie. I've carried this name for over 15 years now, on BBS and the web and as you might imagine, the comments I've gotten since that movie came out have gotten rather tiresome over the years. :p On Aug 5, 11:53 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > Hi Neo, > > On 8/5/07, TheMaTrIx <[EMAIL PROTECTED]> wrote: > > > > > > > I have many tables with universal data I use across projects, alot of > > them are tables with 1 column. > > > One example of this is a table named "Continents" with the names of > > all continents and subcontinents including the less known ones (like > > the Kerguelen continent) > > > When I setup the admin to display the contents of these single column > > tables, it gives me a list of: > > > Continents Object > > Continents Object > > Continents Object > > Continents Object > > > instead of > > > Asia > > Europe > > North America > > South America > > > Am I doing something wrong or is this some sort of bug? > > > The way I call admin for these table models is simply: > > > class Admin: > > pass > > > I tried setting list_display to see if that helps, but it won't let me > > do that when there is only 1 column in the table because list_display > > needs a format of list_display = ('name1', 'name2', ...). > > Override your class' __str__ method, or better __unicode__: > > class Continent(models.Model): > ... > def __unicode__(self): > return self.name # or whatever > > It would be also a good idea not to create a continent class, since > they won't change in the next future. :-) > > HTH > Kai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Admin shows "BlaBla object" for every item in lists instead of the actual names of the objects.
I have many tables with universal data I use across projects, alot of them are tables with 1 column. One example of this is a table named "Continents" with the names of all continents and subcontinents including the less known ones (like the Kerguelen continent) When I setup the admin to display the contents of these single column tables, it gives me a list of: Continents Object Continents Object Continents Object Continents Object instead of Asia Europe North America South America Am I doing something wrong or is this some sort of bug? The way I call admin for these table models is simply: class Admin: pass I tried setting list_display to see if that helps, but it won't let me do that when there is only 1 column in the table because list_display needs a format of list_display = ('name1', 'name2', ...). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---