django allauth how to make a custom design html - html

I know there's a lot of documentation over the topic, this one, and this one but i couldn't find one that explains so that a 5 year old - or a designer - could understand :) .
My knowledge is html and css, and I need to design the templates for the user login process using Django AllAuth. I'm alone in this one, with no knowledge of python.
Someone please point me to some good documentation to help answering my question:
1 - How can I design each account/page html if I don't know what element is coming? Do I need to work on the views.py file? (possible to do so without any python knowledge?)
2 - how can I actually test all error messages without having to go thru all the login steps every time?
Thank you, guys

I did something like this. It was for django-registration, but the idea is the same.
-Go to github, and clone all the templates. In case, you are not familiar, there will be a folder called templates inside allauth app folder, and download the whole folder. Inside it , there will be base.html, and a folder called allauth.
-base.html is not needed, and you can delete it.
-inside all-auth folder, you will have a bunch of self-evident html files. Open the files, now, the only important content lies between {% block content %}{% endblock %}. Copy that to the html files you want, but make sure to have the same file name; otherwise, allauth woent recognize.
-If you want even more customization, run server, obtain the (soem name)" html codes, and you will see a bunch of html form fiels with id = "(some name)" and name = "". These are HTML fields. As long as you keep the same id and name for each field, you can use them however you want.
Summary: Run server with default allauth templates that you get from github. Go to source of the django generated html files. Copy all the fields that are relevant, and use them however you want.
I know I am not full clear, but it is somewhat a long process.
Here is the official django page: https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template

Related

Mediawiki dumpBackup parameters

I fail to understand some options in the dumpBackup.php maintenance script of Mediawiki.
What is the effect of --include-files? In my test wiki, dumpBackup.php --current --include-files and dumpBackup.php --current both contain the pages of the File: namespace and I see no difference.
What is the effect of --uploads? In my test wiki I see that the xml file contains a tiny bit more of xml but, to me, it looks like this is all information which is there already as part of the File: page. What is the use of this flag?
When I add both --include-files and --uploads I get the next surprise. I actually expected the combined effect of both options, but what I get is the file content of the uploaded files and the upload record. Why did I not get the file contents when I used --include-files alone?
When I use only --include-files and --uploads but no --current I would have expected to get the content of the uploaded files and the upload record (and none of the other pages). However ,I get the warning no valid action specified and no further information at all
I am completely confused since I do not understand the logic behind all of this.

MediaWiki: an imported template returns many errors

I've installed a mediawiki and imported an example page from Wikipedia. But the template is not shown properly. https://wordpress-251650-782015.cloudwaysapps.com/wiki/Cheeta
Any hint on what could be the cause?
You're most likely missing one or more required templates/Lua modules this template relies on. If you want to get all the required templates/modules you can get them via https://en.wikipedia.org/wiki/Special:Export by inserting the template name and ticking the box saying Include templates, and then importing the file generated from that via http://wordpress-251650-782015.cloudwaysapps.com/wiki/Speciale:Importa. However in most cases, except if you desperately want the exact look and feel its easier to write your one template, because Wikipedia templates get enormously complex

yii2: where do my project's own html, css, js, and php-include files go?

Choices:
create an asset bundle (nicely explained by Ivo Renkema at How do I manage assets in Yii2?). this is what I need if I want to package my code for other use. alas, should I also do this for my own php include library functions? Or should I still stick them into the same php location as my other php files? In any case, if I want to go this route, presumably I would then customize the AppAsset class, included in the template, as explained in http://www.yiiframework.com/doc-2.0/guide-structure-assets.html .
stick my files directly into $basePath/web, where $basePath is typically something like /var/www/myapp/ (i.e., as $basePath/html/mine.html [and refer to it simply as href='/html/mine.html'], $basePath/css/mine.css , $basePath/js/mine.js, and $basePath/php/mine.php [and refer to it as $basePath= \Yii::getAlias('#webroot'); require_once('$basepath/php/mine.php') ])?
stick my local files where my php view code sits. the advantage is that the files are close to where I will use them. the disadvantage is that I may litter the view directories not only with php files, but also with my non-asset assets, even though they will be used only by these (my) php files.
it's a beginner's question for the google cache reference. it's about best practice when getting started. I can guess the answer, but we wouldn't want a novice to disseminate bad info.
If you need your CSS and JS files only in one view or one Controller you have 2 choices:
1- Create a asset bundle Here other guide if you need it.
2- Use registerJsFile() from View Class
You can acces from controller using:
Yii::$app->view->registerJsFile('js.path');
(Same with CSS files but using registerCssFile())
With the PHPfiles I always try to convert the code to yii's MVC. If you have a entire library try to add it as a component. Here a usefull guide

Sails.js asset management and referencing

Sorry for the noob question but I'm trying to start up a new application with Sails and include my assets. I'm using Bower to manage my packages for things like Bootstrap and JQuery. I had a read of this question and added a .bowerrc file which is now installing my Bower components to /assets.
I'm now confused as to how I should proceed to add these files into my project. It seems as though I can't just do a <script> tag in the header as I'm used to because it's giving me a file not found. Reading through the sails documentation it seems like Grunt should be creating a .tmp/public/assets folder in my project, but whenever I run sails lift and go to .tmp/ there is nothing in there.
I also read in the documentation that I should be using some kind of asset injection, I tried adding this to my HTML and it seems like it doesn't do anything.
My other question is around how I go about referencing images in my HTML. Obviously I can't just do something like src='assets/images/image.png, how should I go about this? Is there something really obvious that I'm missing?
Sails use grunt tasks to do lot of things during lift and build. You can get much better look how everything work if you take some time and check what is inside Gruntfile.js from root of your sails project.
About your specific question here is some information:
- from sails docs: "In order to take advantage of asset injection, minification, and concatenation you must put your assets in folder under assets/linker". This exactly mean that everything what you will put inside assets/linker directory will be affected by grunt tasks during lift. It mean that all files/directories from linker will be copy to .tmp/public and also some of that files will be processed before saved to .tmp/public.
- About adding tags. If you take a look at Gruntfile.js you will find this variables: var cssFilesToInject = [...] and var jsFilesToInject = [...] which contain files that will be automatic added to layout header during sails lift.
- About your 'other question', yes you can do something like 'src='linker/images/image.png' if you move that files to linker directory (assets/linker).
I hope this help :).

How to add a new page based on page.html (similar to /groups or /dataset)

I have installed and configured one CKAN 2.0.1 instance.
You can check it out here: http://www.caceresabierto.es; as you can see it is still very basic.
My problem is the following, I want to create the page http://www.caceresabierto.es/aplicaciones. I understand that there should be a method to heritage the layout and the basic theming from the main template (if I am not wrong is "base.html" or "page.html" in the 'templates' folder).
The point is: I have figured out how to modify www.caceresabierto.es/dataset or www.caceresabierto.es/groups. But I don't know how to add a new route like www.caceresabierto.es/aplicaciones that heritage from "page.html".
I suppose I will need to create a new HTML file in the 'template' folder and maybe modify setup.py or plugins.py...But I need some help to do it.
Any feedback would be great. Thank you.
Jesús Redondo.
Apologies for cross-posting.
You need to upload a new aplicaciones.html file to your public_html folder and then it will work. I don't think modifying any python files will be necessary.
If you want much of the page to look the same, you can start work on your new aplicaciones.html file by saving your old index.html file with a new name and modifying the relevant information.