Bitnam Django creates several projects

So, I have this instance of Bitnami EC2, which by default had the project "Project" (in / apps / django / django_projects), so I started following the django tutorial and did everything. I can access this project in

http://myIp/Project/. 

So, having finished the tutorial, I went to create my own project. I created a project using

 django-admin.py startproject DoE 

in the same directory as the Project project (i.e. / apps / django / django_projects), followed by

 python manage.py runserver 0.0.0.0:8000 

But the problem is that I turn to

 http://myIp/DoE/ 

I get this error:

 Not Found The requested URL /DoE/ was not found on this server. 

Any help would be greatly appreciated. Thanks in advance:)

+3
source share
1 answer

I found a way around this problem, a bit hacked, but it does the job. I got it from here http://wiki.bitnami.org/Components/Django . But they imply that you only need to do this if you are using an Apache web server that is not there. I use the django development server, but it works nonetheless.

Basically, I had to create a DoE.conf file in / home / bitnami / apps / django / conf, which looks like this:

 Alias /static "/opt/bitnami/apps/django/lib/python2.7/site-packages/django/contrib/admin/static" <Directory '/opt/bitnami/apps/django/lib/python2.7/site-packages/django/contrib'> Order allow,deny Allow from all </Directory> WSGIScriptAlias /DoE "/opt/bitnami/apps/django/scripts/DoE.wsgi" <Directory '/opt/bitnami/apps/django/scripts'> Order allow,deny Allow from all </Directory> 

and then create a file called DoE.wsgi in / home / bitnami / apps / django / scripts that looks like this:

 import os, sys sys.path.append('/opt/bitnami/apps/django/django_projects') sys.path.append('/opt/bitnami/apps/django/django_projects/DoE') os.environ['DJANGO_SETTINGS_MODULE'] = 'DoE.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() 

after that I had to turn on

 /opt/bitnami/apps/django/conf/DoE.conf 

in my httpd.conf file, which for my case was here: / opt / bitnami / apache2 / conf

After that I restarted my computer / server and everything was fine :)

+5
source

All Articles