Re: TEMPLATE_CONTEXT_PROCESSORS missing in settings.py

2013-06-21 Thread Addy Yeow
TEMPLATE_CONTEXT_PROCESSORS is not there by default in your project's
settings.py. It's defined in the django/conf/global_settings.py, see
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATE_CONTEXT_PROCESSORSfor
the default callables that are included.


On Sat, Jun 22, 2013 at 11:08 AM,  wrote:

> Hey everyone,
>
> Currently a noob to Django--I'm using Django 1.5.1 installed with Python
> 2.7 in a virtualenv. I'm learning about context processors and noticed that
> TEMPLATE_CONTEXT_PROCESSORS is completely missing from my settings.py. Is
> this normal? Am I supposed to add Django's default template context
> processors or are they supposed to be there in the first place? Here's what
> my settings.py looks like:
>
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME':
> '/media/UD/Virtual_Environments/kolasite/mysite/sqlite.db',
> # Or path to database file if using sqlite3.
> # The following settings are not used with sqlite3:
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': '',  # Empty for localhost through
> domain sockets or '127.0.0.1' for localhost through TCP.
> 'PORT': '',  # Set to empty string for default.
> }
> }
>
> # Hosts/domain names that are valid for this site; required if DEBUG is
> False
> # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> ALLOWED_HOSTS = []
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'America/Chicago'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded
> files.
> # Example: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/";, "http://media.example.com/";
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/var/www/example.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://example.com/static/";, "http://static.example.com/";
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '8c(j)m3dm!m3gd_n#vjjfqdeuq!ltsj3+xii617dos1i@_pc7*'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'mysite.urls'
>
> # Python dotted path to the WSGI application used by Django's runserver.
> WSGI_APPLICATION = 'mysite.wsgi.application'
>
> TEMPLATE_DIRS = (
> # Put strings here, like "/home/html/django_templates" or
> "C:/www/django/templates

Re: settings.py "DEBUG = False" doesn't work why?

2013-06-12 Thread Addy Yeow
Try,

ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
]

https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts


On Wed, Jun 12, 2013 at 8:03 PM, Pepsodent Cola wrote:

> Hi I have basically followed each step in Django's tutorial from part 1 to
> part 6.  What confuses me is when I disable DEBUG in settings.py file then
> no web url works at all anymore.  But the admin and public view pages works
> when DEBUG is enabled.
> https://docs.djangoproject.com/en/1.5/intro/
>
> Can somebody help me back trace what I have done wrong?  There are so many
> files and settings in Django I don't really know where to start
> troubleshooting.
> The only clue I have is this when looking at the web browser.
>
> Something went wrong. (500 server error)
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How do I stopt this bot 66.249.73.7

2013-05-25 Thread Addy Yeow
That's Googlebot crawling your site: http://dazzlepod.com/ip/66.249.73.7/
Instead of stopping it, you probably want to throttle down the crawler
using Google Webmaster Tools.


On Sat, May 25, 2013 at 9:30 PM, frocco  wrote:

> Should I stop this bot at 66.249.73.7
>
> It is causing my search log to fill up quickly.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: quick problem with str and int

2013-04-29 Thread Addy Yeow
You would want to match this, (?P.*),  against a string not
integer.


On Mon, Apr 29, 2013 at 11:40 PM, MikeKJ  wrote:

> So unfortunately due to historical reason a numerical reference is set as
> a CharField in the model now I want to pass that reference through a url to
> json serialise something so
>
> 
> but I still get
>
> Exception Type: TypeError at /json/810044/
> Exception Value: 'str' object is not callable
>
> the url line is
>
> (r'^json/(?P.*)/$', '/views/json'),
>
> I am not entirely sure where it is complaining about str being uncallable
> but having cast it to int in the a href in the template  surely it should
> have resolved?  Any clues please?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to switch languages?

2013-04-22 Thread Addy Yeow
There are several ways to switch language (
https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference).
I normally set django_language session variable to the preferred language.
For 1), have you compiled your messages into .mo files? You will also need
to reload your server to load the new .mo files.


On Tue, Apr 23, 2013 at 1:24 AM, Cody Scott wrote:

