Install Pyhton From Python Site: A) To Check Python Installation
Install Pyhton From Python Site: A) To Check Python Installation
1 – Install Pyhton from Python site and make server environment for project preparation such as pip,
virtual environment creation etc.
3 – Install Pycharm
open DOS in admin mode – Python –enter- show python version and open python
prompt(>>>)- check and put 2*5- enter – 10.- python installation ok.
Or
Django 2.2.1
pip 19.1.1
pytz 2019.1
setuptools 40.8.0
sqlparse 0.3.0
To check proper pip installation – type ‘pip’ on dos prompt – list of pip details appear
To check pip version – type ‘pip - - version’ – enter.
pip 19.1.1 from c:\python\lib\site-packages\pip (python 3.7)
To install virtual environment –
C:\Windows\system32>
To create project folder in virtual environment –
C:\Windows\system32>mkvirtualenv vksu3 – press enter
C:\Users\RAJ\Envs is not a directory, creating
Using base prefix 'c:\\python'
New python executable in C:\Users\RAJ\Envs\vksu3\Scripts\python.exe
Installing setuptools, pip, wheel...
done.
(vksu3) C:\Windows\System32>
To work on vksu3 project (django is installed individually)
Install Django
You have 17 unapplied migration(s). Your project may not work properly until you apply the
migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
May 14, 2019 - 09:08:37
Django version 2.2.1, using settings 'pypro.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
To run django server -
Open web browser – type ‘localhost:8000’ – enter
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
How to run python web server
At terminal= python manage.py runserver
(To come out from server ctrl+c/ctrl+break)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'rkm',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
}
class Userregistration(models.Model):
uid = models.CharField(max_length=15)
uname = models.CharField(max_length=30)
uemail = models.EmailField()
umobile=models.IntegerField(blank=True, null=True)
uregdate=models.DateField(default=datetime.now)
uregtime=models.TimeField(default=datetime.now)
uaddress=models.TextField(blank=True, null=True) # for text area
class Meta:
db_table = "ureg"
class UserregistrationForm(forms.ModelForm):
class Meta:
Model = Userregistration
# fields = ("uid","uname")
fields = "__all__"
Now in Settings.py file – In installed Apps area – at the end line – attach app here as –
‘'userregpage',