and this was Traceback
Environment:

Request Method: GET
Request URL: https://arena3.herokuapp.com/8/clubpage/

Django Version: 2.2.1
Python Version: 3.6.8
Installed Applications:
['core.apps.CoreConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_social_share',
 'django_dropbox_storage']
Installed Middleware:
('whitenoise.middleware.WhiteNoiseMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Template error:
In template /app/templates/base.html, error at line 10
   No module named 'StringIO'
   1 : {% load static %}
   2 : 
   3 : 
   4 : <!DOCTYPE html>
   5 : <link href="https://fonts.googleapis.com/css?family=Bitter"; 
rel="stylesheet">
   6 : <link href="https://fonts.googleapis.com/css?family=Merriweather"; 
rel="stylesheet">
   7 : <html>
   8 :     <head>
   9 :         <title>{% block title %}{% endblock %}</title>
   10 :         <link rel="stylesheet" 
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"; 
integr ity="sha384-ggOyR0i 
XCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" 
crossorigin="anonymous">
   11 :         <!--<link rel="stylesheet" 
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css";>-->
   12 :         <link rel="stylesheet" type="text/css" href="{% static 
'core/basepage.css'%}" />
   13 :     </head>
   14 :     <body>
   15 : 
   16 :    <nav class="navbar" id="navbar">
   17 :      
   18 :       {% if user.is_authenticated %}
   19 :        <h4>logged in as {{ user.username }}</h4>
   20 :      {% endif %}


Traceback:

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in _resolve_lookup
  829.                     current = current[bit]

During handling of the above exception ('ImageFieldFile' object is not 
subscriptable), another exception occurred:

File 
"/app/.heroku/python/lib/python3.6/site-packages/django_dropbox_storage/storage.py"
 
in <module>
  6.     from cStringIO import StringIO

During handling of the above exception (No module named 'cStringIO'), 
another exception occurred:

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py"
 
in inner
  34.             response = get_response(request)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py" 
in _get_response
  115.                 response = self.process_exception_by_middleware(e, 
request)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py" 
in _get_response
  113.                 response = wrapped_callback(request, *callback_args, 
**callback_kwargs)

File "/app/core/views.py" in clubpage
  86.     return render(request, 'core/clubpage.html', {'club':club, 
'news':news})

File "/app/.heroku/python/lib/python3.6/site-packages/django/shortcuts.py" 
in render
  36.     content = loader.render_to_string(template_name, context, 
request, using=using)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/loader.py" 
in render_to_string
  62.     return template.render(context, request)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/backends/django.py"
 
