Re: Error with django-admin.py

2018-02-17 Thread Dylan Reinhold
This means your windows system has python files (.py) associated with notepad not python. It's okay, but anything you are going to run a python script like django-admin.py or manage.py you need to run pythin first. > python django-admin.py startproject myapp > python manage.py If you get an

Re: Error with django-admin.py

2018-02-17 Thread Etienne Robillard
Please send the actual traceback and error message. Etienne Le 2018-02-17 à 11:59, Tet Yeap a écrit : Hi,     I was trying to crate a django project using "django-admin.py startproject mysite". The a message showed up in notepad

Strange problem with Django

2018-02-17 Thread Tet Yeap
Hi, I was trying to learn Django. I have installed Python 3.6 and Django. The installation was successful. When I ran "django-admin startproject mysite" to create a new project, the attached file showed up and the program stop. What is wrong? Thank you. Tet Yeap -- You received

Error with django-admin.py

2018-02-17 Thread Tet Yeap
Hi, I was trying to crate a django project using "django-admin.py startproject mysite". The a message showed up in notepad "#!C:\WinPython-64bit-3.6.1.0Qt5\python-3.6.1.amd64\python.exe from django.core import management if __name__ == "__main__":

Re: modelform selection options

2018-02-17 Thread sum abiut
Ok now i have written my view,py def payhistory(request): paynum=selection.objects.all() num=request.POST.get('dropdown') if request.method=='GET': form=paynumberform() else: select=selection.objects.get(num=num) #do someting return

Re: Error with django-admin.py

2018-02-17 Thread Tet Yeap
Hi Dylan, Thank you for the pointers. As you have suggested, after re-installing Python, I am able to continue my work. I must have screw up the path. Regards, Tet Yeap On Saturday, February 17, 2018 at 12:48:58 PM UTC-5, Tet Yeap wrote: > > Hi, > > I was trying to crate a django

Re: When to use get_user_model()

2018-02-17 Thread tango ward
I also checked the documentation of it but I am confuse. It says "Instead of referring to User directly, you should reference the user model using django.contrib.auth.get_user_model(). This method will return

When to use get_user_model()

2018-02-17 Thread tango ward
Hi, I am playing around with user registration. I came across a code where the get_user_model() was assigned to a model in Meta class inside a form. I was just wondering, what is the benefit of using the get_user_model() as Model in a form instead of importing a class from models.py then use that

Re: Syntax Error when trying to migrate to Postgresql

2018-02-17 Thread PASCUAL Eric
Office oriented editors tend to take initiatives for making the text prettier (at least, according to their "standards" ). For programming tasks, you'd better use real programming editors. There are a lot of very good ones which are free, and even full IDEs. I'd strongly suggest PyCharm