Aggregate feeds and grab image using Django - django

Im currently have some website running Drupal, using Feeds Image Grabber module (http://drupal.org/project/feeds_imagegrabber)
Because I has started learning Django, I'm trying to look what tools available in Django which can give same functionality as my Drupal site:
-Feed aggregator
-Grab one image (largest image) from the source URL

These links only address the first part of your question, not so much the image grabbing part:
https://github.com/miracle2k/feedplatform implements the core functionality of a feed aggregator
http://birdhouse.org/blog/2009/10/20/generating-rss-mashups-from-django/ looks like a less general approach, re-using an application that powers the Django project website

Related

I am new to Django can anyone help me with the below task....?

Go through the sample JSON file given here -
https://drive.google.com/open?id=1xZa3UoXZ3uj2j0Q7653iBp1NrT0gKj0Y
This JSON file describes a list of users & their corresponding periods of activity across
multiple months.
Now, design and implement a Django application with User and ActivityPeriod models, write
a custom management command to populate the database with some dummy data and design
an API to serve that data in the JSON format given above.
To build the application with the mentioned requirements you need to have at least a basic understanding of the Django and Django rest framework. There are plenty of learning materials on the web to get started. Mozilla has a very good tutorial to get begin with. Link: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
Similarly, For the REST API, there are free videos on YouTube offered by channels such as Dennis Ivy's, CodingEntrepreneurs which are good to get started with. I would recommend you to check those videos!
All the best!
Happy Coding

How to render a pdf file as pdf in browser using django

I am using Django web frame work. I am taking pdf files from users (notes/book/etc). Then I want to display those pdf in website, but I could not find a way. Methods that failed 1)iframe 2)simple rendering using django 3)pdf.js library. Also browser blocks rendering initially. Care to suggest a method and steps to implement it.
I the answer to your problem is here :
https://docs.djangoproject.com/en/3.0/howto/outputting-pdf/
Well the answer has to be very very clear here. You can not display pdf using. There is no such library for that. Like pdf.js for javascript based frameworks. I have done the research. So if you want a really good pdf viewer for your django powered website you have to use pdf.js for sure. I have asked people working with django professionally.
output in firefox
ouput in chromium browser
Now 2nd output is what we want
here is the code

Django model React

I'm trying some Django + React stuff and I'm a bit confused with the particular role of Django model in this scheme.
As I can understand Django model provide smooth way to create some typical forms by users of the site (please correct me). And I can't feel the edge of what should be hardcoded and what I need to store in model.
In case of React (I'm trying to connect react with django through api via djangorestframework) should I create a model for Header? And store bg image with it and my slogans. I feel it's should be purely in frontend. But next section with 3 typical screens (they will be listed horizontally and swap each other). They are just copy of each other with different data (title, bg, fg, text, link), for me it seems closer to model usage. But model initially empty and if I want to get this data from model I firstly need to somehow store this data to model.
So in general my question is what the right cases for using Django models and when it's no needed. And if it possible with applying to my example to better understanding for me )
ofc I searched this info widely but so far can't create clear understanding by myself.
Thanks )
You might actually be in search of a headless CMS.
To combine React and Django and still use a CMS to allow administrating text blocks and images, Django Wagtail's StreamField is a good choice.
https://docs.wagtail.io/en/v2.0/topics/streamfield.html
See for example our company's homepage: https://www.blu-beyond.com. It runs on Django Wagtail, having JS animated text blocks that are administered in the CMS (just jQuery and other JS libs, no React, in this case).
Django Wagtail offers a JSON API, as well, that can be used in React:
https://docs.wagtail.io/en/v2.8/advanced_topics/api/v2/usage.html#fetching-content
It also offers a GraphQL API.

How can get images from wikipedia api?

i have the product keyword, i need images from wikipedia for that search keyword to display in my web application. is it possible? i'm doing this application in python/django framework.
Some simple searching has this example in the tutorial, for fetching search result images:
?action=query&titles=San_Francisco&prop=images&imlimit=20&format=jsonfm.
You can use urllib2 to fetch the results, etc.

Django image insertion in Admin

I am building a small side project - a simple news site. I want to use the Django Admin for uploading articles and allow access to non-coders so as they can publish articles a la Wordpress or such. I have added some functionality to the admin, first trying out TinyMCE and Dojo rich text editors. However, these do not come with the ability to insert an image into an article from a file (just urls).
I really only want some light text formatting in the text area plus the ability to upload and insert images from the users's harddrive directly into the article. Is there a simple way to achieve this?
If you are already using django-tinymce, you can integrate django-filebrowser with it. See django-tinymce's documentation.
There is also a commercial choice which looks good, but I have never tested it.