3

I followed these steps,

https://wiki.bitnami.com/Infrastructure_Stacks/BitNami_Django_Stack#How_to_create_a_new_Django_project.3f

and I created a new Project succesfully. But when I go to localhost/SevenERP/product_app, it throws me this error:

Not Found

The requested URL /SevenERP was not found on this server.

What's the problem?. This is my folder structure:

Folder Structure

These are my .conf files:

httpd-app.conf

<Directory "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/SevenERP">
    Options +MultiViews
    AllowOverride All
    <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
        Require all granted
    </IfVersion>


WSGIApplicationGroup %{GLOBAL}
    <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
        Require all granted
    </IfVersion>

</Directory>

Alias /static "C:\Bitnami\djangostack-1.8.7-0/apps/django/lib/python2.7/site-packages/django/contrib/admin/static"
WSGIScriptAlias /SevenERP 'C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/SevenERP/wsgi.py'

httpd-prefix.conf

# Include file
Include "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/conf/httpd-app.conf"

httpd-vhosts.conf

<VirtualHost *:80>
    ServerName djangostack.example.com
    ServerAlias www.djangostack.example.com
    DocumentRoot "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/SevenERP"

    Include "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName djangostack.example.com
    ServerAlias www.djangostack.example.com
    DocumentRoot "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/SevenERP"
    SSLEngine on
    SSLCertificateFile "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/conf/certs/server.crt"
    SSLCertificateKeyFile "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/conf/certs/server.key"

    Include "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP/conf/httpd-app.conf"
</VirtualHost>

Because the default Project that has been installed from the bitnami installer works fine:

Default Project installed by bitnami installer

Please help.

juanpscotto
  • 990
  • 1
  • 13
  • 32

3 Answers3

2

You have to modify 2 file in the apache server

/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf

you will see somehitng like this:

# Bitnami applications installed in a prefix URL

Include "/opt/bitnami/apps/django/django_projects/Project/conf/httpd-prefix.conf"

there you have to include the path of the httpd-prefix.conf that you create in your project.

Include "/opt/bitnami/apps/django/django_projects/YourProject/conf/httpd-prefix.conf"

Change YourProject for the name of your proyect and you have to delete the "include" that points to Project, otherwise you have to config:

/opt/bitnami/apps/django/django_projects/Project/conf/bitnami-apps-vhosts.conf

for multiple sites.

Final file look like this:

# Bitnami applications installed in a prefix URL

Include "/opt/bitnami/apps/django/django_projects/Host/conf/httpd-prefix.conf"

In the file:

/opt/bitnami/apps/django/django_projects/YourProject/conf/httpd-app.conf

add this:

Alias /static "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/contrib/admin/static"
WSGIScriptAlias / '/opt/bitnami/apps/django/django_projects/YourProject/YourProject/wsgi.py'

Then

If you installed BitNami Django stack as root or if you are using a virtual machine or cloud image, use sudo for installing the requirements and start the server:

$ cd mysite
$ sudo pip install -r requirements.txt

*/ Config your Database in settings.py */ https://wiki.bitnami.com/Components/Django

$ python manage.py syncdb
$ sudo /opt/bitnami/ctlscript.sh restart apache

Here more info:

https://www.youtube.com/watch?v=6kknDPGYr3I

https://community.bitnami.com/t/installing-pinax-on-djangostack-virtual-machine/3286/7

unixeo
  • 1,116
  • 1
  • 15
  • 28
1

As per the Bitnami Django Link which you've shared,

There's no step for including the app name in INSTALLED_APP in settings.py.

You must register the app name, else the URL which you've configured as Controller will not be utilized.

I hope this will fix for you.

Solution

Damian Kozlak
  • 7,065
  • 10
  • 45
  • 51
Sanjay Pradeep
  • 407
  • 5
  • 6
1

Bitnami developer here.

The issue is related with python path. For UNIX, you should add these lines at the beginning of httpd-app.conf file:

WSGIDaemonProcess wsgi-djangostack processes=2 threads=15 display-name=%{GROUP} python-path=/Path-to-the-project/

And then, restart Apache.

In your case (Windows), you should add this line add the end of you installdir\apache2\conf\httpd.conf:

WSGIPythonPath "C:/Users/JuanPablo/Bitnami Django Stack projects/SevenERP" And restar Apache.

I hope it helps

David Gomez
  • 644
  • 5
  • 9