My application uses a photo slideshow(diaporama). In the back-end management I would provide the path to the folder that contains the photos. How can I handle the management of photos in Django?
I would use Photologue:
Features:
Complete photo gallery solution
Manipulation functionality
Fully inlcuded in Django Admin interface
What about using the django filebrowser and reference your photos from the folders you upload to?
django-filebrowser
Related
I am currently developing a mobile app using Ionic and I am using Django Admin Interface as sort of Backend for adding and editing the content of my mobile app through a MySQL Database.
I currently wish to create a custom analytical dashboard for tracking the usage of the users of my mobile app in the startpage of the Django Admin. While there are some analytical packages for tracking the usage in Django, they only function for web applications.
In my case I need to gather and display aggregate data from my database (Django models & not Django models) as well for other APIs. Is there a way how can I fetch data in form of SQL queries and display them in my dashboard using Python (Django)?
And how can I extend the starting page of Django Admin to a full analytical dashboard with the named functionalities?
I am currently struggling with this as I am new to Django. Any help is much appreciated!
There are some prebuilt admin themes which you can look into, and I personally recommend Django Jet. You can also change directly the way that the admin templates are made and rendered looking around the contrib/admin folder on your Django installation, or you can extend the admin views and templates, take a look at the documentation. Hope I could help!
I am learning Django after moving from J2EE (Java). I have a problem with Django project layout following MVC pattern.
In J2EE, my project includes 3 main parts:
Model:
JavaBean (DTO): defines classes based on Database tables.
DAL: defines classes to manipulate java beans with database.
Controller:
Servlets
View:
JSP files
Therefore, I have 3 packages(DTO,DAL,Controller) and a folder containing JSP files.
I understand that Django uses MTV. However, there's a submodule of a Django project called "app" that contains "model" and "view" inside. This makes me confused when following project layout according to J2EE above.
Hope to receive some advises from you guys. Thank you.
The difference between a project and an app, an app is a Web application that does something – e.g., a Weblog system, a database of public records or a simple poll app. A project is a collection of configuration and apps for a particular website. A project can contain multiple apps. An app can be in multiple projects.
In django , a project is a container consists of multiple apps that each app has its own model view and controller.
for example your project can have blog and news apps.you can imagine that your java mvc application has been grouped to several apps.
go to each app's folder(you have named the first app , app) define your model in model.py and views...
I am struggling to find a solution for a photo gallery in django. I've checkout out every django photo package (photologue, imagekit, etc.) I could find an none of them are really helping me in my quest.
I am trying to build a simple image gallery that will allow me to upload multiple photos from the django admin and store them directly in Amazon S3. Can someone please point me to a simple photo app capable of achieving this or what would be the simplest approach?
Thank you so much
This can be accomplished with django-storages configured to use S3. After setting up django-storages with S3, you can simply use add the image field to your model:
some_image = models.ImageField(upload_to='images')
where images is the subkey/directory in the bucket specified in your setup.
The process is outlined here and here.
In order to setup multi-image uploading, you can use: django-admin-multiupload or django-photologue (built-in S3 support)
or see one of the similar questions: Uploading multiple images in Django admin
I'm developing a Django site which allows users to upload PDF, image and video files. Django is able to serve the pdf and image files comfortably for my purposes but cannot cope with the video downloads. Is there a way to load video files via Django but them serve them using a different server?
Is there a way to load video files via Django but them serve them
using a different server?
You should define what you mean by "different server". but I assume, you mean different project that is not written in Django.
Since video files land in file system ( if you design so), you can access them as you want if different project is running on the same server. otherwise you would need some file sync between servers. if you want to distinguish which video file belongs to which object in db, I would insert the object name into filepath.
if I didnot fully answer your question, let me know below
I new in django, but I am really old in web developpement.
My question is about how to properrly organize your project into a django project. I am about to build my first web site in django and i have the following question :
I want a contact page in my website? basically it's a form/view/template, but where do I create that ? should I create a whole new app?
Django projects deliver functionality through apps. A project is the configuration holding your chosen apps together. It's highly likely you'll need to write at least one app yourself. Your app will have models, views and forms.
There are a number of projects that can help bootstrap your project. See the matrix on djangopackages.com related to boostrapping.
Pinax is a good application bootstrapping tool providing a standard project layout, starter projects, reusable apps and default templates.
The authors of Two Scoops of Django have a layout on GitHub which is focused on the environment and file/directory layout.