I am trying to run /admin for the project that i am creating.i am facing two problems here
1.when i point my browser to 127.0.0.1/admin/ it says page not found but when i point the browser to 127.0.0.1 then i get the list of files in my project file how to rectify this
2.Every time i restart apache there are no pyc file created??
-rwxrwxrwx 1 root root 546 2012-07-11 15:45 manage.py
-rwxrwxrwx 1 root root 0 2012-07-12 17:53 __init__.py
-rwxrwxrwx 1 root root 34 2012-07-12 18:03 test
-rw-r--r-- 1 root root 114 2012-07-12 18:03 __init__.pyc
drwxr-xr-x 2 root root 4096 2012-07-12 18:20 tmp
-rwxrwxrwx 1 root root 4489 2012-07-12 18:20 settings.py
-rwxrwxrwx 1 root root 585 2012-07-12 18:34 urls.py
I have included django.contrib.admin in installed apps in settings.py file and also this is the urls.py file below
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', '{{ project_name }}.views.home', name='home'),
# url(r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls))
)
EDIT
I have not created any module as yet..Should i be creating a module then access admin ??
EDIT1
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
/etc/apache2/httpd.conf
WSGIScriptAlias / /opt/mysite/wsgi.py
WSGIPythonPath /opt/mysite
<Directory /opt/mysite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
It looks to me that your apache is improperly configured.
Check out these docs:
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/
http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
To be sure, you could start Django on its on development server and see if you can access the admin area.
Try this in your django.wsgi:
apache_django_wsgi.conf:
Then, in your /etc/apache2/httpd.conf (or wherever it is located)