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, but i am getting stuck where it asks for
python manage.py syncdb
At present i do not have any database, so i assumed that SQLite comes with django. Not sure how to go ahead? Also i have downloaded the virtualenv-1.7.1.2 and installed it as well with,
python virtualenv.py ENV
I am following this video tutorial, it asks me to use,
sudo pip install virtualenv
But when i write the above code, the output is,
sudo: pip: command not found
Help me out!!
Django can be installed easily using pip . In the command prompt, execute the following command: pip install django . This will download and install Django. After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.
No you don't have to reinstall Django each time you make a new project, hopefully. Once you have installed it using pip , you just have to enter django-admin startproject <project-name> to get started.
You don't need previous Python or web development experience to complete this book. It is intentionally written so that even a total beginner can follow along and feel the magic of writing their own web applications from scratch.
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:
$ virtualenv --no-site-packages django-env
$ source django-env/bin/activate
(django-env)$ pip install django
(django-env)$ django-admin.py startproject myproject
(django-env)$ cd myproject
(django-env)/myproject$ nano settings.py
settings.py
, after 'ENGINE:'
type 'django.db.backends.sqlite3',
(don't forget the comma)settings.py
, after the 'NAME:'
type 'site.db',
(again, don't forget the comma)(django-env)/myproject$ python manage.py syncdb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With