> I am trying to get translations to work on my site.
>
> I have marked words for translation and they show up in the django.po file.
>
> I am wondering what is the proper way to switch the current language.
>
> Currently I have the following in my project urls.py
>
> urlpatterns = i18n_patterns('',
> # etc
> )
>
> urlpatterns += patterns('',
> (r'^i18n/', include('django.conf.urls.i18n')),
> )
>
> And to switch languages I change the /en/ in my url to /ja/ or /fr/.
>
> I have two issues.
>
> 1) The page is not being translated except for 'Yes' and 'No' which are
> translated even if I remove them from my .po file. So there must be a
> default set of translation words? Or Chrome is seeing the /fr/ in the URL
> and translating it for me? I can't explain why that is happening. Even if I
> change what 'Yes' and 'No' translate to it doesn't change what is displayed.
>
> 2) The next page I visit reverts to a English with the /en/. Yes english
> is my default language in settings.py.
>
> #settings.py
> #Used for translations
> gettext = lambda s: s
> LANGUAGES = (
> ('en', gettext('English')),
> ('fr', gettext('French')),
> ('ja', gettext('Japanese')),
> )
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Moving a Django website to another server

2013-01-25 Thread Addy Yeow
I was looking for a consistent and error-free deployment as I switch
between servers frequently despite using the same public domain. rsync
was great but I had to manually reload server thereafter or issue a
syncdb, etc.

I have since moved to Fabric for my deployment needs. See
http://docs.fabfile.org/en/1.5/tutorial.html.
With Fabric, I only need to issue one command for daily deployment to
existing or new server, e.g. fab deploy, under my Django project
directory to deploy the project.

On Sat, Jan 26, 2013 at 9:04 AM, Adrián Espinosa
 wrote:
> If both hosts are Linux, you can use "rsync -avuzr source destination".
> Option -z enables compression
>
> On Friday, January 25, 2013 11:20:49 AM UTC+1, John Robertson wrote:
>>
>> Hi there, if I want to move a Django website to another host, is it as
>> simple as copying across all the site files and DB (and changing config
>> files)? If so, is there some kind of tool to create a zipped folder of the
>> website so that FTP does not take several hours! Sorry if this seems a very
>> basic question, but I just wanted to check before I proceed with it. They
>> are fairly simple, small sites, but still there are thousands of files.
>>
>> Many thanks!
>> John
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_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 
django-users+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Insane sql logging

2013-01-15 Thread Addy Yeow
Why not do this at database level?
e.g. using http://dev.mysql.com/doc/refman/5.1/en/query-log.html

On Tue, Jan 15, 2013 at 9:35 PM, Matteo Suppo  wrote:
> Sometimes people ask for strange features, like "I want to log every
> database query except select".
>
> There will be drawbacks, of course: it will be slower, for example, but they
> won't care.
>
> It happened to us, and we had to ship this insanity:
>
> import logging
> from logging.handlers import RotatingFileHandler
> from django.db.backends import BaseDatabaseWrapper
> from django.db.models.signals import pre_save, post_save, pre_delete,
> post_delete
> from django.dispatch import receiver
>
> from datetime import datetime
>
> from django.conf import settings
>
> def patch_cursor(self):
> """ Monkey Patch BaseDatabaseWrapper to always use the debug cursor """
> self.validate_thread_sharing()
>
> return self.make_debug_cursor(self._cursor())
> BaseDatabaseWrapper.cursor = patch_cursor
>
> @receiver(pre_delete)
> @receiver(pre_save)
> def member_pre_save(sender, **kwargs):
> l = logging.getLogger('django.db.backends')
> l.setLevel(logging.DEBUG)
> if len(l.handlers) <= 0:
> handler = RotatingFileHandler(settings.BACKUP_FILENAME,
>   maxBytes=settings.BACKUP_MAXBYTES)
> l.addHandler(handler)
> l.debug(datetime.now())
>
> @receiver(post_delete)
> @receiver(post_save)
> def member_post_save(sender, **kwargs):
> l = logging.getLogger('django.db.backends')
> l.removeHandler(l.handlers[0])
>
> Of course now they told us they want to log the IP of the machine who
> triggered the query, so we'll have to use a different approach. Sigh.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/voMGlGJ3UqgJ.
> 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.

