Re: Errors Using Pip In Powershell to Download Django

2014-07-17 Thread Sam Lai
Can you provide some console output so we can see what commands you're entering and what the actual output is? On 17 July 2014 04:06, Malik Rumi wrote: > Yesterday I tried to get the 1.7rc1 and got the error 'file contains no > section headers'. I assumed this was because it was a tarball, and af

Re: Geodjango and Python 3.3

2014-03-27 Thread Sam Lai
pi.python.org/pypi/GDAL/ > https://pypi.python.org/pypi/Shapely (Infers Geos) > > Thanks, > Alex > > On 03/25/2014 05:34 PM, Sam Lai wrote: >> I'm developing a site using Python 3.3, Django, Geodjango and >> PostgreSQL. It is a bit tricky getting all the libraries to work, bu

Re: Geodjango and Python 3.3

2014-03-25 Thread Sam Lai
I'm developing a site using Python 3.3, Django, Geodjango and PostgreSQL. It is a bit tricky getting all the libraries to work, but the stack does work. I installed GEOS using OSGeo4W, but I had to explicitly specify the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH in settings.py. On 25 March 2014 23:2

Re: [ELI5] how to deploy django

2014-03-03 Thread Sam Lai
On 4 March 2014 14:36, Walter Wang wrote: > I tried my best to follow the various guides out there, but the official > documentation here > https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/ has > different instructions than the instructions here, > https://www.digitalocean.com/

Re: help with GEOS and PROJ.4 in windows 7

2014-02-16 Thread Sam Lai
Did you try the steps listed in the geodjango documentation, specifically https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#osgeo4w and the following step to configure the environment? If you did and it didn't work, what was the error? On 16 February 2014 05:55, Nicholas Perez wrote

Re: virtualenv on Windows

2014-01-29 Thread Sam Lai
16:27, Mike Dewhirst wrote: > On 29/01/2014 2:23pm, Sam Lai wrote: >>> >>> However, even after downloading from that site they cannot be installed >>> manually into a virtualenv! Only pip can do that. >> >> >> You can install the packages from >> h

Re: virtualenv on Windows

2014-01-28 Thread Sam Lai
> However, even after downloading from that site they cannot be installed > manually into a virtualenv! Only pip can do that. You can install the packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/ by simply running - pip install ... from inside your virtualenv. Those .exe files are pip-c

Re: UnicodeDecodeError in python manage.py flush

2014-01-20 Thread Sam Lai
It looks like you have named one of your model classes with a name that contains a non-ASCII character. Stick with class names with only a-z, A-Z, 0-9 characters and see if that helps. On 21 January 2014 10:29, Edgar Reyes wrote: > Hi, I'm looking in google search about this error but I didn't fi

Re: Exception on start django server in windows 7

2014-01-20 Thread Sam Lai
It's due to the accent on the e in your username. This is a 'bug' in the way Python works with the Windows command prompt. Long story short, just move the 'Python' directory out from your Desktop to somewhere just on your C:\ drive (so your username isn't in the path) and everything will work, e.g

Re: Getting GIS Working - possible kernel32 problem

2013-10-25 Thread Sam Lai
Can you try running 'python.exe manage.py runserver' outside of PyCharm, i.e. in the Command Prompt/PowerShell? I've got a similar setup, although on Windows 7, and it works. Instead of setting environment variables, I added the following parameters into my settings.py to indicate the location of

Re: Tests not loading initial_data fixtures

2013-10-03 Thread Sam Lai
Ah, turns out all you have to do is specify - fixtures = [ 'initial_data' ] ... in the TestCase and it'll load all the initial_data fixtures from all apps. Still a bit odd that loading initial_data fixtures isn't the default in tests though. On 3 October 2013 16:49, S

Tests not loading initial_data fixtures

2013-10-02 Thread Sam Lai
I'm trying to test a Django management command in app X that parses data files and inserts data into models that are located in apps Y and Z. Apps Y and Z have initial_data.json files in them. On running my test however, it seems that my initial_data fixtures are not being loaded. I could specify

Re: Bootstrap - django-bootstrap3 or django-crispy-forms

