Django: Starting your first project

Assuming that Django has been installed and configured correctly, its quick and simple for you to start new projects.

Firstly, go to the folder you'd like to place the project and type:

django-admin startproject yourproject

Change the directory into "yourproject" and create a new app for a new component in your project:

django-admin startapp yourname

Now you have a project called "yourproject" and application called "yourapp".

Modify the "settings.py" file to configure your project. Take this opportunity to set up your database information while the file is open.

To include your application into the project, add the line "yourapp" to the list of installed applications in "INSTALLED_APPS".

Run the server and test if it works properly.

./manage.py runserver

or

python manage.py runserver

 

Now you can start setting up pages and serve CSS and JS files. For more guides, see the django tag.

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog