How to embed images on a site django with dropbox? - django

Deployed a blog on Heroku. I upload the picture to the record through the admin panel on Dropbox via django-storages. The picture appears in the Dropbox application, but I don’t understand how to load the link to it. How to embed Dropbox pictures? You can advise other ways. While the idea is only to manually link links to the database ...

Related

What is the original purpose of Django apps? What are the use cases of Django apps?

I'm building a website that'll use a Bootstrap template similar to the image shown below. I intend to add an authentication and authorization functionality using OAuth 2. The main menu will consist of:
Homepage link
Statistics app link
NLP app link
Computer vision app link
Contacts page link
Login button
Without using Django, the homepage would just be index.html, the Statistics app would be a statistics.html page which interacts with the backend to show some plots, the NLP app would be an nlp.html page which interacts with the backend to display some NLP processed text and so on.
When using Django, how am I supposed to structure it? Should I create a separate NLP Django app, and a separate Statistics Django app and a separate Homepage Django app? I'm already surprised that I had to create an app just to be able to have a homepage, and then had to add path('', include('homepage.urls')), to urlpatterns to redirect / to the homepage app.
If I use the Bootstrap template for the homepage app, then how would I share the JS files, the CSS files and other boilerplate files of the template with the other apps of my website? Once the user logs in, would the session of the homepage app be valid for the other apps too?
Do I even need to create separate apps for NLP, Statistics, computer vision etc? What exactly is the purpose of Django apps, and could you mention a few use cases of Django apps and how boilerplate template files and scripts were shared among apps? Any best-practices related to app building?

django ckeditor running into unexpected errors

I am using django-ckeditor python package in my django app (django 1.11 + python 2.7). I have integrated it with s3 and it is hosted on Heroku. So far everything runs smooth.
Earlier I had an issue that non admin user could not upload images to server thus can not use any images as a part of their content. I fixed it by overriding ckeditor's browse and upload view. When i tested it it was working just fine. I pushed it to production.
Now none of my user can use ckeditors image upload or browse feature. when I try it, (as an admin or as regular user) it works. some users reported that app crashes, some said image wont show up despite uploading to server (also I can't see it in my s3 bucket.)
other images are working well with s3 for all users. but ckeditors images are working only for me, no matter which machine or which role I try as.
I also checked heroku apps, but they are not helpful at all.
Does anyone have idea any guesses why this could be happening.

photolouge gallery only uploads one picture

I have a django site with photologue installed, and I followed the official documentation to get it setup. Whenever I go to the admin site to create a gallery I can choose multiple pictures to put in that gallery but once I hit save only the first selected photo gets saved to the gallery. Does anyone know why this is happening. I'm using photologues default template to view my pictures on the front end.
I had the same problem. Looking at web debugger, when loading the gallery page, it says:
Loading failed for the with source http://xxxxxxxx.com/static/sortedm2m/widget.js Loading failed for the with source http://xxxxxx.com/static/sortedm2m/jquery-ui.js
I solved it by:
cd <static_dir>
cp -R .../python3.6/sortedm2m/static/sortedm2m .

Django: Upload database associated file to remote server

Hello community of stack overflow.
Im having a big problem.
Well this is my scenery: I have two projects of Django, and the users model have a ImageField, When I create in both Porjects the users I want upload this field to another server, for example I have a Droplet in DigitalOcean just with apache, and I want upload all the media data in this server!
Thanks in advance!
I finally used the storage application, at the end, the system is uploading media files to AWS S3!

Django Admin doesn't recognize files uploaded on Google App Engine

I am using Django 1.4 on Google App Engine.
I have a model called Media, where the admins can upload files to use in their website. It has a field:
file = models.FileField(upload_to='/uploads/%Y/%m/%d')
It works perfectly with images (although the URL provided is weird), but that is not a problem.
The problem is when they try to upload a PDF (or anything else). Everything seems to work, but when you go to edit it, it doesn't contain any file - there is no "Currently" or anything else.
If I go to Google App Engine dashboard, the file is in Blob Viewer, and the record is also saved and available through the Datastore Viewer, with the correct blob key.
Why Django is not recognizing it? And how I can fix it?
djangoappengine contains a storage provider for the blobstore.
To me it doesn't seem like a full-featured solution, just something to get file uploads running.
I had to add this to get some functionality I needed (urls to the files).
It might make the admin work too:
https://github.com/dragonx/djangoappengine/commit/6a472a80c25bc077816c9104b45d5a64f3063273