Your second Django project

If you’ve followed the steps in the previous blog posts, you should have your first basic Django project up and running. You’ll also have various bits and pieces already installed, ready for your next projects. Here is a brief reminder of what to do for your next project:

  1. Choose a project name, e.g. SecondDjango
  2. Create a virtual environment, and use it
    1. cd <dev root>/envs
    2. virtualenv SecondDjango
    3. source SecondDjango/bin/activate
  3. Install Django and python-mysql into your new virtual environment
    1. (SecondDjango) pip install MySQL-python
    2. (SecondDjango) pip install Django
  4. Create your project
    1. (SecondDjango) cd <dev root>/Projects
    2. (SecondDjango) django-admin.py startproject SecondDjango
  5. Create a new database and user, and enter the details in the settings.py file
  6. Create a new app, add to the INSTALLED_APPS in settings
  7. Create your models, add them to the admin site in the app’s admin.py
  8. Create a superuser: python manage.py createsuperuser
  9. Start the test server (runserver) and check out the admin panel (http://localhost:8000/admin/)