Custom Django email script - python

I'm new to Django so don't be mad if this question might seem stupid.
I would like to add some functionality to my django web page. I need to add script that would send newest feed for subscribed users. Basically I would like to activate script when admin saves new post, but I don't know how modify admin page.
Maybe there is other solutions for this kind of task?

Related

How to make a python script to work with Django

so I have a python script I'd like to integrate to work with python. No matter what I do I don't seem to get it right. Below are what I've managed to do successfully which is getting Django to accept picture upload and display them to the user.
https://replit.com/#Eddyah5/ImageConverterwithHTML#main.py
I'm now trying to get my python script in the link above to work in Django to let users upload pictures out of the list of supported formats, convert the picture to .ico of different sizes, and zip them for download by users. Please pardon me I'm very new to python/Django. What to do with the views.py, models.py as pertaining my code is in the link below?
https://replit.com/#Eddyah5/ImageConverterwithHTML#main.py
I'm very new to python and Django, so any help I will deeply appreciate.
If you want to do this from Django admin then look into Admin Actions: https://docs.djangoproject.com/en/4.0/ref/contrib/admin/actions/
If you want to do it from frontend then make an API and call you code from view.

user interaction with django

I'm working on a question and answer system with django. my problem : I want the app to get a question from an ontology and according the user's answer get the next question. how can I have all the questions and user's answers displayed. i'm new to django, I don't know if I can use session with unauthenticated user and if I need to use websocket with the django channels library.
Given that you want to work with anonymous users the simplest way to go is to add a hidden field on the page and use it to track the user progress. The field can contain virtual session id that will point at a model record in the backend, or the entire Q/A session(ugly but fast and easy). Using REST or sockets would require similar approach.
I can't tell from the top of my mind if you can step on top of the built in session system. It will work for registered users, but I do believe that for anonymous users it gets reset on refresh(may be wrong here).

How do yo add members/users to Rancher Project via POST request using python?

I'm able to create a rancher project via the rancher API using python, but can quite figure out how to do so to add users/members...?
If you go to
https://mycluster.com/v3/users
you can add/create another user and see the api/curl request to do so.
After you create the user you also need to add a globalrolebinding so that your user can login (and do other things).
https://mycluster.com/v3/globalrolebindings

Updating django-oscar catalogue via API

I have to develop an e-commerce website but I am a newbie and I'm lost. I decided to use django-oscar.
The products must be updated on a daily basis from an API. To do so, I suppose I have to create a few models (The client has sent me LoginModel, ProductModel, ClientorderModel and so on). So I am assuming I have to implement those models in django to create my Catalog, right?)
Once the models are implemented, I would need to run a cron job to update the catalog every day.
I do not know if SO is the correct site to ask this question, if no, please tell me in which StackExchange site I would have to ask.
Thanks in advance.

How to create empty wordpress permalink and redirect it into django website?

I need to do such thing, but I don't even know if it is possible to accomplish and if so, how to do this.
I wrote an Django application which I would like to 'attach' to my wordpress blog. However, I need a permalink (but no page in wordpress pages section) which would point to Django application on the same server. Is that possible?
You can use the "Page links to" wordpress plugin to point to any url: https://wordpress.org/plugins/page-links-to/
There are many ways to do this. You will have to provide more info about what you are trying to accomplish to give the right advise.
make a page with a redirect (this is an ugly solution in seo and user perspective)
handle this on server level.
load your Django data with an ajax call

Categories

Resources