Re: Django template

2019-02-08 Thread Mikko Meronen
Hi, I haven't used any other framework, so maybe someone else can better answer that. But using my logic I think that if I want to change framework, I just have to know how to connect again my database to my html, which is just to learn the new framework logic I guess. But as I said, hopefully som

Re: Django template

2019-02-08 Thread Tom Zhang
Thanks. I know how to do this according to Django way. But if you use Django's way to transfer data, it makes it difficult to move to other frameworks, right? What do you think? On Saturday, February 9, 2019 at 1:42:19 AM UTC-5, Mikko wrote: > > Hi, > > You can connect your backend to frontend u

Re: Django template

2019-02-08 Thread Mikko Meronen
Hi, You can connect your backend to frontend using views.py file. In views.py you can get and sort your data from SQL and send it to your html. You probably should do tutorial or watch youtube videos (as I did since I get bored in reading very fast) to learn more. CodingEntrepreneur has done quit

Re: Problems with CRUD, in update

2019-02-08 Thread Perchouli
Hi Ciuni, Maybe your url already is path('updateTabacchi/', I think question is {{ form }}. {{ form }} is to render fields without id. Add the if you want to get the id from request.POST: {% csrf_token %} {{ form}} On Fri, Feb 8, 2019 at 4:30 PM Giuseppe Ciuni wrote: > Hi gu

Re: Django template

2019-02-08 Thread Tom Zhang
Thanks. But if I do this way, how do I transfer data between back-end and front-end? Do I use post request? On Friday, February 8, 2019 at 8:35:28 PM UTC-5, Nitin Kalmaste wrote: > > You are correct, > You are using HTML and JavaScript as template in django. You need to store > static files lik

Re: Django template

2019-02-08 Thread Nitin Kalmaste
You are correct, You are using HTML and JavaScript as template in django. You need to store static files like css/images/JavaScript in static folder and configure static folder in the settings file On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen Hi, > > Have to say that Im still beginner in Django and

Problems with CRUD, in update

2019-02-08 Thread Giuseppe Ciuni
Hi guys I'm learning django and I am doing some tests with CRUD using crispy forms: I created a model and I can create and read data without any problem. I have problem in update. I get this error: postalgps.models.Tabacchino.DoesNotExist: Tabacchino matching query does not exist *In mode

Re: Django timezone problem

2019-02-08 Thread Mikko Meronen
Hi, But if I get the visitor's timezone using JS and send it to Django using AJAX and also do the changes below Alvaro suggested: from django.utils import timezone import pytz # Set user's timezone tzinfo = pytz.timezone(request.session['timezone']) #request.session['timezone'] = 'America/Los_

Re: Django timezone problem

2019-02-08 Thread Perchouli
Hi Mikko, *t = timezone.now()* just get UTC timezone when USE_TZ=True. Modify as follows: tzinfo = pytz.timezone('end user's timezone') timezone.activate(tzinfo) t = timezone.localtime(timezone.now()) On Fri, Feb 8, 2019 at 12:50 PM Mikko Meronen wrote: > Hi Alvaro, > > If I do

Re: Django timezone problem

2019-02-08 Thread Josiah Jenson Nawaya
Hi, i believe what the system do with your timezone.now() function call is ton currently get the timezone of the location where your server is located. So if your hosting server is in England, it gets the server location timezone. U will need to first find a way to get the visitors location and get

Re: Django timezone problem

2019-02-08 Thread Mikko Meronen
Hi Alvaro, If I do that (JS and AJAX), do you think my views.py is already correct? *T = timezone.now()* is important for me in order to get the right data from sql for the end user. *Views.py* from django.utils import timezone *t = timezone.now()* [this should detect end user's timezone] dm = t

Re: Django timezone problem

2019-02-08 Thread Alvaro Chen
Set the timezone for the user via a property on the user is the best way. Otherwise, JS can detect the user's time zone. Use moment.js ( https://momentjs.com/timezone/docs/#/using-timezones/guessing-user-timezone/) or Intl ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glob

Re: Django template

2019-02-08 Thread Tom Zhang
I will give it a try first. Thanks On Friday, February 8, 2019 at 2:30:39 PM UTC-5, Mikko wrote: > > Hi, > > Have to say that Im still beginner in Django and coding, but I think you > just create you html files to your templates folder, and in the end you are > basically using just html. Django

Re: Django template

2019-02-08 Thread Mikko Meronen
Hi, Have to say that Im still beginner in Django and coding, but I think you just create you html files to your templates folder, and in the end you are basically using just html. Django can just find your html file from templates folder. Im just learning javascript and I assume i can save my js-

Django template

2019-02-08 Thread Tom Zhang
Hi, all, If I don't want to use Django template engine and I just want to use regular html/javacript, how do I configure settings.py? I am thinking about the portability issue. For example, if I want to move away from django in the future, I hope my templates can still be used in other framewor

Django template

2019-02-08 Thread Tom Zhang
Hi, If I don't want to use any Django template and I just want to use regular html/javascript, how should I setup the template config in settings.py? Right now, my settings are: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.jo

Re: How to display file&folder tree using Django. Help, please!

2019-02-08 Thread Mario R. Osorio
If you're just looking into just presenting trees, you might want to check How TO - Tree View (https://www.w3schools.com/howto/howto_js_treeview.asp) or Bootstrap Tree View (https://github.com/jonmiles/bootstrap-treeview, http://jonmiles.github.io/bootstrap-treeview/) If you are looking for a

RE: Password Policy Adherence. Cannot use the passwords used before

2019-02-08 Thread Matthew Pava
I completely support this NIST policy, James. Unfortunately, the PCI Security Standards Council does not support this policy at this time. In order for a company to be PCI compliant, users must change their passwords every three months. PCI compliance is essential for companies to adhere to w

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-08 Thread James Bennett
I'm going to suggest you step back and consider whether the policies you want to implement are good policies. A good, solidly-researched set of recommendations is NIST SP800-63B: https://pages.nist.gov/800-63-3/sp800-63b.html In particular, NIST suggests the following: * Do not use a policy whic

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-08 Thread Jason
I haven't found anything like a drop-in replacement, but this should be fairly simple for you to do. when a password changes, the hash of the former password is stored in a different table with a reference to the user and the timestamp. when a new password is entered in as a reset, you compare

How to display file&folder tree using Django. Help, please!

2019-02-08 Thread Yura
Hello everyone! I really need help. I’ve got SQL table which contains exhaustive files and folders information and I need to show tree of those files on a website. But not only show, it’s supposed to be interactive, so that a user can scroll, open folders and mark any of the items. I think it m

Re: Exception happened during processing of request from ...

2019-02-08 Thread Pedram Badakhchani
I am getting similar errors, also running Django 2.15 with python 3.72, would be very interested if you have found a solution On Thursday, 31 January 2019 15:52:38 UTC, Jon bae wrote: > > Hello, > I'm running here *django 2.1.5* with *python 3.7.2* (installed with > homebrew) on a macOS (mojave)