-- 
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: Changing password on code.djangoproject.com?

2013-01-04 Thread Addy Yeow
https://www.djangoproject.com/accounts/password/change/

On Fri, Jan 4, 2013 at 6:03 PM, Brandon Carl  wrote:
> I can't for the life of me figure out how to change the password for my Trac
> account on code.djangoproject.com.  Could somebody please point me in the
> right direction?
>
> Thanks!
>
> -Brandon
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/45_p1k-S1gUJ.
> 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.

-- 
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: Apache + mod_wsgi

2013-01-04 Thread Addy Yeow
You may want to define WSGIDaemonProcess inside your VirtualHost, see
http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIDaemonProcess.html

On Fri, Jan 4, 2013 at 9:36 PM, Tsolmon Narantsogt  wrote:
> Hello Comrades.
> I have a problem when deploying django project.  I installed apache and
> mod_wsgi module and django.
> And i create virtual host in /etc/apache2/sites-available/mysite
>
> content:
> 
> ServerName name
> ServerAdmin m...@email.com
> DocumentRoot /var/www/mydjangoproject/
> 
> Order allow,deny
> Allow from all
> 
> WSGIScriptAlias / /var/www/mydjangoproject/mydjangoproject/app.wsgi
> 
> mydjangoproject - it's my root package name
>
> and my app.wsgi
>
> import os, sys
>
> sys.path.append('/var/www')
> sys.path.append('/var/www/mydjangoproject')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoproject.settings'  # this is
> your settings.py file
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> But i got following error (apache log)
>
> ImportError: Could not import settings 'mydjangoproject.settings' (Is it on
> sys.path?): No module named settings
>
> Pls send me solution. It's my first time :-)
>
> Regards.
>
> --
> 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.

-- 
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-mongodb-cache

2012-03-10 Thread Addy Yeow
Anyone managed to use django-mongodb-cache with Django >= 1.3.1?
http://pypi.python.org/pypi/django-mongodb-cache

It appears to have been abandoned since May/2010. Maybe there's a better
alternative?

-- 
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.



Raspberry Pi Live

2012-02-26 Thread Addy Yeow
Hey folks,

Just sharing a Django-powered page to get live status off raspberrypi.org:
http://dazzlepod.com/raspberrypi/

Raspberry Pi is an ARM GNU/Linux box for $25 (model A) / $35 (model B).
It is expected to be available for order in the next couple of days
but the first batch will only see release of 10,000 units.

Anyone looking forward to create first Django-powered site off the Raspi?

Cheers,
Addy

-- 
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: Django Location- Does anyone know about this?

2012-02-16 Thread Addy Yeow
Not exactly a Django package but it's implemented in Django and uses
MaxMind geoip database:
http://dazzlepod.com/ip/
You could use the API for free, e.g. http://dazzlepod.com/ip/8.8.8.8.json

On Thu, Feb 16, 2012 at 10:03 PM, Derek  wrote:

> http://geodjango.org/ ?
>
> On Feb 15, 6:18 pm, coded kid  wrote:
> > Hi Guys, Does anyone knows about any good django package for maps? or
> > for locating of areas, states, streets? Please kindly answer if you
> > do. Thanks.
> >
> > BTW: I've tried using Django easy_maps but it's not working. If you've
> > used easy_maps before, kindly comment below. Just want to ask you a
> > few questions.
>
> --
> 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.
>
>

-- 
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.



Automatically block requests from bad IP addresses

2012-02-11 Thread Addy Yeow
I was looking for a Django solution to automatically block requests from
bad IP addresses to some of my apps.

After searching for a while without much luck, I attempted to write a
simple Python script that:
- parses my Apache access log
- block IP that made too many requests within a set interval

I have made the script with the associated Django app available on Github
for those who may find it useful:
https://github.com/ayeowch/banshee

-- 
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: Django app for IP address lookup

2011-12-31 Thread Addy Yeow
Here you go:
http://dazzlepod.com/ip/8.8.8.8.json

On Sat, Dec 31, 2011 at 10:14 PM, Timothy Makobu <
makobu.mwambir...@gmail.com> wrote:

