overlay esri shapefiles from database in googlemap

2014-01-26 Thread jenelyn refamonte
hello everyone,. i am developing dynamic web mapping application using 
geodjango framework.. i already displayed a googlemap as my basemap. It is 
for public users not in the admin interface,.. now, i want to 
display/overlay my esri shapefiles stored in my postgis databsase to the 
googlemap.. Its very hard for me. its my first time.. please help me.. is 
there any tutorial or article that i can base of,.? im stucked here for 
almost 3 weeks., please please please help.. thanks in advance :)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e2aea8ea-5079-4212-b927-141630d0e97c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Problems Setting Up wsgi and Apache

2014-01-26 Thread Fred Stluka

Mark,

I'm doing this fine with Django 1.4.2 and Python 2.7.3.

My wsgi.py file looks like:


import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()



My Apache config looks like:



# WSGI setup, for use by Django and other Python webapps
# See notes in:
#  - http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
#  - http://code.google.com/p/modwsgi/wiki/ConfigurationIssues
#  - https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi
# --Fred 11/22/2012
WSGIPythonHome /var/python27/virtualenvs/hhl

Order allow,deny
Allow from all

WSGIDaemonProcess wsgi_apps processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup  wsgi_apps
WSGIScriptAlias   /mypythonapp "/var/www/wsgi-bin/mypythonapp.wsgi"
WSGISocketPrefix  run/wsgi

#
# hhlweb Django app
#

Order deny,allow
Allow from all

WSGIDaemonProcess hhlweb processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup  hhlweb
# Note: Support both aliases for backward compatibility with release 1.
WSGIScriptAlias /hhlweb /var/www/django/hhlweb/apache/django.wsgi
WSGIScriptAlias /   /var/www/django/hhlweb/apache/django.wsgi

# Map the Django STATIC_URL to the Django STATIC_ROOT

Order deny,allow
Allow from all

Alias /static/ /var/www/django/hhlweb/collected_static/

# Map the Django MEDIA_URL to the Django MEDIA_ROOT

Order deny,allow
Allow from all

Alias /media/ /var/www/django/hhlweb/media/



Hope this helps!
--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.


On 1/26/14 5:15 PM, Mark Phillips wrote:
I have my first django app running using runserver. I am now trying to 
get Apache to serve my site. I have read the django docs and quite a 
few other references on the Internet, but I cannot get Apache to do 
anything with my django site. And no error message.


I am running django 1.6 in a virtual environment with Python 2.7 on 
Debian Linux inside my LAN.


Configuration file for apache
/etc/apache2/sites-enabled/mom.conf:

ServerName beagle
ServerAlias beagle
ServerAdmin mark@beagle
DocumentRoot /var/www/mom

WSGIScriptAlias /mom 
/home/django/django_projects/inventory/inventory_project/wsgi.py



Order deny,allow
Allow from all


ErrorLog ${APACHE_LOG_DIR}/mom/error.log
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/mom/access.log combined


/home/django/django_projects/inventory/inventory_project/wsgi.py
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", 
"inventory_project.settings.dev")


from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

The project layout:
/home/django/django_projects/
└── inventory
├── fabfile2.py
├── fabfile.py
├── inventory
│   ├── admin.py
│   ├── admin.py~
│   ├── admin.pyc
│   ├── forms.py
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── migrations
│   ├── models.py
│   ├── models.py~
│   ├── models.pyc
│   ├── templates
│   ├── templatetags
│   ├── tests.py
│   ├── urls.py
│   ├── urls.py~
│   ├── urls.pyc
│   ├── views.py
│   ├── views.py~
│   └── views.pyc
├── inventory_project
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── media
│   ├── settings
│   ├── settings.py
│   ├── settings.py~
│   ├── settings.pyc
│   ├── settings.py.old
│   ├── static
│   ├── urls.py
│   ├── urls.py~
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
├── manage.py
├── mom
├── Notes.txt
├── README
└── requirements.txt

/etc/apache2/mods-enabled/wsgi.conf
 WSGIPythonPath 
/home/django/django_projects/inventory:/home/django/.virtualenvs/inventory_project/lib/

python2.7/site-packages/

