Create a new Django project
NOTE: If you are using Django 1.x, you need to replace the python3 command with python.
The location of the Django projects folder depends on the platform. The projects folder is located at installdir/apps/django/django_projects (on Linux and Mac OS X), at C:\Documents and Settings\USER\Bitnami DjangoStack Projects (on Windows 2000, Windows XP and Windows 2003 Server) and at C:\Users\USER\Bitnami DjangoStack Projects (on Windows Vista, Windows 7 and Windows 2008 Server).
Follow the steps below:
Change to your projects folder and run the following command to create a new project. Replace the PROJECT placeholder with the name of your project in this and all subsequent commands.
$ django-admin.py startproject PROJECT
If you wish to create a new application inside the project, execute the following commands as well. Replace the APP placeholder with the name of your application in this and all subsequent commands.
$ cd PROJECT $ python3 manage.py startapp APP
Edit the installdir/apps/django/django_projects/PROJECT/APP/views.py file and add this content:
from django.http import HttpResponse def index(request): return HttpResponse("Hello world!")
Create the installdir/apps/django/django_projects/PROJECT/APP/urls.py file and add these lines to it:
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), ]
Edit the installdir/apps/django/django_projects/PROJECT/PROJECT/urls.py file and modify it to look like this:
from django.conf.urls import url from django.urls import include urlpatterns = [ url(r'^APP/', include('APP.urls')), ]
Follow the steps to deploy your Django project with Apache.
You should now be able to see your new application at http://localhost/PROJECT/APP.
If you prefer to use the standalone server in Django, refer to this section. In this case, you should be able to see your new application at http://localhost:8000/APP.
To get started with Django, check the official Django documentation for the version that you are using.