On Friday, March 14, 2014 1:52:44 AM UTC-4:30, Rob L wrote: > > The feature list of the project I am wishing to do is: > > - Let users upload some images(a folder contains image files) > - Backend generates static htmls to present those images, basically as > a gallery, via an generated url > - User can select from default themes(templates) > - The template I am talking about here is not django template, they > are a bunch of xhtml, css and js files can be choose from default or > uploaded by user. > - User can upload and use their customized templates > - I made a local Python program that can work for the purpose here: > https://github.com/viewplatgh/pgal, maybe can help you understand > the feature I am trying to implement on the django project > - The workflow is quite similar to http://codepen.io, but what user > inputs are images, optionally templates, css and js files, rather than > html > file itself. The htmls are generated by django app, and create a short url > for people who uploaded/built their resources to view the gallery. > > I know this app don't have to be implemented by using django. I > choose django because Python is the language I'm familiar with and it's the > framework I have a little experience with, but to implement such a site I > have so many questions and don't know where to start. I don't expect an > exact answer to this post, but just hope to collect more helpful > information, resources and ideas from experienced programmers to help me > kick my project off... > > Here is some questions in my mind currently: > > - Would django allow me to write a bunch of files at backend? > - Unlike php, django's urls don't map to server's folders. But I need > that feature to let user view the generated statics. How do I work through > this. Should I generate django templates? > - How to prevent user from uploading malicious stuff to backend... > > Hello,
* Would django allow me to write a bunch of files at backend? Yes, as any python program does. You only need to manage how to upload files to your application and the you can put these files wherever you need in your server file system. *Unlike php, django's urls don't map to server's folders. But I need that feature to let user view the generated statics. How do I work through this. Should I generate django templates? That is right. You should generate your static content in a static directory outside of Django, and that static directory will be served by a web server, not Django directly. See: https://docs.djangoproject.com/en/1.6/howto/static-files/ * How to prevent user from uploading malicious stuff to backend... By filtering the content in some way. There is no way that Django knows what is malicious by itself. You should write code (or user existing tools) to inspect the content uploaded by users and filter what you consider malicious. Regards, Camilo -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4edef3c2-e6ff-423e-84ce-cd1d63f73063%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.