Commits

Mikhail Korobov  committed ec2a4df Merge

Merge pull request #1 from gipi/django1.4

Django1.4

  • Participants
  • Parent commits 7b15574, 76221ca

Comments (0)

Files changed (4)

File easy_maps/admin.py

 from django.contrib import admin
+from django import forms
+
+from .models import Address
+from .widgets import AddressWithMapWidget
 
 class AddressAdmin(admin.ModelAdmin):
     list_display = ['address', 'computed_address', 'latitude', 'longitude', 'geocode_error']
     list_filter = ['geocode_error']
     search_fields = ['address']
+    class form(forms.ModelForm):
+        class Meta:
+            widgets = {
+                'address': AddressWithMapWidget({'class': 'vTextField'})
+            }
+
+
+admin.site.register(Address, AddressAdmin)

File easy_maps_tests/.gitignore

+/static

File easy_maps_tests/settings.py

 sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, '..')))
 
 DEBUG = True
-DATABASE_ENGINE = 'sqlite3'
-DATABASE_NAME = 'db.sqlite'
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': 'db.sqlite',
+    }
+}
 ROOT_URLCONF = 'urls'
 TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, 'templates'),)
 
+
+STATIC_URL = '/static/'
+STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_ROOT, 'static'))
+
 INSTALLED_APPS=(
+    'django.contrib.contenttypes',
+    'django.contrib.messages',
+    'django.contrib.sessions',
+    'django.contrib.auth',
+    'django.contrib.admin',
+    'django.contrib.staticfiles',
     'easy_maps',
     'test_app',
 #    'devserver',
-    'south'
+    'south',
 )

File easy_maps_tests/urls.py

 from django.conf.urls.defaults import *
 from django.views.generic.simple import direct_to_template
+from django.contrib import admin
+
+admin.autodiscover()
 
 urlpatterns = patterns('',
-    url(r'^$', direct_to_template, {'template': 'index.html'}, 'index')
+    url(r'^$', direct_to_template, {'template': 'index.html'}, 'index'),
+    (r'^admin/', include(admin.site.urls)),
 )