Django-registration: where is the views.py file to process form input and put it in the database? - django-registration

I'm trying to use django-registration to set up registration and authentication on a site I am building, and I've followed all the tutorials on the subject as closely as possible (e.g. http://www.michelepasin.org/blog/2011/01/14/setting-up-django-registration/ among others). What I can't understand is where django-registration gets the views.py file to actually put form input into the database. I've tried using the default backend ('registration.backends.default.DefaultBackend') but there seems to be no actual views.py code in the registration folder to handle the form input.
It seems that it is supposed to import this from registration.views (i.e. from registration.views import activate, from registration.views import register), but again there is no views.py file included. Do you have to write one yourself? I assume the default backend is supposed to handle this itself, otherwise the backend is basically useless. Can anyone tell me what's missing here?
I apologize for asking such a noob question, but I've spent most of the past day or two working on this and have basically given up finding an answer without help. I'm new to django and python as well, so it would be wonderful if someone could help here...

Related

Converting-punycode-with-dash-character-to-unicode

This is in reference to this topic on the page here:
Converting punycode with dash character to Unicode
//Javascript Punycode converter derived from example in RFC3492.
I don't know where to place the input 清华大学.cn domain to get the Javascript to work. I am not a real a programmer.
I want to use the js code on this page to convert IDN domain names to penycode if possible. I'm using a ColdFusion html page to process the JS. Then I'll save the penycode to our SQL database.
Example: 清华大学.cn needs to be converted to penycode.
I can use any number of online converters but that won't help. It has to be automated with a script. FYI, the penycode for 清华大学.cn is xn--xkry9kk1bz66a.cn.
HERE IS MY PROBLEM:
Even after copying the js code into Dreamweaver, I have no idea where to place the domain 清华大学.cn into the Javascript code be converted. I can't see a hint where the input is - if any. I can figure things out okay if there was some hint at where to begin.
I just need to know where to place the input or someone to tell me this can't be done with the Javascript example on that page.
We are using ColdFusion 19 and SQL on our under construction domain marketplace website. We want to accept IDN domains to be listed and I am hoping your JS will do what I want.
If I'm totally wrong then perhaps someone can suggest another js code that will convert the domain to correct penycode.
After searching I found an close answer I can at least work with, I hope. I needed an html input form to process the Javascript.
I found that information here.
How to convert domain names with greek characters to an ascii URL?
I then copied the page, inserted the Javascript as puny.js and it works. Now I need to figure out how to somehow capture the input "id" and "label for" to save the result into SQL using ColdFusion. Not sure if this can be done. But at least the somewhat answers my question. Maybe it's the best I'm going to get here on Stackoverflow.

Pulling Django variable data using Python

I am currently working on a project to grab live match data for eSports (yeah I'm a nerd, aren't we all?). So I am pulling HTML from a page and checking if my favorite team is playing and if so, go the page and check the scores every few minutes to get updates. The part I am now having trouble with is getting the names of teams and the match ID's. The reason for this is because when I grab the HTML data, inline JS variable names are included instead of their values which is what I need. Here is an example of what I am talking about:
<div class="col-xs-12 schedule-{[{schedule.state}]}" ng-if="schedules.length>0" ng-repeat="schedule in schedules track by schedule._id">
I need a way to grab the value of "schedule.state". Hopefully you guys can help. Also if there is already a similar solution I would be happy to be directed to it! Cheers!
EDIT
I have just realized through a little more researech that the variables are not JS but Django. Given the same problem just on how to get Django variable data instead of JS.

Grav - Parse URL

I want to define a new template called "product".
This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here.
However, I would like that the URL of the page would be something like:
/product/<id>/<seo-friendly-description>
So I can retrieve in the Twig template both <id> and <seo-friendly-description> which will be used later to retrieve the specific product information.
I have tried to find something that could help in the documentation, without success. Could someone either point me to the right doc section or highlight the basic steps that shall be achieved so I can start solving this issue?
Just in case it helps, I am trying to find something similar to how bottle or other web frameworks work:
#route('/hello/<name>')
def greet(name):
return 'Hello ' + name
I've been building a family recipebook into my own website and I've been working through a similar problem. I haven't quite worked out all the kinks, but my solution is mostly working if you want to checkout my github repo.
In short, you need the plugin to watch what the active route is. If the route matches, you then create the page and populate it using your plugin data.
I haven't quite figured out how to get the active page to highlight in the navigation menu for generated pages, but you might still find this solution helpful.

waiting for the website to change something

I am a student and in the school website, what I want to do is that I want to busy wait on the certain URL and check if the class i want to register for is open or not. I was wondering if there was a way to constantly check on the website(busy waiting or otherwise) to see if the class is open or not. There is a table Rem where it shows the number of places remaining in the User Interface.
Also what language would you use to solve this problem?
Yes you can. but for that you will probably need to create a script that fetches the value of data from that table.
So something like web scraping should work.
I would definately use php for this stuff.
Google web scraping and you can code the script.
I am not sure if this is the exact thing that will help you, but what you need to do is something similar - See Here

What web photo gallery software meets all my pernickety requirements?

I have a collection of photographs (about 30,000) which I'd like to put online. I've tried doing this before, over the years, with static image galleries, applications such as Gallery2, and self-rolled scripts. None have worked that well, as my requirements are fiddly, but it still seems like this should be a solved problem.
My photos are currently organised into folders named YYYY-MM-DD short album title, using Digikam.
I need a system that:
Is Free software, is essentially feature-complete, and has an active developer community.
Allows new photos and albums to be added and updated automatically with little more manual intervention than rsyncing the source directory on my computer to the web server, and rescanning.
Allows visitors to leave comments
Allows re-captcha or equivalant spam filtering and bulk moderation of these comments.
Reads tags from the IPTC Keywords field.
If it finds a tag named "friends", requires the user to enter a password to view.
If it finds a tag named "family", requires the user to enter a different password to view.
If it finds a tag named "private", does not display the photo at all, or even better, does not upload it to the live web server.
Reads descriptions from the IPTC Caption field.
Creates sane permalinks, e.g. http://example.com/2009/03/28/shortalbumtitle/IMG_0001.jpg
I acknowledge that I may be asking for something that doesn't exist, but I hope it does.
I acknowledge that answers may be something like "use Django and code the bits that don't already exist yourself", in which case do you have any tips? :)
Thanks.
Use Django and code the bits that don't already exist yourself.
Seriously. I was going to write that and was tempted not to when I saw you'd written it yourself, but it really does make the most sense if you have any familiarity with it!
I'd start with django-photologue 2. Get a basic gallery with tagging and comments working. You'll need a couple of pl's optional dependencies.
Then I'd write a custom import wrapper that allows you to rsync to a dir and update your library.
Comments are handled internally (through photologue, I think) but if not, there are plenty of comment apps that "just work". There is a recaptcha script that works as just another form field.
PIL can read IPTC
The URL structure is up to you =)
I'm finally getting around to doing this. I'm using a local python script to extract image metadata (tags, captions and timestamp) using pyexiv2, then rotate the image according to its EXIF orientation tag if appropriate, using PIL, and export a hierarchy of files to a temporary directory, where rsync uploads it to my host, and a remote python script (actually a Django app) imports the metadata into a Django DB.

Resources