Any ideas on why I only get "Ooops cannot connect to beagle:7000/mom"?

Thanks,

Mark
--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2O1ZfrsbywQWW9XSK5iEkybkMd4B%2B9Rxdi0bQC_Zzc%2BNA%40mail.gmail.com.

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 em

Re: johnny.backends.memcached.MemcachedCache': 'module' object has no attribute 'CacheClass' ?????

2014-01-26 Thread Oak McIlwain
Did you end up solving this issue?

On Sunday, November 10, 2013 2:53:26 AM UTC+8, vittorio wrote:
>
> In my settings.py I have the following code: 
> . 
> CACHES = { 
> 'default': { 
> 'BACKEND': 'johnny.backends.memcached.MemcachedCache', 
> #'BACKEND': 'johnny.backends.memcached.CacheClass', 
> 'LOCATION': ['127.0.0.1:11212'], 
> 'JOHNNY_CACHE': True, 
> } 
> } 
>
> JOHNNY_MIDDLEWARE_KEY_PREFIX='vic_' 
>
> MIDDLEWARE_CLASSES = ( 
> 'johnny.middleware.LocalStoreClearMiddleware', 
> 'johnny.middleware.QueryCacheMiddleware', 
> . 
>
> Which worked like a charm till django 1.5.5. 
>
> Now, after installing  the new django 1.6 when I launch  'python manage.py 
> runserver' the following fatal error is signalled: 
>
>
> File 
> "/Library/Python/2.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py",
>  
> line 6, in  
> from django.contrib.staticfiles.handlers import StaticFilesHandler 
>   File 
> "/Library/Python/2.7/site-packages/django/contrib/staticfiles/handlers.py", 
> line 8, in  
> from django.contrib.staticfiles.views import serve 
>   File 
> "/Library/Python/2.7/site-packages/django/contrib/staticfiles/views.py", 
> line 15, in  
> from django.contrib.staticfiles import finders 
>   File 
> "/Library/Python/2.7/site-packages/django/contrib/staticfiles/finders.py", 
> line 12, in  
> from django.contrib.staticfiles.storage import AppStaticStorage 
>   File 
> "/Library/Python/2.7/site-packages/django/contrib/staticfiles/storage.py", 
> line 8, in  
> from django.core.cache import (get_cache, InvalidCacheBackendError, 
>   File "/Library/Python/2.7/site-packages/django/core/cache/__init__.py", 
> line 138, in  
> cache = get_cache(DEFAULT_CACHE_ALIAS) 
>   File "/Library/Python/2.7/site-packages/django/core/cache/__init__.py", 
> line 130, in get_cache 
> "Could not find backend '%s': %s" % (backend, e)) 
> django.core.cache.backends.base.InvalidCacheBackendError: Could not find 
> backend 'johnny.backends.memcached.MemcachedCache': 'module' object has no 
> attribute 'CacheClass' 
>
> Surfing the netI found a workaround  for this error that applied to django 
> 1.4 butturned out to be useless with 1.6. 
> Please help 
> Vittorio 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/663368a5-005a-4a58-a582-6d46afc75d41%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Prefetch object (django 1.7)

2014-01-26 Thread Marcin Szamotulski
Hello,

I have a model 

class Post(models.Model):

...
authors = models.ManyToManyField('accounts.User', through='PostAuthor', 
related_name='authors_posts')


class PostAuthor(models.Model):

user = models.ForeignKey('accounts.User')
post = models.ForeignKey(Post)
...


How can I use the Django 1.7 Prefetch object to load PostAuthors,  this
does not work:

Post.objects.prefetch_related(
Prefetch(
'authors',
queryset=PostAuthors.object.select_related('user')
)

I got an exception:
django.core.exceptions.FieldError: Cannot resolve keyword 'authors_posts' into 
field. Choices are: created, id, post, post_id,
user, user_id

Thanks for help,
Marcin Szamotulski

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140127014254.GB10613%40flying-circus.
For more options, visit https://groups.google.com/groups/opt_out.


Problems Setting Up wsgi and Apache

2014-01-26 Thread Mark Phillips
I have my first django app running using runserver. I am now trying to
get Apache to serve my site. I have read the django docs and quite a few
other references on the Internet, but I cannot get Apache to do anything
with my django site. And no error message.

I am running django 1.6 in a virtual environment with Python 2.7 on Debian
Linux inside my LAN.

Configuration file for apache
/etc/apache2/sites-enabled/mom.conf:

ServerName beagle
ServerAlias beagle
ServerAdmin mark@beagle

DocumentRoot /var/www/mom

WSGIScriptAlias /mom
/home/django/django_projects/inventory/inventory_project/wsgi.py


Order deny,allow
Allow from all


ErrorLog ${APACHE_LOG_DIR}/mom/error.log
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/mom/access.log combined


/home/django/django_projects/inventory/inventory_project/wsgi.py
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"inventory_project.settings.dev")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

The project layout:
/home/django/django_projects/
└── inventory
├── fabfile2.py
├── fabfile.py
├── inventory
│   ├── admin.py
│   ├── admin.py~
│   ├── admin.pyc
│   ├── forms.py
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── migrations
│   ├── models.py
│   ├── models.py~
│   ├── models.pyc
│   ├── templates
│   ├── templatetags
│   ├── tests.py
│   ├── urls.py
│   ├── urls.py~
│   ├── urls.pyc
│   ├── views.py
│   ├── views.py~
│   └── views.pyc
├── inventory_project
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── media
│   ├── settings
│   ├── settings.py
│   ├── settings.py~
│   ├── settings.pyc
│   ├── settings.py.old
│   ├── static
│   ├── urls.py
│   ├── urls.py~
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
├── manage.py
├── mom
├── Notes.txt
├── README
└── requirements.txt

/etc/apache2/mods-enabled/wsgi.conf
 WSGIPythonPath
/home/django/django_projects/inventory:/home/django/.virtualenvs/inventory_project/lib/
python2.7/site-packages/

Any ideas on why I only get "Ooops cannot connect to beagle:7000/mom"?

Thanks,

Mark

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2O1ZfrsbywQWW9XSK5iEkybkMd4B%2B9Rxdi0bQC_Zzc%2BNA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Error related to googlebot?

2014-01-26 Thread Stefano Probst
Hi,
have you try it with "open a Page like Google" ( 
https://support.google.com/webmasters/answer/158587 )?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75168192-6ed8-4b9d-a185-3d6447a840ce%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


AttributeError:'TaggableManager' object has no attribute 'primary_key'

2014-01-26 Thread vinoth kumar renganathan
Hello everyone. i just added "tags = TaggableManager" in my models.py file. 
So when i initiated to run python manage.py schemamigration myapp --initialit 
shows below error. I search a lot to solve this but can't. can anyone 
please help me out of this problem.

File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 399, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 285, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/management/commands/schemamigration.py",
 
line 151, in handle
for action_name, params in change_source.get_changes():
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/creator/changes.py",
 
line 460, in get_changes
model_defs = freeze_apps([self.migrations.app_label()])
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/creator/freezer.py",
 
line 32, in freeze_apps
frozen_models.update(model_dependencies(model))
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/creator/freezer.py",
 
line 96, in model_dependencies
depends.update(field_dependencies(field, checked_models))
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/creator/freezer.py",
 
line 132, in field_dependencies
value = get_attribute(field, attrname)
  File 
"/usr/local/lib/python2.7/dist-packages/South-0.8.1-py2.7.egg/south/utils/__init__.py",
 
line 38, in get_attribute
value = getattr(value, part)
AttributeError: 'TaggableManager' object has no attribute 'primary_key'

And in south migration tutorials when adding taggit we should add below 
lines.


from south.modelsinspector import 
add_ignored_fieldsadd_ignored_fields(["^taggit\.managers"])

i added those lines. But the same error coming again. 



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b232c97c-073d-4ed5-b9a1-11636d79ba3b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Writing your first Django app, part 2 - Customize the admin look and feel

2014-01-26 Thread Ankur Mishra
Hi Tim,

If you are using TEMPLATE_DIRS = [os.path.join(BASE_DIR, ’templates’)], 
template 
directory should be under mysite (same level as manage.py). 

Of course you can choose a different path. If you look into settings.py you 
will be able to figure out that BASE_DIR is the topmost level of the 
project.

Hope it helps,

Cheers,
Ankur
On Thursday, January 16, 2014 9:44:02 AM UTC+5:30, Tim DiSabatino wrote:
>
> Manu,
>
> This is the directory structure I have.  I have pretty much tried it in 
> all levels of the hierarchy with no success.  In the tutorial for Django 
> v1.5, it had you name a specific location in the filesystem where the 
> base_site.html was located.  In the new 1.6.1 tutorial, there is no mention 
> of location and it seems to imply that Django will search the directory 
> hierarchy to find the file in question.
>
> Open your settings file (mysite/settings.py, remember) and add a 
> TEMPLATE_DIRS setting: 
>
> TEMPLATE_DIRS = [os.path.join(BASE_DIR, ’templates’)] 
>
> TEMPLATE_DIRS is an *iterable of filesystem directories to check when 
> loading Django templates; it’s a search path.*
>
> Anyway, here's my directory structure...many thanks for your help.
>
> mysite
>db.sqllite3
>manage.py
>mysite (directory)
>   __init__.py
>   db.sqlite3
>   settings.py
>   urls.py
>   wsgi.py
>polls (directory)
>   __init__.py
>   admin.py
>   models.py
>   tests.py
>   views.py
>   templates (directory)
>   admin (directory)
>   base_site.html // This is the file in question not being 
> read to alter the admin
>   // header names.
>
>
>
> On Wednesday, January 15, 2014 10:28:38 AM UTC-8, Manu wrote:
>>
>> Can you post your directory structure here? The problem should be there, 
>> most probably.
>>
>> On Wednesday, 15 January 2014 11:37:51 UTC+5:30, Tim DiSabatino wrote:
>>>
>>> Hello,
>>>
>>> I am just going through the Django Tutorial and am in Writing your first 
>>> Django app, part 2.  In the section called "Customize the admin look and 
>>> feel", I have created a templates directory, an admin directory inside of 
>>> that, and copied the base_site.html file into the admin directory.  I have 
>>> also added the line below to the settings.py file as instructed:
>>>
>>> TEMPLATE_DIRS = [os.path.join(BASE_DIR,'templates')]
>>>
>>> However, when I change the  in the base_site.html file, nothing 
>>> happens.  I have tried moving the templates directory around several times 
>>> and still no change the admin  text.  It appears that others have had 
>>> problems with this part of the tutorial in the past for previous versions 
>>> of Django but the solutions I have tried don't seem to work with Django v 
>>> 1.6.1.  This part of the tutorial has changed even since Django 1.5.  Can 
>>> anyone help and tell me what I'm doing incorrectly?  Is is some kind of 
>>> absolute/relative path issue?  Thanks so much for your help.
>>>
>>> -Tim
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1fa297d-4109-4f4d-8cd5-f27e5e61cecd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Problems Adding Django South Tool

2014-01-26 Thread Brandon Foster
(note: I can type *./manage.py* instead of *python* *manage.py* because I 
changed the mode for the *manage.py* file by doing *chmod +x manage.py* to 
make it executable. Also, I didn't type the dollar sign $, that only 
indicates the command prompt)

For me, I realized I had typed the following (notice the trailing slash) 
which did NOT work:

$* ./manage.py migrate southtut/*

 After I entered the command without the trailing slash, it DID work:

$* ./manage.py migrate southtut*

So, it seems like all the steps to take are the following:

1) install south (for example, *pip install south *or whatever installation 
method you prefer 
http://south.readthedocs.org/en/latest/installation.html
)
2) add south to the INSTALLED_APPS tuple in *settings.py*
3) run $ *./manage.py syncdb*
4) create the southtut app by running $ *./manage.py startapp southtut*
5) run $* ./manage.py schemamigration southtut --initial*
6) run $* ./manage.py migrate southtut*


On Tuesday, April 23, 2013 9:09:46 PM UTC-4, Ashley Snelgrove wrote:
>
> I'm guessing that southtut also needed to be added to the list of 
> INSTALLED_APPS. 
>
> On Thursday, August 23, 2012 8:57:58 AM UTC-6, Fyodor Wolf wrote:
>>
>> What was your Solution???
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/675765bc-65fd-43d0-8573-795e313e471a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.