> Thanks.
>
> Do you have an API for it yet? so we can do something like
> http://dazzlepod.com/ip/api/json/1x7.x37.8.xx and get the data in JSON?
>
>
> On Sat, Dec 31, 2011 at 4:09 PM, yati sagade wrote:
>
>> Nice app :) can you share the sources? And happy new year to you, too!
>>
>>
>> On Sat, Dec 31, 2011 at 5:20 PM, Addy Yeow  wrote:
>>
>>> Hi guys,
>>>
>>> Just sharing a simple Django app that allows you to do IP address lookup:
>>> http://dazzlepod.com/ip/
>>>
>>> Happy new year!
>>>
>>> --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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 app for IP address lookup

2011-12-31 Thread Addy Yeow
Hi guys,

Just sharing a simple Django app that allows you to do IP address lookup:
http://dazzlepod.com/ip/

Happy new year!

-- 
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.



Cache timeout

2011-11-26 Thread Addy Yeow
If I use cache_page() decorator for my view function, will the TIMEOUT be
able to take precedence over CACHE_MIDDLEWARE_SECONDS?

In my settings.py,

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': os.path.join(WEB_ROOT, "django_cache"),
'TIMEOUT': 5184000,
}
}
CACHE_MIDDLEWARE_SECONDS = 86400

-- 
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-based RedirectAnywhere

2011-06-24 Thread Addy Yeow
RedirectAnywhere http://dazzlepod.com/redirect_anywhere/ is a small Django
app that allows you to share blocked links, e.g. ThePirateBay links, on
Facebook or on sites that are blocking them.

Source code available http://djangosnippets.org/snippets/2470/

-- 
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: Want to give a talk at Djangocon, the time to submit is now

2011-06-22 Thread Addy Yeow
Any plan to host Djangcon in Asia?

On Thu, Jun 23, 2011 at 12:08 AM, Sean O'Connor wrote:

> Hey Everybody,
>
> I know we're a bit late this year but the new Djangocon.US site is finally
> up and we are accepting talk proposals today.
>
> Unfortunately, thanks to our lateness we will only be able to accept
> proposals for the next* *two weeks.  This means if you want to have a
> chance to speak at this year's Djangocon, you need to get your proposal in
> ASAP.
>
> You can read more about submitting a proposal at
> http://djangocon.us/blog/2011/06/22/call-papers/ and feel free to contact
> me directly if you have any questions or concerns.
>
> -Sean O'Connor
> s...@seanoc.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/5cZtk6GOBNIJ.
> 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.
>



-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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.



SEND_BROKEN_LINK_EMAILS = True not sending email

2011-05-30 Thread Addy Yeow
Is SEND_BROKEN_LINK_EMAILS = True working for you guys?

I am using Django 1.2.5. I have view function that raise Http404 when object
is not found but I am not receiving the email
despite SEND_BROKEN_LINK_EMAILS = True in my settings.py. I do receive email
for HTTP500 though.

-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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: sitemaps not quite as easy to setup as suggested?

2011-05-27 Thread Addy Yeow
I keep sitemap for those objects in 1 sitemap file, and manually create
another sitemap file for all my static pages.
Then, create a sitemap index to point to the two.

Would love to hear from others though.

On Fri, May 27, 2011 at 11:22 PM, i...@webbricks.co.uk  wrote:

> ok, read the docs properly and understood it a bit more. im stuck with
> one thing though. i get how simple it is to tell the sitemap about all
> the objects that have been created but what about the static pages,
> where you've not used flatpages. for instance a contact form you've
> created, this should be in the sitemap, but isnt a flatpage.
>
> how do i go about adding them to the dict in the urls file?
>
> --
> 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.
>
>


-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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: 500.html and STATIC_URL

2011-05-25 Thread Addy Yeow
http://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view

On Wed, May 25, 2011 at 11:22 PM, bax...@gretschpages.com <
mail.bax...@gmail.com> wrote:

> Am I correct in understanding that when there is a 500 error and the
> user is routed to 500.html, it does not know settings.STATIC_URL or
> settings.MEDIA_URL, but 404.html does?
>
> --
> 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.
>
>


-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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: Read write config from a file. How?

2011-04-02 Thread Addy Yeow
Take a look at http://docs.python.org/library/configparser.html

On Sun, Apr 3, 2011 at 4:45 AM, Swordfish  wrote:
> Hi! is your file in 'ini' format or simply in 'py'?
>
> Regards,
> Eugeny
>
> 02.04.11, 10:34, "hollando" :
>
>> Hi, some of my config store in a file not in settings.py. Are there
>>  any build in library doing that? Thanks
>>
>>
>
> --
> 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.
>
>



-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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: Read write config from a file. How?

2011-04-01 Thread Addy Yeow
Have you tried http://docs.python.org/library/configparser.html?

On Sat, Apr 2, 2011 at 2:34 PM, hollando  wrote:
> Hi, some of my config store in a file not in settings.py. Are there
> any build in library doing that? Thanks
>
> --
> 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.
>
>



-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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: What apps or snippets to use for Facebook and Twitter registration, login and posting?

2011-03-03 Thread Addy Yeow
For Twitter, https://github.com/joshthecoder/tweepy does the trick for me.

On Thu, Mar 3, 2011 at 9:51 PM, guyf  wrote:
>
>
> On Mar 2, 4:28 pm, Rodrigo Cea  wrote:
>> I am developing a site that I want to link with Facebook and Twitter.
>>
>> So as to not reinvent the wheel, I'm looking for apps or snippets that can
>> help with this, specifically:
>>
>> 1) allow users to register and login with their Facebook and/or Twitter
>> accounts.
>>
>> 2) Have these accounts be linked to the local one (crossposting to their FB
>> and Twitter account, pulling in their posts on FB and TW, etc.)
>>
>> Thanks,
>>
>> Rodrigo
>
> Hi Roderigo,
>
> I have recently done this for facebook and used
> http://code.google.com/p/django-facebookconnect/. I started with
> django-socialauth but as a newcomer to django and python I got myself
> in a tangle so unwound it and went for the simpler facebookconnect
> options. Downside is it is only facebook.
>
> Guy.
>
> --
> 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.
>
>

-- 
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: remember me in login

2010-11-26 Thread Addy Yeow
i use this http://djangosnippets.org/snippets/1881/

On Sat, Nov 27, 2010 at 8:07 AM, robos85  wrote:

> Is there any easy way to do remember me trigger during login?
> I know that there is SESSION_COOKIE_AGE but it's set site-wide. Is
> there any possibility to set expiration at browser close or x time?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Why Django Admin Won't Display full graphics

2010-09-30 Thread Addy Yeow
runserver takes care of thing like this for you but you need to handle
it properly in Apache.
See 
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-the-admin-files

On Fri, Oct 1, 2010 at 12:03 AM, octopusgrabbus
 wrote:
>
> When I run Django admin with runserver running, I get nice graphics. I
> don't when I run Django admin from apache. I can log into my django
> application from apache, but do not get the graphics. I'm looking for
> examples or documentation on how to fix this.
>
> Thanks.
> cmn
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Trouble Starting Up with runserver

2009-05-10 Thread Addy Yeow
What does 'ping localhost' in command-prompt tells you?Did you try 'python
manage.py runserver 127.0.0.1:8000'? Or 'python manage.py runserver :8000'

- Addy

On Mon, May 11, 2009 at 12:40 PM, Chris DPS  wrote:

>
> So I've definitely shut off all Firewalls.
> It still is having the same problem.
>
> HELP!!! PLEASE
>
> On May 10, 6:37 pm, Chris DPS  wrote:
> > How to tell if I have a Firewall running?
> > I have turned off Windows firewall. When I go to the Windows Security
> > Center, the Firewall option is Green, as in 'on'.
> > I looked for normal firewall products on my computer such as Symantec
> > and couldn't find any active ones.
> >
> > How can find which firewall I'm using and shut it off.
> >
> > ---Chris DPS
> >
> > On May 8, 8:10 pm, Addy Yeow  wrote:
> >
> > > Do you have firewall running?It could be blocking incoming local
> connection
> > > to port 8000.
> >
> > > - Addy
> >
> > > On Sat, May 9, 2009 at 7:01 AM, Chris DPS 
> wrote:
> >
> > > > I am new to Django.
> >
> > > > When I try to execute: python manage.py runserver, I get the
> following
> > > > error
> >
> > > > Error: [Errno 10104] getaddrinfo failed
> >
> > > > What is going on and what should I do?
> >
> > > > I am running Django Version 1.0.2-final and Python 2.6
> >
>

