Django installation first time

前端 未结 4 1920
野的像风
野的像风 2020-12-16 04:59

I started learning DJango for the first time. I have some amount of basic knowledge of python but DJango is first for me. I started with the documentation page of django, bu

4条回答
  •  遥遥无期
    2020-12-16 05:48

    Do not use sudo with virtualenv this is the easiest way to multiple problems later.

    Begin by installing virtualenv - sudo apt-get install python-virtualenv

    Next, as your normal user run the following commands:

    1. $ virtualenv --no-site-packages django-env
    2. $ source django-env/bin/activate
    3. (django-env)$ pip install django
    4. (django-env)$ django-admin.py startproject myproject
    5. (django-env)$ cd myproject
    6. (django-env)/myproject$ nano settings.py
    7. In settings.py, after 'ENGINE:' type 'django.db.backends.sqlite3', (don't forget the comma)
    8. In settings.py, after the 'NAME:' type 'site.db', (again, don't forget the comma)
    9. Save the file, and exit the editor
    10. (django-env)/myproject$ python manage.py syncdb

提交回复
热议问题