Creating a Django Project and Application

We'll start off by creating a new Django project called www_example_com. As you already know from Chapters 3 and 4, the project in fact becomes a Python module with its init methods and possibly submodules (the applications within the project). Therefore, the project name has to follow the Python variable naming conventions and cannot contain dots or start with a number. Start a new project first:

$ django-admin startproject www_example_com

At this point you should be able to navigate to the web site URL that you defined earlier (in our example it's http: // and you should see the standard Django welcome page.

The next step is to create a new application within the project. You must follow the same naming rules as with the project name when you choose a name for your application. I'll simply call it httpconfig:

$ django-admin startapp httpconfig

Was this article helpful?

0 0

Post a comment