[Django – Blog Application] – P.1 – Setup environment

Use virtualenv to create isolated Python environments. Run the following command in your shell to install virtualenv

pip install virtualenv

create an isolated environment with the following command:

mkdir /venvs
cd /venvs
virtualenv django-blog

activate your virtual environment:

source django-blog/bin/activate

install newest Django version

pip install Django

Incase you would like to install specific version

pip install Django==1.8.6

Creating your rst project

cd Projects/
django-admin startproject django_blog

Do Migration

cd django_blog
python manage.py migrate

Then, you will see the output like this.

Rendering model states... DONE
   Applying contenttypes.0001_initial... OK
   Applying auth.0001_initial... OK
   Applying admin.0001_initial... OK
   Applying contenttypes.0002_remove_content_type_name... OK
   Applying auth.0002_alter_permission_name_max_length... OK
   Applying auth.0003_alter_user_email_max_length... OK
   Applying auth.0004_alter_user_username_opts... OK
   Applying auth.0005_alter_user_last_login_null... OK
   Applying auth.0006_require_contenttypes_0002... OK
   Applying sessions.0001_initial... OK

Start the development server by typing the following command from your project’s root folder:

python manage.py runserver --settings=django_blog.settings

For deployment on LIVE environments, please follow the instructions in this link below:

https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/

Browse to link http://127.0.0.1:8000/    to see the result.

 

Leave a Reply

Your email address will not be published. Required fields are marked *