Open soniok opened 6 years ago
Your problem is GDAL: https://stackoverflow.com/questions/37294127/python-gdal-2-1-installation-on-ubuntu-16-04 but even you if get it installed I'm not sure it will run on django 2. Let me now if it goes.
Hello Enricofer,
Thanks for your help. I succesfully installed GDAL, then installed Django-warp via pip with no errors. I'll be honest, I have never used Django/Python. I'm stuck trying to understand what I need to do with the setup process: Could you please explain what files I need to modify? How do I run the server?
Add django_warp to your INSTALLED_APPS
(Where is INSTALLED_APPS?)
Add url(r'^warp/', include('django_warp.urls')), to site urls.py
(Where is urls.py?)
./manage.py makemigrations django_warp and ./manage.py migrate to create db context
(where is ./ ?)
Run server and browse to [yourserver address]\warp\ and login with a valid site credentials
(What command to run server).
I suggest you the awesome tutorial from djangogirls: https://tutorial.djangogirls.org/en/django_installation/index.html (in many other languages too) Read it and then we will be able to talk about install
Thanks for the suggestion, I've just read it. I understand now your directions and I executed them with no errors. But there is an error when accessing 127.0.0.1:8000/warp/.
This time I setup and virtual environment, and installed Django version 1.9 (ended up being 1.9.13). I create a new site, added django_warp to INSTALLED_APPS, then added url(r'^warp/', include('django_warp.urls')) to site urls.py in /mysite/. then:
(warpenv) mapwarper@mapwarper-web:~/warp$ ./manage.py makemigrations django_warp No changes detected in app 'django_warp'
(warpenv) mapwarper@mapwarper-web:~/warp$ ./manage.py migrate Operations to perform: Apply all migrations: sites, django_warp, auth, sessions, admin, contenttypes, httpproxy Running migrations: Rendering model states... DONE Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying django_warp.0001_initial... OK Applying django_warp.0002_auto_20170727_0821... OK Applying django_warp.0003_datasets_vrt... OK Applying django_warp.0004_datasets_transparency... OK Applying httpproxy.0001_initial... OK Applying httpproxy.0002_auto_20160121_1940... OK Applying sessions.0001_initial... OK Applying sites.0001_initial... OK Applying sites.0002_alter_domain_unique... OK
(warpenv) mapwarper@mapwarper-web:~/warp$ python manage.py runserver Performing system checks...
System check identified no issues (0 silenced). February 14, 2018 - 18:07:20 Django version 1.9.13, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Not Found: / [14/Feb/2018 18:07:42] "GET / HTTP/1.1" 404 2009 Not Found: /favicon.ico [14/Feb/2018 18:07:43] "GET /favicon.ico HTTP/1.1" 404 2042 [14/Feb/2018 18:07:52] "GET /warp HTTP/1.1" 301 0 [14/Feb/2018 18:07:52] "GET /warp/ HTTP/1.1" 302 0 Internal Server Error: /warp/login/ Traceback (most recent call last): File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/sites/models.py", line 44, in _get_site_by_request SITE_CACHE[host] = self.get(domain__iexact=host) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/manager.py", line 122, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/query.py", line 387, in get self.model._meta.object_name django.contrib.sites.models.DoesNotExist: Site matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 149, in get_response response = self.process_exception_by_middleware(e, request) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 147, in get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/auth/views.py", line 49, in inner return func(*args, *kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper return view(request, args, kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view response = view_func(request, *args, kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func response = view_func(request, *args, *kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/auth/views.py", line 82, in login current_site = get_current_site(request) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/sites/shortcuts.py", line 15, in get_current_site return Site.objects.get_current(request) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/sites/models.py", line 67, in get_current return self._get_site_by_request(request) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/sites/models.py", line 52, in _get_site_by_request SITE_CACHE[domain] = self.get(domain__iexact=domain) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/manager.py", line 122, in manager_method return getattr(self.get_queryset(), name)(args, kwargs) File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/query.py", line 387, in get self.model._meta.object_name django.contrib.sites.models.DoesNotExist: Site matching query does not exist.
Output of webpage in debug mode:
DoesNotExist at /warp/login/
Site matching query does not exist.
Request Method: GET Request URL: http://127.0.0.1:8000/warp/login/?next=/warp/ Django Version: 1.9.13 Exception Type: DoesNotExist Exception Value:
Site matching query does not exist.
Exception Location: /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/query.py in get, line 387 Python Executable: /home/mapwarper/warp/warpenv/bin/python Python Version: 3.5.2 Python Path:
['/home/mapwarper/warp', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/mapwarper/warp/warpenv/lib/python3.5/site-packages']
Server time: Wed, 14 Feb 2018 18:40:50 +0000
What am I doing wrong this time?
Here a tree of my current project folder:
(warpenv) mapwarper@mapwarper-web:~/warp$ tree -L 2 . ├── db.sqlite3 ├── django_warp │ ├── admin.py │ ├── apps.py │ ├── bak │ ├── forms.py │ ├── init.py │ ├── migrations │ ├── models.py │ ├── pycache │ ├── static │ ├── templates │ ├── templatetags │ ├── tests.py │ ├── urls.py │ └── views.py ├── manage.py ├── mysite │ ├── init.py │ ├── pycache │ ├── settings.py │ ├── urls.py │ └── wsgi.py |── warpenv │ ├── bin │ ├── include │ ├── lib │ ├── lib64 -> lib │ ├── man │ ├── pip-selfcheck.json │ ├── pyvenv.cfg │ └── share
16 directories, 16 files
could you provide me mysite/settings.py ? I fear you haven't 'django.contrib.auth' in INSTALLED_APPS
It's seems I do have it. Also you may notice I added httpproxy in INSTALLED_APPS because I got error where it said it was missing it, so I added it above django_warp.
mysite/settings.py
""" Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.9.13.
For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """
import os
Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
Quick-start development settings - unsuitable for production
See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@eeuid^y0azz98wx70uow0ejo6%31p5zvy$@afg$ivrj*$p0q('
SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
added per girl tutorial
ALLOWED_HOSTS = ['127.0.0.1']
Application definition
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'httpproxy', 'django_warp', ]
MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ]
ROOT_URLCONF = 'mysite.urls'
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ]
WSGI_APPLICATION = 'mysite.wsgi.application'
Database
https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } }
Password validation
https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ]
Internationalization
https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
Static files (CSS, JavaScript, Images)
https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
added per girl tutorial
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
In case you ask, here is output of mysite/urls.py. You may noticed here also, I added include to " from django.conf.urls import url, ..."
"""mysite URL Configuration
The
urlpatterns
list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views
- Add an import: from my_app import views
- Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views
- Add an import: from other_app.views import Home
- Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf
- Import the include() function: from django.conf.urls import url, include
- Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^warp/', include('django_warp.urls')), ]
Ok I fixed this error with help from comment: https://stackoverflow.com/a/37937755
When you include the django.contrib.sites to your INSTALLED_APPS and run the command "python manage.py migrate" the app automatically creates a object into "django_site" table (with domain name and display name equals to "example.com". There is no need to create it by yourself.
Probably you just need to add the setting SITE_ID = 1 to your settings.py file.
answered Jun 21 '16 at 7:11 by Ricardo Silva https://stackoverflow.com/a/37937755 https://stackoverflow.com/questions/11476210/getting-site-matching-query-does-not-exist-error-after-creating-django-admin/37937755
So I added that variable setting to mysite/settings.py and ran the server again and sucessfully loaded the login page with no errors.
Just need to figure out how to register/setup an account.
EDIT: To create superuser, execute and follow:
python manage.py createsuperuser Then add all permissions to that user via admin in 127.0.0.1:8000/admin/
I managed to create a new dataset and upload an images, then an error appears. The image uploaded cannot be seen on georeferencing page. The left map box stays white. I made sure not to use an .jp2 (Jpeg2000) image and used a .PNG image. Here are some errors from web server console, may it be an error about paths?
PS: Does Django-Warp support jp2 (Jpeg2000)?
(warpenv) mapwarper@mapwarper-web:~/warp$ python manage.py runserver Performing system checks...
System check identified no issues (0 silenced). February 14, 2018 - 23:26:58 Django version 1.9.13, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/template/defaulttags.py:499: RemovedInDjango110Warning: Reversing by dotted path is deprecated (django.contrib.auth.views.logout). url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
[14/Feb/2018 23:27:02] "GET /warp/ HTTP/1.1" 200 6902 [14/Feb/2018 23:27:14] "GET /warp/1/ HTTP/1.1" 200 7685 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/template/smartif.py:168: RemovedInDjango110Warning: Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead. mapped_tokens.append(self.translate_token(token))
[14/Feb/2018 23:27:19] "GET /warp/imgset/2/ HTTP/1.1" 200 35849 Not Found: /warp/imgset/2/warp/0002_s_output.png [14/Feb/2018 23:27:19] "GET /warp/imgset/2/warp/0002_s_output.png?dum=9576136 HTTP/1.1" 404 6005
I managed to create a new dataset and upload an images, then an error appears. The image uploaded cannot be seen on georeferencing page. The left map box stays white. I made sure not to use an .jp2 (Jpeg2000) image and used a .PNG image. Here are some errors from web server console, may it be an error about paths?
PS: Does Django-Warp support jp2 (Jpeg2000)?
(warpenv) mapwarper@mapwarper-web:~/warp$ python manage.py runserver Performing system checks...
System check identified no issues (0 silenced). February 14, 2018 - 23:26:58 Django version 1.9.13, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/template/defaulttags.py:499: RemovedInDjango110Warning: Reversing by dotted path is deprecated (django.contrib.auth.views.logout). url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
[14/Feb/2018 23:27:02] "GET /warp/ HTTP/1.1" 200 6902 [14/Feb/2018 23:27:14] "GET /warp/1/ HTTP/1.1" 200 7685 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/template/smartif.py:168: RemovedInDjango110Warning: Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead. mapped_tokens.append(self.translate_token(token))
[14/Feb/2018 23:27:19] "GET /warp/imgset/2/ HTTP/1.1" 200 35849 Not Found: /warp/imgset/2/warp/0002_s_output.png [14/Feb/2018 23:27:19] "GET /warp/imgset/2/warp/0002_s_output.png?dum=9576136 HTTP/1.1" 404 6005
I'm happy you resolved install. I had no solution idea. But now you are near to goal. 1)I would define a media directory and point to it in MEDIA_URL and MEDIA_ROOT variables in settings.py: https://docs.djangoproject.com/en/2.0/ref/settings/#media-root This will not resolvs but you will get tidy uploads. 2) I never tested django_warp with sqlite/spatialite backend. I only used postgis. 3) some multiband or alpha channeled imgs or very big imgs are not handled very well, I would first try with light and simple 3 bands RGB jpgs
2018-02-15 0:39 GMT+01:00 soniok notifications@github.com:
I managed to create a new dataset and upload an images, then an error appears. The image uploaded cannot be seen on georeferencing page. The left map box stays white. I made sure not to use an .jp2 (Jpeg2000) image and used a .PNG image. Here are some errors from web server console, may it be an error about paths?
PS: Does Django-Warp support jp2 (Jpeg2000)?
(warpenv) mapwarper@mapwarper-web:~/warp$ python manage.py runserver Performing system checks...
System check identified no issues (0 silenced). February 14, 2018 - 23:26:58 Django version 1.9.13, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/template/defaulttags.py:499: RemovedInDjango110Warning: Reversing by dotted path is deprecated (django.contrib.auth.views.logout). url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
[14/Feb/2018 23:27:02] "GET /warp/ HTTP/1.1" 200 6902 [14/Feb/2018 23:27:14] "GET /warp/1/ HTTP/1.1" 200 7685 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935 CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/ 0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/ 0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/ 0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/ 054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 Not Found: /warp/1/CACHE/images/warp/0001_s_IGNF_PVA_1-01935 CCF0C-2381_1935_CAF_C-238_0002bis/054969915f465018a4fdc67d9e5c1bdb.jpg Not Found: /warp/1/CACHE/images/warp/0002_s_output/ 0a433cea60611f23f87668350f433e8d.jpg [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/ 0001_s_IGNF_PVA_1-01935CCF0C-2381_1935_CAF_C-238_0002bis/ 054969915f465018a4fdc67d9e5c1bdb.jpg HTTP/1.1" 404 6251 [14/Feb/2018 23:27:14] "GET /warp/1/CACHE/images/warp/0002_s_output/ 0a433cea60611f23f87668350f433e8d.jpg HTTP/1.1" 404 6110 /home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/template/smartif.py:168: RemovedInDjango110Warning: Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead. mapped_tokens.append(self.translate_token(token))
[14/Feb/2018 23:27:19] "GET /warp/imgset/2/ HTTP/1.1" 200 35849 Not Found: /warp/imgset/2/warp/0002_s_output.png [14/Feb/2018 23:27:19] "GET /warp/imgset/2/warp/0002_s_output.png?dum=9576136 HTTP/1.1" 404 6005
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/enricofer/django-warp/issues/7#issuecomment-365781473, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMgg5gEt2zH8KGV70bZTe2XjKw12aXcks5tU26UgaJpZM4SEtc2 .
Ok everything seems to work. I'm able to upload, georeference and generate .tiff, download-dataset(georeferenced .tiff). All the thumbnails are working. Here are the corrections a made to fix wrong path to images/thumbnails:
Add to end of mysite/settings.py
My folder containing django project:
MEDIA_ROOT = '/home/mapwarper/warp/'
Url base that will reference to media content I guess. I named it 'img':
MEDIA_URL = 'http://127.0.0.1:8000/warp/img/'
Add to end of django_warp/urls.py
url(r'^img/(?P
.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
The only error I have now, is I cannot delete an image from a dataset. When I click on X to delete, then confirm the alert/confirm box, I get this error: http://dpaste.com/11XPXJG
Traceback:
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py" in execute
- return Database.Cursor.execute(self, query, params)
The above exception (NOT NULL constraint failed: django_warp_datasets.transparency) was the direct cause of the following exception:
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py" in get_response
- response = self.process_exception_by_middleware(e, request)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py" in get_response
- response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
- return view_func(request, *args, **kwargs)
File "/home/mapwarper/warp/django_warp/views.py" in trash_image
- trash_dataset.save()
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in save
- force_update=force_update, update_fields=update_fields)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in save_base
- updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in _save_table
- result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in _do_insert
- using=using, raw=raw)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/query.py" in _insert
- return query.get_compiler(using=using).execute_sql(return_id)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
- cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/utils.py" in exit
- six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/utils/six.py" in reraise
- raise value.with_traceback(tb)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py" in execute
- return Database.Cursor.execute(self, query, params)
Exception Type: IntegrityError at /warp/trashimage/2/ Exception Value: NOT NULL constraint failed: django_warp_datasets.transparency
PS: Thanks for your help and time Enricofer.
Thanks @soniok you made a great work! Now you master django like a boss! What about putting your effort in a step by step tutorial? I would link it from repository.
2018-02-15 19:09 GMT+01:00 soniok notifications@github.com:
Ok everything seems to work. I'm able to upload, georeference and generate .tiff, download-dataset(georeferenced .tiff). All the thumbnails are working. Here are the corrections a made to fix wrong path to images/thumbnails:
- Add to end of mysite/settings.py
My folder containing django project:
MEDIA_ROOT = '/home/mapwarper/warp/'
Url base that will reference to media content I guess. I named it 'img':
MEDIA_URL = 'http://127.0.0.1:8000/warp/img/'
- Add to end of django_warp/urls.py
Need this for above to work url(r'^img/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
The only error I have now, is I cannot delete an image from a dataset. When I click on X to delete, then confirm the alert/confirm box, I get this error: http://dpaste.com/11XPXJG
Traceback:
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/db/backends/sqlite3/base.py" in execute
- return Database.Cursor.execute(self, query, params)
The above exception (NOT NULL constraint failed: django_warp_datasets.transparency) was the direct cause of the following exception:
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py" in get_response
- response = self.process_exception_by_middleware(e, request)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/core/handlers/base.py" in get_response
- response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/contrib/auth/decorators.py" in _wrapped_view
- return view_func(request, *args, **kwargs)
File "/home/mapwarper/warp/django_warp/views.py" in trash_image
- trash_dataset.save()
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in save
- force_update=force_update, update_fields=update_fields)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in save_base
- updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in _save_table
- result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/base.py" in _do_insert
- using=using, raw=raw)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/models/query.py" in _insert
- return query.get_compiler(using=using).execute_sql(return_id)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/db/models/sql/compiler.py" in execute_sql
- cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/utils.py" in exit
- six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/utils/six.py" in reraise
- raise value.with_traceback(tb)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
- return self.cursor.execute(sql, params)
File "/home/mapwarper/warp/warpenv/lib/python3.5/site-packages/ django/db/backends/sqlite3/base.py" in execute
- return Database.Cursor.execute(self, query, params)
Exception Type: IntegrityError at /warp/trashimage/2/ Exception Value: NOT NULL constraint failed: django_warp_datasets. transparency
PS: Thanks for your help and time Enricofer.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/enricofer/django-warp/issues/7#issuecomment-366013098, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMgg38S_DjNT3Xyr2h6r8ll4fZT1dCJks5tVHL2gaJpZM4SEtc2 .
Hello @enricofer,
I'm having and issue trying to install django-warp on a Ubuntu 16.04 LTS (in VirtualBox Linux Host) update to date. No problem installing dependencies but could not install Django 1.9, instead installed Django 2.0.2.
What am I missing? Could anyone care to help guide me? Thanks in advance, Best regards,
Here is the output of history:
Software Version Information:
Error msg when installing Django-warp: