Sharing only the templates without giving access to source code - django

I'd like to share the templates of the website I've done with a graphist. My problem is that I dont want him to access the Python code at all.
It's easy to share a folder and give access to it through sftp.
I was wondering if it were possible given a right tag, to access my Python code. I know for example that with Php/Smarty or with Php/Twig, you can execute Php code, which means you can read whatever you want, including all the source files (I've done it to test). So sharing Php templates files and thinking "my source code is safe" is a mistake.
I'm a beginner with Django, and I'm wondering if there's a way to access the source files through Django template system / or not?

Django's template system is specifically written with this use case in mind; the original developers, at the Lawrence Journal-World newspaper in Kansas, wanted to be able to give the templates to designers to produce, while working on the Python code themselves.
There is no way to access arbitrary Python code from a Django template.

Related

Writing to Django-mapped tables from outside the project

Is there anything specifically that I should do or refrain from doing? The only thing I have found so far is that I should create the tables initially using Django's ORM.
I haven't found any resources specific to this topic which makes me think the answer is either very obvious or that this isn't done much, which probably means it's a bad idea.
Details: I have a standalone C# program that reads a file and exports the data to a PostgreSQL database. I would like to make a website where users can upload these types of files and query the data generated by the program. I really like python and I have done a number of projects with it (but not Django), and my experience with C# and .NET so far has been fairly negative. I have also done the Django tutorial, some of Tango, and I'm reading Two Scoops of Django, all of which make me think I will like working with Django.

Adding Code Snippet in PentaHo kettle User defined java Class

I had written some custom code using java . I want to add the code to the User defined java class in Kettle in the code snippets section. Is there a way to add the custom code snippets in the Classes and code fragment in UDJC so that it can be reusable.
Thanks.
For the moment there is no ability to add code snippets using ui at runtime. You can submit issue with pentaho jira if you want this functionality. Or just as workaround you can edit codeSnippits.xml (situated under lib/kettle-ui-*.jar/org/pentaho/di/ui/trans/steps/userdefinedjavaclass/) and re-zip this file back to the jar.
I would not recommend going down this path.
The reason is very simple, UDJC in PDI is Janino, a rather minified (but super fast) Java compiler, and I quote the Pentaho wiki for User Defined Java Class:
Not 100% Java... The first thing to know is that Janino and as a
consequence this step doesn't need the complete Java class... the
most apparent limitation is the absence of generics
What happened if we'd been able to add code snippets on the fly? Probably not good things.
However, and this is very useful, consider wrapping your code in a JAR package as suggested in the comments, include it in the lib-ext folder of your PDI environment and import it to User Defined Java Classes at will. IMHO, this is the right way.
I hope this helps a bit.

How to create a login application with Visual Basic (using WebHttpRequest)

Hei there, I'm not experienced at all in C++ as I need to start learning year the next year at my university, though, I've been creating a browser based game and I'm looking for someone to transform it into pc app.
Though, I'm wondering how to make that application send a http request via POST to a file on my webserver with the username / pw.
After all the tutotials I've been reading, I concluded that none worth spending my time with, because they all based on own database, and I'm looking for one that connects to a maestro server and requests the data from there.
This may not be the answer you are looking for, but you may consider two alternatives to a more pure C++ application.
If you already have a working browser game, try to take that same code and put the html/javascript/whatever in a file and give the file a ".hta" extention. It basically opens inside a browser to run your files, but it acts more like an application from the user's viewpoint. (And, as much as I hate Windows, they're pretty fun to create if I may say so). However, your source code with this option is easily read because it can be renamed to a text file (or html file).
You could use Visual C++ (or VB.net, which you have tagged to the question, as well as "Visual" C#) to create an application which mostly consists of a browser view. It could be a "standalone" application (however would rely completely on the .Net framework - may or may not be what you want) that basically accomplishes the same as the option above, but adds that you can "hide" your files inside your application.
Using the two above alternatives, you could make an application relatively quickly that would load your files, which I assume you have already created. Note that neither of the above alternatives will work on anything other than Windows OS's.
If the two above alternatives are not what you want, or if you have questions about either one, I'd be glad to attempt to help.
I've been able to find a friend that would do it in Delphi because I wouldn't want users to download net framework just for this ap.
So the program that would fit most for any apps is Delphi Prism XE (even if it's an addon of Visual Studio)

Module overriding in Joomla 1.6

I am new to Joomla, started learning it just a day ago and didn't manage to find an answer to my question in the docs (which suck real bad compared to Drupal).
So what I want to do is override the whole module in a template. The documentation only suggests I can override the markup of a module by placing corresponding files in the html folder, but I have to make some corrections to the actual logic. Is copying the module, changing and then installing it as a separate entity the only way to go? I mean it makes sense that "template" folder is for "views" but with the kind of application I have to develop it is gonna be annoying...
Yeah, you can only override views.
If you want to override logic, you have 2 options:
Change the actual logic in-place, which leads to problems on updating etc
Duplicate the module and change the logic, as you suggested
One other way to consider is to replicate or fix the logic in the template. While this is not a very slick way of doing it, it is faster, especially than duplicating a whole component.
Note that you can also add your own libraries to the Joomla libraries folder to centralize your own code.
Further, if you manage your code with (for example) svn, you should not have any problems on upgrades with creating new views that may include their own logic.

How to create a little database with search function and pdf download / upload

I'm trying to code a small program for my friend's company. They build metal cabinets and every cabinet is made out of several parts. So when a customer tells them they need a new cabinet, they tell them the single part numbers. My friend needs now a little tool/database where he can look after those part numbers and if there is an entry, he can download the corresponding blueprint (saved as PDF). Of course the program needs also a function to create a new entry and uploading a PDF file with this entry.
The program needs only to be installed local on one windows machine.
Now I need to know if there is maybe a special way to solve this. It would be helpful if someone could give me some keywords, so I can google it and figure out how to begin :)
I have basic skills in C++ and Java and willing to learn new stuff :)
thanks!
Have used sqlite for database applications and found it to have a lot of functionality and speed. It lacks all the advanced database admin stuff but for single user/embedded databases its ideal. I use it over MySQL because of a significant performance improvement.
It has a Java interface via java.sql.Connection.
I think this is a good opportunity to try something else than C++/Java. In your case I would go for Ruby on Rails and for example the PaperClip extension (http://thoughtbot.com/community/) (haven't used PaperClip myself, though). Ruby on Rails is kind of made for this type of problem.