--~--~-~--~~~---~--~~
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: List users that are currently logged in

2009-05-10 Thread Addy Yeow
:) I was about to ask the exact same question. A quick Google, I found
this

1. 

http://groups.google.com/group/django-users/browse_thread/thread/4ba5652bcbd1f958

and

2. 

http://groups.google.com/group/django-users/browse_thread/thread/6f5f759d3fd4318a/
- I like the idea of using custom middleware that updates last_accessed
attribute in this post.

- Addy

On Mon, May 11, 2009 at 1:37 AM, jd20878  wrote:

>
>
> I am trying to list all users that are currently logged in.  I am having
> trouble getting this right.   I have been playing around with sessions but
> am afraid that I'm running down the wrong path.  Any ideas?
> --
> View this message in context:
> http://www.nabble.com/List-users-that-are-currently-logged-in-tp23472237p23472237.html
> Sent from the django-users mailing list archive at Nabble.com.
>
>
> >
>

--~--~-~--~~~---~--~~
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: Hospedagem Django - review locaweb

2009-05-08 Thread Addy Yeow
Gostaria de recomendar webfaction sempre :)

- Addy

On Fri, May 8, 2009 at 11:35 PM, Fabrício  wrote:

>
> Olá pessoal! Fiz uma pesquisa e vi uns tópicos falando sobre
> hospedagem.
> No entanto queria saber a opinião de vocês sobre duas hospedagens:
>
> webfaction e locaweb, alguém hospeda nesses servidores ? recomenda ?
>
> Um grande abraço,
>
> >
>

--~--~-~--~~~---~--~~
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: Trouble Starting Up with runserver

2009-05-08 Thread Addy Yeow
Do you have firewall running?It could be blocking incoming local connection
to port 8000.

- Addy

On Sat, May 9, 2009 at 7:01 AM, Chris DPS  wrote:

>
> I am new to Django.
>
> When I try to execute: python manage.py runserver, I get the following
> error
>
> Error: [Errno 10104] getaddrinfo failed
>
> What is going on and what should I do?
>
> I am running Django Version 1.0.2-final and Python 2.6
> >
>

--~--~-~--~~~---~--~~
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: Hooking up Django signal to urls.py

2009-03-23 Thread Addy Yeow
Apache would have solved the problem for simple request but there are other
data that I wanted to store when the request is made, e.g. attribute data,
etc.

On Mon, Mar 23, 2009 at 6:44 PM, Russell Keith-Magee  wrote:

>
> On Mon, Mar 23, 2009 at 7:17 PM, Addy Yeow  wrote:
> > Hi guys,
> >
> > I like to track my visitors URL request in my application.
> ...
> > Any idea? Or I should not use signal for this purpose?
>
> You could probably get something like this to work, but I have to ask
> - Is there any reason that you're not just using the HTTP server's
> logs for this purpose? Apache (for example) provides extensive logging
> capabilities, and there are numerous tools available that can read,
> analyse and report on that logging format. Rather than trying to
> implement a whole logging framework basedon signals, why not use the
> tools that are already available and understood?
>
> Yours,
> Russ Magee %-)
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Hooking up Django signal to urls.py

2009-03-23 Thread Addy Yeow
Hi guys,

I like to track my visitors URL request in my application.
To achieve this, I am trying to trigger my signal's receiver function called
log_start when a browser request matches a URL pattern in my_app/urls.py.

=== my_proj/my_app/models.py ===

from django.core.signals import *
from my_proj.my_app import signals as custom_signals

request_started.connect(custom_signals.log_start)

=== my_proj/my_app/signals.py ===

def log_start(sender, **kwargs):
  print "log_start called"

I am thinking this could be achieved by providing the proper sender argument
which generally takes in Model argument.
request_started.connect(custom_signals.log_start, sender=??)

Any idea? Or I should not use signal for this purpose?

- Addy

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---