2013-09-26 Thread Sam Lai
Yep. django-bootstrap-* and django-crispy-forms only provide helpers for outputting HTML with bootstrap CSS classes. Neither are really necessary to use Bootstrap (just makes it slightly easier), which is applied through HTML and CSS and Django doesn't place any restrictions on how your HTML/CSS i

Re: virtualenv setup

2012-12-29 Thread Sam Lai
It looks like you haven't installed Django in your virtualenv. In your virtualenv directory, look in lib/python2.x/site-packages and see if there is a Django directory in there. You can also try sourcing your venv, then running Python, and entering in the following statement to see if Python can f

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Sam Lai
On 20 October 2012 14:16, Barry Morrison wrote: > I've got a pretty expensive query...Wondering if I can't speed things up in > regards to Postgresql. > > Here is the model: [1] http://dpaste.org/JmEeQ/ > > Here is the sql statement: [2] http://dpaste.org/GbfAJ/ > > Here is the template: [3] http:

Re: Beginner problem linking pages from homepage?

2012-09-22 Thread Sam Lai
On 23 September 2012 06:40, Vincent Fulco wrote: > Missing something basic here even after scouring web and running thru online > tut a few times. > > Started a project 'mysite' and added twitter bootstrap then created a static > homepage "index.html' to act as a simple launchpad to other more inf

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{% endblock %} > {% bloc

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{% endblock %} > {% bloc

Re: Accessing objects from a dictionary in templates

2012-03-24 Thread Sam Lai
On 24 March 2012 09:29, gowtham wrote: > Template tag filters like this (made one for each field in the library > object) helps me to get what i wanted But, that seems too silly to do... > > in template > {{ reslibdic|hash2libcode:res.result_id }} > I had the same thought as Reinout did, but

Re: Running manage.py commands in Windows Power Shell

2012-03-15 Thread Sam Lai
On 15 March 2012 04:35, orschiro wrote: > Hello, > > I have a question which is based on the discussion here: > > http://groups.google.com/group/django-users/browse_thread/thread/2333f5dc8d0674f0 > > I'm working on Windows 7 with the PowerShell. Python 2.7 and the path > to django-admin.py is stor

Re: Haystack Solr Error

2012-03-06 Thread Sam Lai
On 5 March 2012 07:49, coded kid wrote: > I'm trying to rebuild_index, so after inputting manage.py rebuild- > index , I'm getting: > > Removing all documents in your index because you said so. > fail to clear Solr index: [Errno 10061] No connection could be made > because the target > machine act

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-30 Thread Sam Lai
On 29 January 2012 16:49, JJ Zolper wrote: > Sam, > > I have set up VirtualBox with Python and Django. Things have gone > flawlessly. > > Only thing I've noticed is it seems to be running a tad bit slow. I feel > this way because I had a native installation before and it ran quite well. Have you

djangosnippets.org domain has expired

2012-01-28 Thread Sam Lai
Heads-up to whoever is in charge of this domain - it has expired and is now redirecting to a GoDaddy domain parking page. -- 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 unsu

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 13:14, JJ Zolper wrote: >> The keywords were 'in production'. The development server (i.e. python >> manage.py runserver) works fine under Windows. But when you want to >> make the website accessible to your audience (the internet, company >> etc.), you should host that on Linux

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 12:05, JJ Zolper wrote: >>  Unless you have a >>  preference for Windows though, I wouldn't use it as a Django app web >>  server in production; there's far less support on the net to help you >>  out when things go wrong. > > Let me see if this what you mean... so when I want t

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
it the file for execution. You may even be > prompted to supply command line arguments (PythonWin, I know does this). > > This is very interesting thanks for sharing! As for the information above > that has cleared it up quite a bit for me. > > Sam Lai has helped a lot I think I am

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-24 Thread Sam Lai
On 24 January 2012 07:58, JJ Zolper wrote: > Yes I knew I was in the Python shell I just never saw anything that > described you couldn't make Django commands within the Python interpreter. I > mean it is based on Python isn't it? That's where I thought logically you > could make Django calls from

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-23 Thread Sam Lai
On 23 January 2012 15:22, JJ Zolper wrote: > Hello everyone, > > I was able to install Django to my machine and before I was using the > command prompt. Django's path is in my Windows 7 64 bit Enterprise > Environment variable. Python worked fine as well too. I also installed > IPython because I h

Re: does php code works in Django

2011-10-20 Thread Sam Lai
On 20 October 2011 20:15, Chen Xu wrote: > Hi, everyone: > I am new to Django, does anyone know whether php code works in Django? This list's archives will have the answer to your question, and many variations of it. http://groups.google.com/group/django-users The short answer is no; PHP and Py

Re: template newlines

2011-08-14 Thread Sam Lai
On 14 August 2011 14:00, Python_Junkie wrote: > I think that if you performed the logic to determine if there actually > is something in the interest for that row in the view and > then only pass those components from the view, and not in the template > then your problem goes away. > I don't thin

Re: uber weird access problem from windows

2011-05-23 Thread Sam Lai
On 23 May 2011 11:15, Kenneth Gonsalves wrote: > On Sat, 2011-05-21 at 08:04 -0400, AJ wrote: >> Just out of curiosity, is it firefox 4? Is it seen with some of the >> other >> web forms too? > > just one form - I do not have access to that machine right now, but I do > not think it is ff4. Will c

Re: haystack

2011-05-12 Thread Sam Lai
On 12 May 2011 17:31, pankaj sharma wrote: > > can u tell me which one is better in sphinx and haystack Haystack provides only the glue between Django and a search engine/indexer. With Haystack, you still need to pick a search engine to use, e.g. Solr, Whoosh, Xapian. It doesn't support Sphinx ye

Re: Django & Two Factor Authentication (2FA)

2011-03-24 Thread Sam Lai
On 24 March 2011 07:52, pokecho wrote: > I am writing to ask whether it is possible to configure > "django.contrib.auth"  so that it can implement Two Factor > Authentication to step up login security. > > The idea is that instead authenticating against just "username" and > "password" one could a

Re: Syncing with an MS Exchange server...

2011-03-04 Thread Sam Lai
On 4 March 2011 23:23, illuminated wrote: > Hello everyone, > > Part of an application I'm developing at the moment is messaging and > one of the features should be ability to access an MS Exchange user > account (not through IMAP) and get his emails, contacts and calendars > (the code is not host

Re: curious about model classes

2011-03-03 Thread Sam Lai
On 3 March 2011 08:02, Alex Hall wrote: > Hi all, > Still working through that tutorial. I am just curious: why are none > of the class variables called self.var, but rather just var? For > example: > import models > class Poll(models.Model): >  question=models.CharField(max_length=200) > > Should

Re: Authorization of static content

2011-02-23 Thread Sam Lai
On 23 February 2011 19:03, Joakim Hove wrote: > Hello, > > I am using Django to create an album application. I was planning to > use djangos user system for authorization, however the final image > viewing will be like: > >     > > Where image.url should resolve to something like > http://static

Re: population of *.html fields from Django

2011-02-07 Thread Sam Lai
On 7 February 2011 03:34, gintare wrote: > I would like to use only plain html field names > Reading them is not a problem with request in views. > How to populate html document back ? > > > I have *.html with lines: > > >   textarea> >   >   > > #in views.py > item = request.POST.get('cbnWw','')

Re: Some beginners question

2011-01-31 Thread Sam Lai
On 31 January 2011 15:55, vishy wrote: > 1) I want to read files. Where should I put these files? I am not using a > model to link to the files. And how to discover the path to files? I am > working on windows, and in development environment I am using the full path > to the file. Wherever you wa

Re: How to write joins ?

2011-01-27 Thread Sam Lai
On 28 January 2011 16:07, sushanth Reddy wrote: > hi Sam, > > Here is example model: > > class Profile(models.Model): > name = models.CharField(max_length=50, primary_key=True) > assign = models.CharField(max_length=50) > doj = models.DateField() > dob = models.DateField() > >

Re: newbie help with console, can't run Django function

2011-01-27 Thread Sam Lai
On 27 January 2011 14:26, Casual Coder wrote: > Is there a way to see what all got imported from django? In Python, you can see what is available in each imported module by using the dir function, e.g. >>> import django >>> dir(django) ['VERSION', '__builtins__', '__doc__', '__file__', '__name

Re: How to write joins ?

2011-01-27 Thread Sam Lai
On 28 January 2011 12:16, sushanth Reddy wrote: > HI, > > How to write joins in django,i have gone through below django documentation > ,but joins are not working for my model > > Class working(models.model) >   w_name =models.ForeignKey(Profile, db_column='name') >   monday =  models.IntegerFi

Re: Django's documention is horrible

2011-01-10 Thread Sam Lai
On 11 January 2011 13:39, Christophe Pettus wrote: > > On Jan 10, 2011, at 1:25 PM, Simon W wrote: > >> For such a good web framework it's a shame that the documention is not >> structured well .. at all. > > I have no doubt that the project would be more than receptive to doc patches > to fix t

Re: merge 2 views?

2011-01-01 Thread Sam Lai
On 2 January 2011 00:56, bruno desthuilliers wrote: > "simple_tag" is nothing new - it has been here since the 0.96 days > IIRC. But only the version in v1.3 has the ability to manipulate the context object (which is what's needed in the suggested alternative solution), thanks to the new takes_co

Re: merge 2 views?

2010-12-31 Thread Sam Lai
The one downside to this solution is that these variables will fetched for every request, even if navigation.html was not included in the output template. An alternative solution would be to create a template tag that fetches these variables, and only load and use this template tag in navigation.h

Re: De-coupling settings.py from project

2010-12-31 Thread Sam Lai
On 31 December 2010 03:50, eblume wrote: > In particular, I'm having trouble specifying the static content URL > and the fixtures directories at a per-application level rather than in > the project settings.py file. Can't you implement a static files finder, in the similar way to template loaders

Re: Replace URLResolver?

2010-12-28 Thread Sam Lai
On 28 December 2010 22:43, Martin wrote: > Hi. > > I would like to use subdomains in my URL-dispatch. Thats not supported > by Django. > > Is it possible to replace Django URLResolver with my own? Must this be > done as a Middleware class? No, you can't really replace the default URLResolver with

Re: unsupported operand type(s) for -: 'unicode' and 'int'

2010-12-23 Thread Sam Lai
I'd say you should check if the pagesize variable is a string or not on this line - upperbound=self.pagesize * int(arg0) Remember in Python, 'hello' * 2 == 'hellohello'. On 24 December 2010 05:04, prasad iyer wrote: > Hi Everyone, > I am getting type error on integer. I have tried converting al

Re: Haystack error rebuinding index

2010-12-20 Thread Sam Lai
2010/12/21 Daniel França : > anyone? > > 2010/12/19 Daniel França >> >> Hi all >> I was using haystack(xapian) at a Mac, so I moved it to a Linux (Ubuntu >> 10.10) using python 2.6.6, but now when I try to rebuild the index I get the >> following error: >> AttributeError: 'ProfileIndex' object has

Re: Developing a search engine

2010-12-15 Thread Sam Lai
On 16 December 2010 08:56, marcoarreguin wrote: > I'm trying to make a search engine with my database, parsing de text > that the user write in the textbox to make a list with the cleaned > words, in just one table of the DB in the fields: title, descripcion > and tags, I have something like this

Re: DateTimeField doesnt get future date.

2010-12-12 Thread Sam Lai
On 13 December 2010 13:45, Recep KIRMIZI wrote: > On Mon, 13 Dec 2010 13:33:37 +1100 > Sam Lai wrote: > >> Sounds odd. What is the future date you're entering? Are you sure your >> system has the right date format set, e.g. you're not entering a >> MM/dd/yyy

Re: DateTimeField doesnt get future date.

2010-12-12 Thread Sam Lai
Sounds odd. What is the future date you're entering? Are you sure your system has the right date format set, e.g. you're not entering a MM/dd/ date when the system is expecting a dd/MM/ date or vice versa? On 13 December 2010 08:29, Recep KIRMIZI wrote: > Hi i have a model which has a dat

Re: FileField and location and storage

2010-12-08 Thread Sam Lai
: 230 self.generate_filename = upload_to On 9 December 2010 15:43, Sam Lai wrote: > I have a custom file storage working with a specific subdir structure. > > Did you pass in a method specifying the path in the upload_to kwarg > for FileField? > > Here

Re: FileField and location and storage

2010-12-08 Thread Sam Lai
I have a custom file storage working with a specific subdir structure. Did you pass in a method specifying the path in the upload_to kwarg for FileField? Here's my model code, where EnhancedFileSystemStorage is my custom file storage class, and get_random_dir_name is just a helper method that doe

Re: Django in production on Windows

2010-12-07 Thread Sam Lai
he and use that instead though, either replacing IIS, or using IIS as a reverse proxy to Apache. On 8 December 2010 11:07, Sam Lai wrote: > On 8 December 2010 02:50, shmengie <1st...@gmail.com> wrote: >> www.cygwin.com is one possible windows avenue that might work.  When I >> was ha

Re: Django in production on Windows

2010-12-07 Thread Sam Lai
On 8 December 2010 02:50, shmengie <1st...@gmail.com> wrote: > www.cygwin.com is one possible windows avenue that might work.  When I > was hanging on to windows because I had to support it, I used cygwin > religiously.  I found a lot about cygwin to be frustrating, but it was > better than being w

Re: Javascript and template rendering problem

2010-11-29 Thread Sam Lai
On 30 November 2010 07:03, Anderson Goulart wrote: > Hi, > > How can I render to a javascript code a variable set in a view? I tried {{ > variable }} but it returns nothing in the html source code. When I put this > {{ variable }} outside

Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-27 Thread Sam Lai
I don't know much about converting WSDL to SOAP/REST in Django. Probably easier with SOAP as WSDL and SOAP are often used together. You need to check if the first character is actually the BOM. Open the file in a hex editor and see what the first byte is. It might not be. A quick Google tells me e

Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread Sam Lai
No, you need that line. It is the first *character* of the file that you need to remove. It is an *invisible* character. Try opening and closing it in notepad; it might remove it. Otherwise, can you get your WSDL generator to not output the BOM? Or, you could use python to read and rewrite that fi

Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread Sam Lai
How was the WSDL generated? Was it done on a Windows machine? If so, it writes a Byte Order Mark at the start of Unicode documents by default. *nix and Python however doesn't expect BOMs, so it chokes. You need to remove the BOM from your WSDL file. On 27 November 2010 17:46, sami nathan wrote:

Re: how to configure database?

2010-11-22 Thread Sam Lai
How does it 'not seem to work'? Are these two apps within the same project? In that case, they should by default use the same database. On 23 November 2010 07:32, pa_ree wrote: > hello, i'm new to django framework. > > i want to know how can i configure a single database to two > applications. >

Re: Problems firing up django site

2010-11-22 Thread Sam Lai
You'll have to provide more information - what site, what have you tried? But before you do that - start with the Django tutorial. It is very detailed, and should help you get started. http://docs.djangoproject.com/en/1.2/intro/tutorial01/ On 23 November 2010 04:22, Bonucci wrote: > Hii guys, i

Re: question about involve "vncserver" command with django

2010-11-10 Thread Sam Lai
Why can't you tell vncserver to listen on a different port? the vncserver script passes any unknown args to Xvnc, so you can use the argument for Xvnc to change the port (-rfbport port_number). man vncserver: http://www.realvnc.com/products/free/4.1/man/vncserver.html man Xvnc: http://www.realvnc

Re: Trouble accessing development server

2010-11-10 Thread Sam Lai
Do you have a dedicated IP? If not, you're pretty much out of luck with the development server. http://helpdesk.hostmonster.com/index.php/kb/article/000405 On 11 November 2010 04:28, Engywook wrote: > Hmm... none of the below work. Also doesn't seem to matter if I use > port 8000 or port 8100 o

Re: my first (public) app: django-requires_js_css

2010-10-24 Thread Sam Lai
On 21 October 2010 16:01, Jason Persampieri wrote: > http://github.com/pappy74/django-requires_js_css > > Howdy folks, > > I was hoping to get some feedback on my first public app, django- > requires_js_css.  The app's purpose is to allow 'sane' JavaScript and > CSS requirements.  That is, require

Re: Path issue on Linux

2010-10-17 Thread Sam Lai
Python should already by in your PATH when you installed the package from the Ubuntu repositories. I think your issue is that your manage.py is not executable. In the directory containing manage.py, type chmod u+x manage.py Then you should be able to just type ./manage.py On 18 October 2010 08

Re: Using a non-DB backend

2010-10-15 Thread Sam Lai
On 16 October 2010 00:21, Damir Dezeljin wrote: > Hi. > I'm working on an application tat communicates with embedded devices > connected to the LAN. The devices are controlled by a central server written > in C++. Django is used for the front-end or better to say the GUI for the > server. > Part o

Re: Help with http basic authentication

2010-10-12 Thread Sam Lai
On 12 October 2010 22:29, Morten Pedersen wrote: > Hi everyone > I would be very very gratefull for any help getting access to the basic http > user and password through Django. As far as I know, HTTP Basic Authentication occurs at the HTTP connection level, i.e. it is between the web server and

Re: WANT TO SEND REQ TO URL GET RESPONSE FROM THE SAME URL

2010-10-12 Thread Sam Lai
On 12 October 2010 22:56, sami nathan wrote: > Hello sir, > I need to display the reult of >           "http://m.broov.com/wap/di/sub?word=dog&type=00&submit=Submit"; > in my url which is > http://localhost/flip/wap/di/sub?word=dog&type=00&submit=Submit > My view looks like this > from django.http

Re: convert list into a comma separated string

2010-10-05 Thread Sam Lai
On 4 October 2010 21:41, ashy wrote: > Hi All, > > I am writing a django function in which I have a following list: > li = ['a','b','c'] > I want to create a string from the list which should look like > str = 'a,b,c' > > I plan to pass this string to not in () function of my sql query. If you're

Re: Upload a File using the request.POST data

2010-09-26 Thread Sam Lai
be. > Not altogether helpful, eh? > > d > > > On Sep 27, 1:52 pm, Sam Lai wrote: >> Have you got the right attribute in the form? >> >> Fromhttp://docs.djangoproject.com/en/dev/topics/http/file-uploads/ >> >> "Note that request.FILES will only

Re: Upload a File using the request.POST data

2010-09-26 Thread Sam Lai
Have you got the right attribute in the form? >From http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ "Note that request.FILES will only contain data if the request method was POST and the that posted the request has the attribute enctype="multipart/form-data". Otherwise, request.FI

Re: How to use custom classes in django

2010-09-22 Thread Sam Lai
After revising python basics, here's how I'd structure it - On 22 September 2010 18:10, jake2891 wrote: > Hey guys, i am using extjs in django and am wondering the correct way > to build custom classes like file upload classes and classes of > functions. I'm assuming by 'file upload classes' you

Re: Urlencode vs. iriencode

2010-09-04 Thread Sam Lai
code does anyway. > On Sep 4, 8:45 pm, Sam Lai wrote: >> Here's the code for the two (the numbers at the start of each line are >> just line numbers from the file) - >> >> iriencode: >> 128     """ >> 129     Convert an Internationalize

Re: Urlencode vs. iriencode

2010-09-04 Thread Sam Lai
Here's the code for the two (the numbers at the start of each line are just line numbers from the file) - iriencode: 128 """ 129 Convert an Internationalized Resource Identifier (IRI) portion to a URI 130 portion that is suitable for inclusion in a URL. 131 132 This is the algorith

Re: windows7, django-admin.py, system variables, no module named django.core

2010-09-04 Thread Sam Lai
On 3 September 2010 19:42, gintare wrote: > Hello, > > I mean the correct way of running django seems to be to add to windows > environmental variable PATH c:/first/Python26/Lib/site-packages/ > Django-1.2.1/django/bin > and when run > $ cmd > $ django-admin.py startproject mysite > > the question

Re: apache, mod_wsgi, windows: config hints?

2010-08-25 Thread Sam Lai
On 25 August 2010 20:09, Reinout van Rees wrote: > Hi all, > > I normally deploy everything on linux, but a customer requires windows.  I > have a working setup with apache and mod_wsgi, but I wonder about the > efficiency. > > I see hints like "mod_wsgi, daemon mode" including "but that doesn't w

Re: windows7, django-admin.py, system variables, no module named django.core

2010-08-25 Thread Sam Lai
If you want to understand why you are getting the error, start by understanding Python modules - http://docs.python.org/tutorial/modules.html Hint - you can't just copy a script around and expect it to work. The script depends on other files to make it all happen. If in python, you type, import

Re: method on the User model?

2010-08-24 Thread Sam Lai
You need to look at SQL aggregates. See here - http://docs.djangoproject.com/en/dev/topics/db/aggregation/ On 25 August 2010 14:44, Joel Klabo wrote: > I am trying to find a way to get a list of users ranked by the most > "drinks". The drink model has a User field so I am doing this to get > the

Re: virtualenv and standalone scripts

2010-08-24 Thread Sam Lai
On 24 August 2010 06:54, Oivvio Polite wrote: > Following advice on this list I've moved to virtualenv+pip to manage my > django stack, which so far is working out nicely. > > But what should I do about standalone scripts? Say I have a project > called mysite. If I'm in a virtualenv and execute a

Re: What's the best way to custom the add page (in django admin site)

2010-08-24 Thread Sam Lai
On 23 August 2010 22:38, Yangmin Li wrote: > sorry for the previous incomplete message. > Here is what I want to ask, thanks in advanced. > I have a model called request, after registered in admin backend, user can > add new request object in admin pages. > I want to modify the request-add page to

Re: duplicate post_save signals

2010-08-18 Thread Sam Lai
I was looking at this over the weekend as well; isn't a problem for me but it seems that the post_save signal is triggered even when commit=False. Therefore when the object is saved again with commit=True, it is fired again. I didn't really investigate this so I could be wrong, but might be someth

Re: geodjango: windows installer for geos dependency?

2010-08-17 Thread Sam Lai
Quick Google tells me that PostGIS contains GEOS 3.2.0. I know you're not using PostgreSQL, but installing that might do the trick, or if you don't want to pollute your server, you can probably extract it from the setup somehow. http://postgis.refractions.net/download/windows/#windbinaries On 18

Re: Migration: AlreadyRegistered

2010-08-17 Thread Sam Lai
tos Jonathan Hayward < > christos.jonathan.hayw...@gmail.com> wrote: > >> Thank you; I'm not seeing how. My admin.py reads: >> >> import django.contrib.admin >> import directory.models >> import tagging >> >> django.contrib.admin.autodiscover() >> django.cont

Re: Migration: AlreadyRegistered

2010-08-17 Thread Sam Lai
It means somehow you're calling this line in an admin.py file twice - admin.site.register(Entity) Check the admin.py file for the app that contains the Entity model. On 18 August 2010 10:57, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I am trying to migrate from on

Re: Django Setup

2010-08-17 Thread Sam Lai
On 18 August 2010 07:29, Marty wrote: > Runing on Windows 7 > First time user of Django and Python.  Got python installed at f: > \python27,  downloaded DJango tar file.  Used WInRAR to extract. > Copied all of DJANGO into Python27 You actually don't need to do that; setup.py automatically copies

Re: mod_wsgi+Apache+Postregsql on Windows

2010-08-13 Thread Sam Lai
I haven't watched Graham's video, but here's what I typically do. On 14 August 2010 15:39, John Yeukhon Wong wrote: > I do plan to deploy the project on a UNIX server in the future, and I > still do want to follow up with the previous discussion: > > So in general, > > 1. When I write a django pr

Re: mod_wsgi+Apache+Postregsql on Windows

2010-08-13 Thread Sam Lai
On 14 August 2010 15:39, John Yeukhon Wong wrote: > I noticed that if I have two of them co-exist simultaneously > WSGIScriptAlias / "f:/public/testproject/apache/django.wsgi" > WSGIScriptAlias /testproject "f:/public/testproject/apache/hello.wsgi" > > I will get nothing but the same default blue

Re: Django on Mac OS X

2010-08-08 Thread Sam Lai
2010/8/9 Daniel França : > I tried to reinstall everything... installing python+postgres from ports > and I get the Symbol not found: _PQbackendPID error again from psycopg. > I guess the best solution is run Ubuntu on a virtual machine or my project > will be stuck forever. > python+psycopg on mac

Re: Linkedin Search

2010-08-07 Thread Sam Lai
On 7 August 2010 22:53, kostia wrote: > I would like to know what search engines are used in web sites like > Facebook, Linkedin, Twitter and so on. > > Are they simplistic database queries or sophisticated search solutions? I'd say all three of those sites use custom search engines, possibly bui

Re: overriding model.save()

2010-08-05 Thread Sam Lai
On 5 August 2010 03:05, Sells, Fred wrote: > I would like to prevent saving a new value if the database contains a > specific value.  This is on a per field, per record basis. > > If I override the save() method; is there a way to find the existing (in > the DB) values and the new (to be stored) v

Re: cleaning html with bleach

2010-06-30 Thread Sam Lai
Nice find - I did pretty much the same thing, but using lxml.Cleaner. This seems more configurable; I'm probably going to change mine over to this instead. Generally the rule with script injection is to scrub and filter on output, because that's the last line of defense. However, for situations li

Re: Parameters

2010-06-30 Thread Sam Lai
You need to serialize those variables and deliver them to the client to store as a cookie. That way, when a call to draw_graph is made, it will receive the cookie as part of the request, and you can get the parameters. If there is too much data, you should write those variables to the database, an

Re: Newbie Question about django-admin.py startproject

2010-06-22 Thread Sam Lai
'import django' is a command for the Python interpreter. 'django-admin.py startproject testsite' is a standard shell command. Just open up a console window, and type the latter into it. If it doesn't work, it means your PATH variable doesn't contain the Django sources. On 23 June 2010 15:27, Jac

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 20:16, Kenneth Gonsalves wrote: > On Monday 21 June 2010 15:37:50 Sam Lai wrote: >> >> You do bring up a interesting point though, and I don't know much >> >> about the architecture of Apache and how holes are exploited when they >> >&

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 19:47, Kenneth Gonsalves wrote: > On Monday 21 June 2010 13:39:42 Sam Lai wrote: >> > should be forbidden - one does not want apache to have direct access to >> > the database >> >> Storing a password in plaintext file makes me uneasy, even though

Re: PostgreSQL backend - Ident authentication failed?

2010-06-21 Thread Sam Lai
On 21 June 2010 17:04, Kenneth Gonsalves wrote: > On Monday 21 June 2010 12:24:58 Torsten Bronger wrote: >> > Also, is this recommended practice, to use "www-data" as the >> > backend database username? >> >> No, not recommended, but not forbidden either. >> > > should be forbidden - one does not

Re: A Django project life cycle

2010-06-20 Thread Sam Lai
If you want to run a piece of code on receiving a view HTTP request, and a piece of code just before the response is sent to the user, look into Django middleware (http://docs.djangoproject.com/en/dev/topics/http/middleware/). That is what it is specifically designed to do. If instead you want to

Re: A Django project life cycle

2010-06-20 Thread Sam Lai
I can't really help you because I don't know the internal life cycle either. I'd just start with reading through the code, which isn't really that hard (and it is what I've been doing for my custom admin form behaviour). If you have specific questions, you could post it here (or if it looks like y

Re: A Django project life cycle

2010-06-20 Thread Sam Lai
The onion model on the Django middleware documentation page might also help - http://docs.djangoproject.com/en/dev/topics/http/middleware/ The rest of it (how it is handled from the WSGI handler etc.) is really an internal matter. Unless you want to contribute to Django or create some custom vers

Re: Error I continue to get

2010-06-19 Thread Sam Lai
3:40 pm, Kenneth Gonsalves wrote: >> On Friday 11 June 2010 12:05:50 Sam Lai wrote: >> >> > Thaterrormessage looks like Windows to me. try adding the word >> > python at the start of that command. >> >> yes, it did not look like a linuxerrormessage - alth

  1   2   >