little trouble while trying to run emencia.django.newsletter - django

I did exactly (or so I think) as the docs describe to install emencia.django.newsletter (https://github.com/Fantomas42/emencia-django-newsletter). I installed all dependencies and emencia.django.newsletter from github. All installed successfully.
I also added this in my urls.py
urlpatterns += patterns('',
url(r'^newsletters/', include('emencia.django.newsletter.urls')),
)
I synced the database and when I give http://localhost:8000/newsletters/ (even having logged in as admin) I get a 404 error page.
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/newsletters/
[...]
^newsletters/ ^mailing/
^newsletters/ ^tracking/
^newsletters/ ^statistics/
^newsletters/ ^ ^preview/(?P<slug>[-\w]+)/$ [name='newsletter_newsletter_preview']
^newsletters/ ^ ^(?P<slug>[-\w]+)/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$ [name='newsletter_newsletter_contact']
^dowser/
^media/(?P<path>.*)$
Where did I go wrong?

Obviously there is no page at /newsletters/ as you can see in the urls.py.
Try /newsletters/mailing/

Related

Page not found (404) Request Method: GET

Request Method: GET
Request URL: http://127.0.0.1:8000
Using the URLconf defined in DjangoAPI.urls, Django tried these URL patterns, in this order:
admin/
^ ^department$
^ ^department/([0-9]+)$
^ ^employee$
^ ^employee/([0-9]+)$
^ ^employee/savefile
^ ^Photos/(?P<path>.*)$
The empty path didn't match any of these
Yesterday the Django portion of the project was fine and now I'm getting this error message. I've tried adding /home/ at the end of 127.0.0.1:8000 and still getting the same thing. Any help would be greatly appreciated.

Installed django on hostgator(shared), but it's giving 404 error instead of showing Welcome page

I have installed Django on Hostgator shared plan.
I am able to access to mydomain.ca/admin (actually mydomain.ca/index.fcgi/admin), and able to login as superuser.
However, when I go to mydomain.ca, it displays
Page not found (404)
Request Method: GET
Request URL: http://mydomain.ca/index.fcgi/
Using the URLconf defined in src.urls, Django tried these URL patterns, in this order:
^admin/
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
If I'm correct, it should show "It worked!" website instead, since I have not added anything to my app yet.
I have followed the tutorial on http://support.hostgator.co.m/articles/django-with-fastcgi
My .htaccess looks exactly same as the one in the tutorial, and my index.fcgi looks like
.#!/home/user/mydjango/bin/python
import os
import sys
sys.path.insert(0, "/home/user/mydjango/source")
os.environ['DJANGO_SETTINGS_MODULE'] = 'src.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
Could anyone assist me to solve this problem?
Thank you!

Django's URL regex engine is failing

Django's URL regex engine is failing and I have no idea why. Even my sanity checks are failing horribly.
Here's my urls.py:
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^a', 'placemyorder.views.home', name='home'),
)
I get this 404 error:
Page not found (404)
Request Method: GET
Request URL: http://[ip address]/a/
Using the URLconf defined in placemyorder.urls, Django tried these URL patterns, in this order:
1. ^a [name='home']
The current URL, , didn't match any of these.
when I visit
http://[ip address]/a
And it's hosted on Django 1.5.2 with Python 2.7.3 on Ubuntu 12.04 behind nginx if that info is relevant.
Here's a clue: The current URL, , didn't match any of these.
It should say: The current URL, http://[ip address]/a, didn't match any of these.
So the dispatcher isn't getting the request url.
Take a look at this solution:
Django + NGINX URL Problem

GET / HTTP/1.1" 404 2032

i'm trying to install Fang of Mongo, i did all the steps required but whe i try to go to the http page i have got this error message:
muratalina#muratalina-To-be-filled-by-O-E-M:~/Documents/Fang-of-Mongo/fangofmongo$ python ./manage.py runserver
Validating models...
0 errors found
Django version 1.4.3, using settings 'fangofmongo.settings'
Development server is running at "http://127.0.0.1:8000/"
Quit the server with CONTROL-C.
[29/Jan/2013 12:36:52] "GET / HTTP/1.1" 404 2032
when i go to "http://127.0.0.1:8000/fangofmongo/" page i have got this error
The base URL for Fang-of-Mongo is:
(r'^fangofmongo/', include('fangofmongo.fom.urls')),
This means that you will need to navigate to http://127.0.0.1:8000/fangofmongo.
There is no base URL http://127.0.0.1:8000/ defined - so it will 404.
EDIT: Also Fang-of-Mongo appears to have gone 3 years, at least on Github, without an update - so you will most likely encounter other issues with the project running on Django 1.4.3.
Make sure you imported the include function in the urls.py, else add "from django.urls import include"
Here is how to Include another URLconf (in urls.py file)
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))

admin/appname/modelname urls does not work with mod_wsgi in Django 1.1rc1

I'm using Django 1.1 rc1 and Apache 2.2.8 on Ubuntu with mod_wsgi 1.3.1 + Python 2.5.2.
Everything worked fine with Django's internal testing web server, but after migrating to Apache mod_wsgi, all urls like /admin/appname/modelname/ began not to work. They shows 404 not found errors with the following log:
...
^admin/ ^$
^admin/ ^logout/$
^admin/ ^password_change/$
^admin/ ^password_change/done/$
^admin/ ^jsi18n/$
^admin/ ^r/(?P<content_type_id>\d+)/(?P<object_id>.+)/$
^admin/ ^(?P<app_label>\w+)/$
The current URL, admin/account/userprofile/, didn't match any of these.
Strangely, /admin/appname/ and all other parts including my custom urls just work fine.
Is it a bug of Django or configuration issue? And how to solve it?
I know that 1.1RC1 made some changes to the admin URL resolver to use namespaces: this might be your problem.
see here: http://docs.djangoproject.com/en/dev/releases/1.1-rc-1/
Other than that it looks like the URLs are not correct as the last line of the urls in the debug trace would only match /admin/app/ rather than /admin/app/xxxx. The information here might help.
for some reason this ^admin/ ^r/(?P\d+)/(?P.+)/$ doesn't look right wouldn't that give /admin//xxx/yyy/ ?
Edit: no it gives /admin/r/xxx/yyy/
I can't test this right now as I only have 1.0.2 available on this computer (and no mod_wsgi) - I will test on 1.1 when I get home tonight.
Edit: Looks like this
for model, model_admin in self._registry.iteritems():
urlpatterns += patterns('',
url(r'^%s/%s/' % (model._meta.app_label, model._meta.module_name),
include(model_admin.urls))
)
return urlpatterns
is not working for some reason, as the URLs are not included in the search path in the debug trace. Are the admin.py files correct?