in render
  61.             return self.template.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render
  171.                     return self._render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in _render
  163.         return self.nodelist.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render
  937.                 bit = node.render_annotated(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render_annotated
  904.             return self.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/loader_tags.py"
 
in render
  150.             return compiled_parent._render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in _render
  163.         return self.nodelist.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render
  937.                 bit = node.render_annotated(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render_annotated
  904.             return self.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/loader_tags.py"
 
in render
  62.                 result = block.nodelist.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render
  937.                 bit = node.render_annotated(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render_annotated
  904.             return self.render(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in render
  987.             output = self.filter_expression.resolve(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in resolve
  671.                 obj = self.var.resolve(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in resolve
  796.             value = self._resolve_lookup(context)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py" 
in _resolve_lookup
  837.                         current = getattr(current, bit)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/db/models/fields/files.py"
 
in url
  62.         return self.storage.url(self.name)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py" 
in inner
  256.             self._setup()

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py" 
in _setup
  363.         self._wrapped = get_storage_class()()

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py" 
in get_storage_class
  358.     return import_string(import_path or 
settings.DEFAULT_FILE_STORAGE)

File 
"/app/.heroku/python/lib/python3.6/site-packages/django/utils/module_loading.py"
 
in import_string
  17.     module = import_module(module_path)

File "/app/.heroku/python/lib/python3.6/importlib/__init__.py" in 
import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>" in _gcd_import
  994. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load
  971. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
  955. <source code not available>

File "<frozen importlib._bootstrap>" in _load_unlocked
  665. <source code not available>

File "<frozen importlib._bootstrap_external>" in exec_module
  678. <source code not available>

File "<frozen importlib._bootstrap>" in _call_with_frames_removed
  219. <source code not available>

File 
"/app/.heroku/python/lib/python3.6/site-packages/django_dropbox_storage/storage.py"
 
in <module>
  8.     from StringIO import StringIO

Exception Type: ModuleNotFoundError at /8/clubpage/
Exception Value: No module named 'StringIO'


On Thursday, June 13, 2019 at 5:11:37 PM UTC+2, omar ahmed wrote:
>
> i added django_dropbox_storage in installed apps in settings.py
> what should i add else ?
> thanks
> On Thursday, June 13, 2019 at 4:43:23 PM UTC+2, James Farris wrote:
>>
>> That means it wasn’t installed or it wasn’t added to your settings.py 
>> file in the installed apps section 
>>
>> Sent from my mobile device
>>
>> On Jun 13, 2019, at 7:07 AM, omar ahmed <omark...@gmail.com> wrote:
>>
>> i followed the steps
>> when i typed 
>> python manage.py test [--settings=test_settings]
>> i found this error 
>> ModuleNotFoundError: No module named '[--settings=test_settings]'
>> and when i tried to open my site (club page that has image) i foun this 
>> error
>>
>> No module named 'StringIO'
>>
>> i searched at Google but no similar issues
>>
>> On Thursday, June 13, 2019 at 1:03:10 AM UTC+2, James Farris wrote:
>>>
>>> This python package may be a better choice for you, since I assume you 
>>> want all user generated content (images) to be stored in Dropbox. 
>>>
>>> This has pretty good documentation. 
>>> https://pypi.org/project/django-dropbox-storage/
>>>
>>> If you use this package, remove the sample code I sent
>>>
>>>
>>> On Wed, Jun 12, 2019 at 3:53 PM omar ahmed <omark...@gmail.com> wrote:
>>>
>>>> i added this function at the end of views.py file 
>>>> def connect_to_dropbox():
>>>>     dbx = dropbox.Dropbox(‘your access token)
>>>>     dbx.users_get_current_account()
>>>> and i put given access token from dropbox
>>>> then what about call
>>>> do you mean in any view function that will show page included images 
>>>> add  
>>>> connect_to_dropbox()
>>>> and what about 
>>>>
>>>> for entry in dbx.files_list_folder('').entries:
>>>>     print(entry.name)
>>>>
>>>>
>>>>
>>>> On Thursday, June 13, 2019 at 12:38:11 AM UTC+2, James Farris wrote:
>>>>>
>>>>> You would add this code to the views.py file, which is where the 
>>>>> business logic goes. 
>>>>>
>>>>> https://docs.djangoproject.com/en/2.2/topics/http/views/
>>>>>
>>>>> Likely would add a class with properties and methods or a definition 
>>>>> (a function) like below:
>>>>>
>>>>> For example in your apps views.py file:
>>>>>
>>>>> def connect_to_dropbox():
>>>>>     dbx = dropbox.Dropbox(‘your access token)
>>>>>     dbx.users_get_current_account()
>>>>>
>>>>>     # this stuff likely would go in a separate function
>>>>>     for entry in dbx.files_list_folder(‘’).entries:
>>>>>         print(entry.name)
>>>>>
>>>>>
>>>>> At some point in your code you would call the function:
>>>>> connect_to_dropbox()
>>>>>
>>>>> On Wed, Jun 12, 2019 at 3:10 PM omar ahmed <omark...@gmail.com> wrote:
>>>>>
>>>>>> i opened the documentation for django-storages ... and i installed 
>>>>>> Dropbox in my environment and i created my app folder  but i didn't 
>>>>>> complete docs .
>>>>>> somethings not clear ... like :
>>>>>> Link an account 
>>>>>>
>>>>>> dbx = dropbox.Dropbox('YOUR_ACCESS_TOKEN')
>>>>>>
>>>>>> dbx.users_get_current_account()
>>>>>> Try some API requests
>>>>>>
>>>>>> for entry in dbx.files_list_folder('').entries:
>>>>>>     print(entry.name)
>>>>>>
>>>>>> where should i write these commands ?
>>>>>> thanks
>>>>>>
>>>>>> On Wednesday, June 12, 2019 at 1:13:11 AM UTC+2, James Farris wrote:
>>>>>>>
>>>>>>> You might try the docs from Dropbox
>>>>>>> https://www.dropbox.com/developers/documentation/python#overview
>>>>>>>
>>>>>>> You can checkout this project for ideas
>>>>>>> https://github.com/singingwolfboy/django-with-dropbox
>>>>>>>
>>>>>>> and here is documentation for django-storages
>>>>>>>
>>>>>>> https://django-storages.readthedocs.io/en/latest/backends/dropbox.html
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jun 11, 2019 at 2:17 PM omar ahmed <omark...@gmail.com> 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> yes James you are right.... i need to upload images using the 
>>>>>>>> Django admin, ... how can i use Dropbox for this issue ? 
>>>>>>>> i need a good tutorial
>>>>>>>>
>>>>>>>> On Tuesday, June 11, 2019 at 6:14:10 PM UTC+2, James Farris wrote:
>>>>>>>>>
>>>>>>>>> He is saying these aren’t static files. It sounds like he uploads 
>>>>>>>>> them using the Django admin, which of course is like an end user on a 
>>>>>>>>> client uploading files to the media directory. 
>>>>>>>>>
>>>>>>>>> Since that is the case it sounds like the Dropbox option is the 
>>>>>>>>> best. Documentation was provided earlier. So being that it seems like 
>>>>>>>>> he 
>>>>>>>>> read through the documentation, my question is where is he stuck in 
>>>>>>>>> the 
>>>>>>>>> Dropbox implementation?
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> You received this message because you are subscribed to a topic in 
>>>>>>>> the Google Groups "Django users" group.
>>>>>>>> To unsubscribe from this topic, visit 
>>>>>>>> https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe
>>>>>>>> .
>>>>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>>>>> django...@googlegroups.com.
>>>>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>>>>> Visit this group at https://groups.google.com/group/django-users.
>>>>>>>> To view this discussion on the web visit 
>>>>>>>> https://groups.google.com/d/msgid/django-users/3d50f417-cceb-4141-9b6d-9d2f5d0feee4%40googlegroups.com
>>>>>>>>  
>>>>>>>> <https://groups.google.com/d/msgid/django-users/3d50f417-cceb-4141-9b6d-9d2f5d0feee4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>> -- 
>>>>>> You received this message because you are subscribed to a topic in 
>>>>>> the Google Groups "Django users" group.
>>>>>> To unsubscribe from this topic, visit 
>>>>>> https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe
>>>>>> .
>>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>>> django...@googlegroups.com.
>>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>>> Visit this group at https://groups.google.com/group/django-users.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/django-users/e8763fdb-d559-4d5b-9274-a59c7c0e9198%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/e8763fdb-d559-4d5b-9274-a59c7c0e9198%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>>>> -- 
>>>>> *James Farris*
>>>>> Web Application Developer | Web and Digital Solutions
>>>>> External Relations & Advancement Marketing Communications
>>>>> University Development and Alumni Relations | UC Berkeley
>>>>> 510-664-4512 | jfa...@berkeley.edu
>>>>>
>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "Django users" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> django...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/4f99e57d-ec92-4336-abda-37f671e188c6%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/4f99e57d-ec92-4336-abda-37f671e188c6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>>> *James Farris*
>>> Web Application Developer | Web and Digital Solutions
>>> External Relations & Advancement Marketing Communications
>>> University Development and Alumni Relations | UC Berkeley
>>> 510-664-4512 | jfa...@berkeley.edu
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/499f5ed2-b5ff-4474-8690-47c826b6fb91%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/499f5ed2-b5ff-4474-8690-47c826b6fb91%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74466965-5e6f-4672-a661-bfefd53c090f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to