Django Parler throwing 404 error when switching language

2022-01-19 Thread nonw...@gmail.com
 I created a website that will be translated into different languages using 
the Django Parler package, my default language is English, but I was told 
by my client to make the website load French by default and then a user can 
switch to English if he or she wants. I was able to make the site load 
French by default by creating a middleware and adding it to settings, but 
my challenge is this, I can't switch the site to English, If I do it gives 
me a 404 error here is the link to the site site 
https://ambassadedusaintesprit.com

*Middleware*
from django.conf import settings
from django.utils import translation

class ForceLangMiddleware(object):


def __init__(self, get_response):
self.get_response = get_response

def __call__(self, request):
language_code = 'fr' 
translation.activate(language_code)
response = self.get_response(request)
translation.deactivate()
return response

*My Settings* 
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'ambassade_app.middleware.ForceLangMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
   
]
LANGUAGE_CODE = 'en'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LANGUAGES = (
('fr', _('French')),
('en', _('English')),

)

PARLER_LANGUAGES = {
None: (
{'code': 'fr',},
{'code': 'en',},
),
'default': {
'fallback': ['fr',],
'hide_untranslated': False,  

}
}

PARLER_DEFAULT_LANGUAGE_CODE = 'fr'

*base.html*

   {% csrf_token %}
   
   
  {% get_current_language as LANGUAGE_CODE %}
  {% get_available_languages as LANGUAGES %}
  {% get_language_info_list for LANGUAGES as languages %}
  {% for language in languages %}
 
{{ language.name_local }} ({{ language.code }})
 
  {% endfor %}
   
   

   



  


  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9bd91348-ead9-4a66-9b39-d2a157b02000n%40googlegroups.com.


Re: 404 error

2020-09-12 Thread Spyke Lionel
yes I did. it should work properly.
I just wanna display a list of items after the link has been clicked.
But it happens that I get http://127.0.0.1:8000/music//
The last forward slash shouldn't have added.
This work when the integer is inserted manually on the address.
http://127.0.0.1:8000/music/2/
But I want it to happen this way when a link is clicked

On Sat, Sep 12, 2020, 9:55 AM Kunal Solanke 
wrote:

> Did you try what I told?
>
> On Sat, Sep 12, 2020, 14:05 Spyke Lionel  wrote:
>
>> I don't understand how the url became
>> http://127.0.0.1:8000/music//
>> Instead of http://127.0.0.1:8000/music//
>>
>>
>> On Sat, Sep 12, 2020, 8:29 AM 'Amitesh Sahay' via Django users <
>> django-users@googlegroups.com> wrote:
>>
>>> You are trying "http://127.0.0.1:8000/music//;
>>> 
>>>
>>> try something like
>>>
>>> http://127.0.0.1:8000//
>>>
>>> Regards,
>>> Amitesh
>>>
>>>
>>> On Saturday, 12 September, 2020, 12:55:57 pm IST, Kunal Solanke <
>>> kunalsolanke1...@gmail.com> wrote:
>>>
>>>
>>> I think he have created the music url,
>>> But the {{album_id}} is not properly passed as context from view.
>>>
>>>
>>> On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users <
>>> django-users@googlegroups.com> wrote:
>>>
>>> At the first glance, I think you havn't created URL pattern for "music".
>>> May bejust saying.
>>>
>>> Regards,
>>> Amitesh
>>>
>>>
>>> On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel <
>>> ndilion...@gmail.com> wrote:
>>>
>>>
>>> I have this urlpatterns..
>>>
>>> urlpatterns = [
>>> path('', views.index, name='index'),
>>> path('/', views.detail, name='detail'),
>>> ]
>>>
>>> my index.html looks like this
>>>
>>> Albums to display
>>> 
>>> {% for album in all_albums %}
>>>  {{ album.album_title
>>> }}
>>> {% endfor %}
>>> 
>>> #my index.html simply displays my albums. and the above works just fine
>>>
>>> my detail.html looks like this
>>>
>>> {{ album }}
>>> #and it works just fine too
>>>
>>> my views.py looks like this
>>>
>>> def index(request):
>>> all_albums = Album.objects.all()
>>> return render(request, 'music/index.html', {'all_albums':
>>> all_albums})
>>>
>>> def detail(request, album_id):
>>> try:
>>> album = Album.objects.get(pk=album_id)
>>> except Album.DoesNotExist:
>>> raise Http404("Album does not exist")
>>> return render(request, 'music/detail.html', {'album': album})
>>>
>>> #when ever I click on an album link to get the album details, I get the
>>> 404 below:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://127.0.0.1:8000/music//
>>>
>>> Using the URLconf defined in website.urls, Django tried these URL
>>> patterns, in this order:
>>> 1. admin/
>>> 2. music/ [name='index']
>>> 3. music/ / [name='detail']
>>> The current path, music//, didn't match any of these.
>>>
>>> in my detail funtion in views.py, at first I used on request as an
>>> argument and it worked just fine to give me the album details (which
>>> returned only the album id number), but when i added album_id, so as to get
>>> the album details, I got an error. saying music// not found. Now I don't
>>> understand how the last forward slash(/) was added.
>>> can I get the explaination to this. Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com
>>> 
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com
>>> 
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAOecAnyAVZf16m20HGu0KQp8_yrS9kzB8pfkMMyf55Y3tJY0xQ%40mail.gmail.com
>>> 
>>> .
>>>
>>> --
>>> You received this message because you 

Re: 404 error

2020-09-12 Thread Kunal Solanke
Did you try what I told?

On Sat, Sep 12, 2020, 14:05 Spyke Lionel  wrote:

> I don't understand how the url became
> http://127.0.0.1:8000/music//
> Instead of http://127.0.0.1:8000/music//
>
>
> On Sat, Sep 12, 2020, 8:29 AM 'Amitesh Sahay' via Django users <
> django-users@googlegroups.com> wrote:
>
>> You are trying "http://127.0.0.1:8000/music//;
>> 
>>
>> try something like
>>
>> http://127.0.0.1:8000//
>>
>> Regards,
>> Amitesh
>>
>>
>> On Saturday, 12 September, 2020, 12:55:57 pm IST, Kunal Solanke <
>> kunalsolanke1...@gmail.com> wrote:
>>
>>
>> I think he have created the music url,
>> But the {{album_id}} is not properly passed as context from view.
>>
>>
>> On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users <
>> django-users@googlegroups.com> wrote:
>>
>> At the first glance, I think you havn't created URL pattern for "music".
>> May bejust saying.
>>
>> Regards,
>> Amitesh
>>
>>
>> On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel <
>> ndilion...@gmail.com> wrote:
>>
>>
>> I have this urlpatterns..
>>
>> urlpatterns = [
>> path('', views.index, name='index'),
>> path('/', views.detail, name='detail'),
>> ]
>>
>> my index.html looks like this
>>
>> Albums to display
>> 
>> {% for album in all_albums %}
>>  {{ album.album_title }}
>> {% endfor %}
>> 
>> #my index.html simply displays my albums. and the above works just fine
>>
>> my detail.html looks like this
>>
>> {{ album }}
>> #and it works just fine too
>>
>> my views.py looks like this
>>
>> def index(request):
>> all_albums = Album.objects.all()
>> return render(request, 'music/index.html', {'all_albums': all_albums})
>>
>> def detail(request, album_id):
>> try:
>> album = Album.objects.get(pk=album_id)
>> except Album.DoesNotExist:
>> raise Http404("Album does not exist")
>> return render(request, 'music/detail.html', {'album': album})
>>
>> #when ever I click on an album link to get the album details, I get the
>> 404 below:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/music//
>>
>> Using the URLconf defined in website.urls, Django tried these URL
>> patterns, in this order:
>> 1. admin/
>> 2. music/ [name='index']
>> 3. music/ / [name='detail']
>> The current path, music//, didn't match any of these.
>>
>> in my detail funtion in views.py, at first I used on request as an
>> argument and it worked just fine to give me the album details (which
>> returned only the album id number), but when i added album_id, so as to get
>> the album details, I got an error. saying music// not found. Now I don't
>> understand how the last forward slash(/) was added.
>> can I get the explaination to this. Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAOecAnyAVZf16m20HGu0KQp8_yrS9kzB8pfkMMyf55Y3tJY0xQ%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1325467128.1082007.1599895682642%40mail.yahoo.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google 

Re: 404 error

2020-09-12 Thread Spyke Lionel
I don't understand how the url became
http://127.0.0.1:8000/music//
Instead of http://127.0.0.1:8000/music//


On Sat, Sep 12, 2020, 8:29 AM 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> You are trying "http://127.0.0.1:8000/music//;
> 
>
> try something like
>
> http://127.0.0.1:8000//
>
> Regards,
> Amitesh
>
>
> On Saturday, 12 September, 2020, 12:55:57 pm IST, Kunal Solanke <
> kunalsolanke1...@gmail.com> wrote:
>
>
> I think he have created the music url,
> But the {{album_id}} is not properly passed as context from view.
>
>
> On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users <
> django-users@googlegroups.com> wrote:
>
> At the first glance, I think you havn't created URL pattern for "music".
> May bejust saying.
>
> Regards,
> Amitesh
>
>
> On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel <
> ndilion...@gmail.com> wrote:
>
>
> I have this urlpatterns..
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('/', views.detail, name='detail'),
> ]
>
> my index.html looks like this
>
> Albums to display
> 
> {% for album in all_albums %}
>  {{ album.album_title }}
> {% endfor %}
> 
> #my index.html simply displays my albums. and the above works just fine
>
> my detail.html looks like this
>
> {{ album }}
> #and it works just fine too
>
> my views.py looks like this
>
> def index(request):
> all_albums = Album.objects.all()
> return render(request, 'music/index.html', {'all_albums': all_albums})
>
> def detail(request, album_id):
> try:
> album = Album.objects.get(pk=album_id)
> except Album.DoesNotExist:
> raise Http404("Album does not exist")
> return render(request, 'music/detail.html', {'album': album})
>
> #when ever I click on an album link to get the album details, I get the
> 404 below:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/music//
>
> Using the URLconf defined in website.urls, Django tried these URL
> patterns, in this order:
> 1. admin/
> 2. music/ [name='index']
> 3. music/ / [name='detail']
> The current path, music//, didn't match any of these.
>
> in my detail funtion in views.py, at first I used on request as an
> argument and it worked just fine to give me the album details (which
> returned only the album id number), but when i added album_id, so as to get
> the album details, I got an error. saying music// not found. Now I don't
> understand how the last forward slash(/) was added.
> can I get the explaination to this. Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOecAnyAVZf16m20HGu0KQp8_yrS9kzB8pfkMMyf55Y3tJY0xQ%40mail.gmail.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1325467128.1082007.1599895682642%40mail.yahoo.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: 404 error

2020-09-12 Thread 'Amitesh Sahay' via Django users
You are trying "http://127.0.0.1:8000/music//;
try something like
http://127.0.0.1:8000//



Regards,
Amitesh  

On Saturday, 12 September, 2020, 12:55:57 pm IST, Kunal Solanke 
 wrote:  
 
 I think he have created the music url,But the {{album_id}} is not properly 
passed as context from view.

On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users 
 wrote:

At the first glance, I think you havn't created URL pattern for "music". May 
bejust saying.


Regards,
Amitesh  

On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel 
 wrote:  
 
 I have this urlpatterns..
urlpatterns = [    path('', views.index, name='index'),    
path('/', views.detail, name='detail'),]
my index.html looks like this
Albums to display    {% for album in all_albums %}     {{ album.album_title }}    {% endfor 
%}#my index.html simply displays my albums. and the above works just fine
my detail.html looks like this
{{ album }}#and it works just fine too
my views.py looks like this
def index(request):    all_albums = Album.objects.all()    return 
render(request, 'music/index.html', {'all_albums': all_albums})
def detail(request, album_id):    try:        album = 
Album.objects.get(pk=album_id)    except Album.DoesNotExist:        raise 
Http404("Album does not exist")    return render(request, 'music/detail.html', 
{'album': album})
#when ever I click on an album link to get the album details, I get the 404 
below:
Page not found (404)Request Method: GETRequest URL: 
http://127.0.0.1:8000/music//
Using the URLconf defined in website.urls, Django tried these URL patterns, in 
this order:1. admin/2. music/ [name='index']3. music/ / 
[name='detail']The current path, music//, didn't match any of these.
in my detail funtion in views.py, at first I used on request as an argument and 
it worked just fine to give me the album details (which returned only the album 
id number), but when i added album_id, so as to get the album details, I got an 
error. saying music// not found. Now I don't understand how the last forward 
slash(/) was added.can I get the explaination to this. Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOecAnyAVZf16m20HGu0KQp8_yrS9kzB8pfkMMyf55Y3tJY0xQ%40mail.gmail.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1325467128.1082007.1599895682642%40mail.yahoo.com.


Re: 404 error

2020-09-12 Thread Kunal Solanke
In your template it should be {{album.id}}
or {{album.album_id}} depending how your models are.I am talling about href
in anchor tag.

On Sat, Sep 12, 2020, 12:54 Kunal Solanke 
wrote:

> I think he have created the music url,
> But the {{album_id}} is not properly passed as context from view.
>
>
> On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users <
> django-users@googlegroups.com> wrote:
>
>> At the first glance, I think you havn't created URL pattern for "music".
>> May bejust saying.
>>
>> Regards,
>> Amitesh
>>
>>
>> On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel <
>> ndilion...@gmail.com> wrote:
>>
>>
>> I have this urlpatterns..
>>
>> urlpatterns = [
>> path('', views.index, name='index'),
>> path('/', views.detail, name='detail'),
>> ]
>>
>> my index.html looks like this
>>
>> Albums to display
>> 
>> {% for album in all_albums %}
>>  {{ album.album_title }}
>> {% endfor %}
>> 
>> #my index.html simply displays my albums. and the above works just fine
>>
>> my detail.html looks like this
>>
>> {{ album }}
>> #and it works just fine too
>>
>> my views.py looks like this
>>
>> def index(request):
>> all_albums = Album.objects.all()
>> return render(request, 'music/index.html', {'all_albums': all_albums})
>>
>> def detail(request, album_id):
>> try:
>> album = Album.objects.get(pk=album_id)
>> except Album.DoesNotExist:
>> raise Http404("Album does not exist")
>> return render(request, 'music/detail.html', {'album': album})
>>
>> #when ever I click on an album link to get the album details, I get the
>> 404 below:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/music//
>>
>> Using the URLconf defined in website.urls, Django tried these URL
>> patterns, in this order:
>> 1. admin/
>> 2. music/ [name='index']
>> 3. music/ / [name='detail']
>> The current path, music//, didn't match any of these.
>>
>> in my detail funtion in views.py, at first I used on request as an
>> argument and it worked just fine to give me the album details (which
>> returned only the album id number), but when i added album_id, so as to get
>> the album details, I got an error. saying music// not found. Now I don't
>> understand how the last forward slash(/) was added.
>> can I get the explaination to this. Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOecAnxTw1Q10ZXBfCouQwMMwd%3Dzn3fXw7bd9TtgffYax5CEog%40mail.gmail.com.


Re: 404 error

2020-09-12 Thread Kunal Solanke
I think he have created the music url,
But the {{album_id}} is not properly passed as context from view.


On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> At the first glance, I think you havn't created URL pattern for "music".
> May bejust saying.
>
> Regards,
> Amitesh
>
>
> On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel <
> ndilion...@gmail.com> wrote:
>
>
> I have this urlpatterns..
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('/', views.detail, name='detail'),
> ]
>
> my index.html looks like this
>
> Albums to display
> 
> {% for album in all_albums %}
>  {{ album.album_title }}
> {% endfor %}
> 
> #my index.html simply displays my albums. and the above works just fine
>
> my detail.html looks like this
>
> {{ album }}
> #and it works just fine too
>
> my views.py looks like this
>
> def index(request):
> all_albums = Album.objects.all()
> return render(request, 'music/index.html', {'all_albums': all_albums})
>
> def detail(request, album_id):
> try:
> album = Album.objects.get(pk=album_id)
> except Album.DoesNotExist:
> raise Http404("Album does not exist")
> return render(request, 'music/detail.html', {'album': album})
>
> #when ever I click on an album link to get the album details, I get the
> 404 below:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/music//
>
> Using the URLconf defined in website.urls, Django tried these URL
> patterns, in this order:
> 1. admin/
> 2. music/ [name='index']
> 3. music/ / [name='detail']
> The current path, music//, didn't match any of these.
>
> in my detail funtion in views.py, at first I used on request as an
> argument and it worked just fine to give me the album details (which
> returned only the album id number), but when i added album_id, so as to get
> the album details, I got an error. saying music// not found. Now I don't
> understand how the last forward slash(/) was added.
> can I get the explaination to this. Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOecAnyAVZf16m20HGu0KQp8_yrS9kzB8pfkMMyf55Y3tJY0xQ%40mail.gmail.com.


Re: 404 error

2020-09-12 Thread 'Amitesh Sahay' via Django users
At the first glance, I think you havn't created URL pattern for "music". May 
bejust saying.


Regards,
Amitesh  

On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel 
 wrote:  
 
 I have this urlpatterns..
urlpatterns = [    path('', views.index, name='index'),    
path('/', views.detail, name='detail'),]
my index.html looks like this
Albums to display    {% for album in all_albums %}     {{ album.album_title }}    {% endfor 
%}#my index.html simply displays my albums. and the above works just fine
my detail.html looks like this
{{ album }}#and it works just fine too
my views.py looks like this
def index(request):    all_albums = Album.objects.all()    return 
render(request, 'music/index.html', {'all_albums': all_albums})
def detail(request, album_id):    try:        album = 
Album.objects.get(pk=album_id)    except Album.DoesNotExist:        raise 
Http404("Album does not exist")    return render(request, 'music/detail.html', 
{'album': album})
#when ever I click on an album link to get the album details, I get the 404 
below:
Page not found (404)Request Method: GETRequest URL: 
http://127.0.0.1:8000/music//
Using the URLconf defined in website.urls, Django tried these URL patterns, in 
this order:1. admin/2. music/ [name='index']3. music/ / 
[name='detail']The current path, music//, didn't match any of these.
in my detail funtion in views.py, at first I used on request as an argument and 
it worked just fine to give me the album details (which returned only the album 
id number), but when i added album_id, so as to get the album details, I got an 
error. saying music// not found. Now I don't understand how the last forward 
slash(/) was added.can I get the explaination to this. Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/230500518.1084108.1599895276220%40mail.yahoo.com.


404 error

2020-09-12 Thread Spyke Lionel
I have this urlpatterns..

urlpatterns = [
path('', views.index, name='index'),
path('/', views.detail, name='detail'),
]

my index.html looks like this

Albums to display

{% for album in all_albums %}
 {{ album.album_title }}
{% endfor %}

#my index.html simply displays my albums. and the above works just fine

my detail.html looks like this

{{ album }}
#and it works just fine too

my views.py looks like this

def index(request):
all_albums = Album.objects.all()
return render(request, 'music/index.html', {'all_albums': all_albums})

def detail(request, album_id):
try:
album = Album.objects.get(pk=album_id)
except Album.DoesNotExist:
raise Http404("Album does not exist")
return render(request, 'music/detail.html', {'album': album})

#when ever I click on an album link to get the album details, I get the 404 
below:

Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/music//

Using the URLconf defined in website.urls, Django tried these URL patterns, 
in this order:
1. admin/
2. music/ [name='index']
3. music/ / [name='detail']
The current path, music//, didn't match any of these.

in my detail funtion in views.py, at first I used on request as an argument 
and it worked just fine to give me the album details (which returned only 
the album id number), but when i added album_id, so as to get the album 
details, I got an error. saying music// not found. Now I don't understand 
how the last forward slash(/) was added.
can I get the explaination to this. Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36d25ae2-7e58-43dc-ad0f-83da9e55e526n%40googlegroups.com.


A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian 
language in Django 3.0

Could someone suggest a solution to this?

*http://example.com/de/id-button/* - 200 OK
*http://example.com/id/id-button/* - 200 OK

*http://example.com/any-other-slug/* - 200 OK

*http://example.com/id-button/* - 404 error:

Using the URLconf defined in example.urls, Django tried these URL patterns, in 
this order:
id/The current path, id-button/, didn't match any of these.

urls.py file:

urlpatterns = i18n_patterns(
path('admin/', admin.site.urls),
path('', cache_page(cache_homepage)(homepage_views.index), name='index'),
path('search/', search_views.search, name='search'),
path('/', emoji_views.emoji, name='item'),
prefix_default_language=False,)

The item have a slug field in DB "id-button". If I rename this to 
"idbutton":*http://example.com/idbutton/* - 200 OK

But I need to have url like: *http://example.com/id-button/*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ae4b9bd4-0c2b-491a-a274-10295e87a020%40googlegroups.com.


A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian 
language in Django 3.0

Could someone suggest a solution to this?

*http://example.com/de/id-button/* - 200 OK
*http://example.com/id/id-button/* - 200 OK

*http://example.com/any-other-slug/* - 200 OK

*http://example.com/id-button/* - 404 error:

Using the URLconf defined in example.urls, Django tried these URL patterns, in 
this order:
id/The current path, id-button/, didn't match any of these.

urls.py file:

urlpatterns = i18n_patterns(
path('admin/', admin.site.urls),
path('', cache_page(cache_homepage)(homepage_views.index), name='index'),
path('search/', search_views.search, name='search'),
path('/', emoji_views.emoji, name='item'),
prefix_default_language=False,)

The item have a slug field in DB "id-button". If I rename this to 
"idbutton":*http://example.com/idbutton/* - 200 OK

But I need to have url like: *http://example.com/id-button/*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20ef38df-e2d5-43b5-bc98-7efdf36bacdc%40googlegroups.com.


A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian 
language in Django 3.0

Could someone suggest a solution to this?

*http://example.com/de/id-button/* - 200 OK
*http://example.com/id/id-button/* - 200 OK

*http://example.com/any-other-slug/* - 200 OK

*http://example.com/id-button/* - 404 error:

Using the URLconf defined in example.urls, Django tried these URL patterns, 
in this order:

id/

The current path, id-button/, didn't match any of these.


urls.py file:

urlpatterns = i18n_patterns(

path('admin/', admin.site.urls),

path('', cache_page(cache_homepage)(homepage_views.index), 
name='index'),

path('search/', search_views.search, name='search'),

path('/', emoji_views.emoji, name='item'),

prefix_default_language=False,

)


The item have a slug field in DB "id-button". If I rename this to 
"idbutton":*http://example.com/idbutton/* - 200 OK

But I need to have url like: *http://example.com/id-button/*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78406050-eec7-45a5-a73b-55ce2d675bdc%40googlegroups.com.


A 404 error with “id-” in slug on multilingual website with Indonesian language

2020-05-05 Thread Oleg Barbos
Could someone suggest a solution to this?

*http://example.com/de/id-button/* - 200 OK
*http://example.com/id/id-button/* - 200 OK

*http://example.com/any-other-slug/* - 200 OK

*http://example.com/id-button/* - 404 error:

Using the URLconf defined in example.urls, Django tried these URL patterns, in 
this order:
id/The current path, id-button/, didn't match any of these.

urls.py file:

urlpatterns = i18n_patterns(
path('admin/', admin.site.urls),
path('', cache_page(cache_homepage)(homepage_views.index), name='index'),
path('search/', search_views.search, name='search'),
path('/', emoji_views.emoji, name='item'),
prefix_default_language=False,)

The item have a slug field in DB "id-button". If I rename this to 
"idbutton":*http://example.com/idbutton/* - 200 OK

But I need to have url like: *http://example.com/id-button/*

https://stackoverflow.com/questions/61618166/a-404-error-with-id-in-slug-on-multilingual-website-with-indonesian-language

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ac1b748-6541-4d79-b2bc-a56391a20f12%40googlegroups.com.


Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Thanks everyone.
I updated HttpRequest with HttpResponse.
Then in urls.py:
I did:
path(‘’, views.welcome)

Its working now

On Mon, May 4, 2020 at 3:06 PM Nomeh Uchenna Gabriel <
nomehgabri...@gmail.com> wrote:

> Hi! you're just visiting a different url from what you specified in your
> "urls.py" file.
>
> look closely at the routes "django" is telling you that it tried:
>
> [admin/, welcome.html/]
>
> ... these are truly the two paths that you specified, why on earth are you
> trying to visit a non-existing path(http://127.0.0.1:8000/)
>
> ... kindly visit (http://127.0.0.1:8000/welcome.html)
>
> and face your next error in the "views.py" file ('HttpRequest' instead of
> 'HttpResponse')
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f9c805f3-c264-46c6-ab20-153b3c7b9291%40googlegroups.com
> .
>
-- 
Regards
Deepti Sharma
Blog: https://deepti96.wordpress.com/
Github: https://github.com/dsdeeptisharma
Gitlab: https://gitlab.com/u/dsdeepti
"Great works are not performed by strength but by perseverance"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJOjMFd%2BLhnP137V5Ojr990Q90423fAGWu-A9Qc7sf0oMsqiGA%40mail.gmail.com.


Page 404 error after running Django server

2020-05-04 Thread Nomeh Uchenna Gabriel
Hi! you're just visiting a different url from what you specified in your 
"urls.py" file.

look closely at the routes "django" is telling you that it tried:

[admin/, welcome.html/]

... these are truly the two paths that you specified, why on earth are you 
trying to visit a non-existing path(http://127.0.0.1:8000/)

... kindly visit (http://127.0.0.1:8000/welcome.html)

and face your next error in the "views.py" file ('HttpRequest' instead of 
'HttpResponse') 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9c805f3-c264-46c6-ab20-153b3c7b9291%40googlegroups.com.


Re: Page 404 error after running Django server

2020-05-04 Thread Jorge Gimeno
I just realized that the view is returning an HttpRequest.  It should be an
HttpResponse object (and the import should be changed to bring that object
in as well).

-Jorge

On Mon, May 4, 2020 at 11:43 AM Deepti sharma 
wrote:

> @rdsaini...@gmail.com
> I updated it with: path("welcome/",views.welcome),
> But  no success.
>
> Error at http://127.0.0.1:8000/welcome :
>
> TypeError at /welcome/
>
> __init__() takes 1 positional argument but 2 were given
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/welcome/
> Django Version: 3.0.5
> Exception Type: TypeError
> Exception Value:
>
> __init__() takes 1 positional argument but 2 were given
>
> Exception Location: 
> C:\Users\deeptish\PycharmProjects\GettingStartedDjango\meeting_planner\website\views.py
> in welcome, line 6
> Python Executable:
> C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\Scripts\python.exe
> Python Version: 3.7.7
> Python Path:
>
> ['C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\meeting_planner',
>  
> 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
>  'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
>  'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\lib',
>  'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37',
>  'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv',
>  
> 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv\\lib\\site-packages']
>
> Server time: Mon, 4 May 2020 18:40:54 +
> Traceback Switch to copy-and-paste view 
>
>-
>
> C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\exception.py
> in inner
>1.
>
>   response = get_response(request)
>
>   …
>▶ Local vars 
>-
>
> C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
> in _get_response
>1.
>
>   response = self.process_exception_by_middleware(e, 
> request)
>
>   …
>▶ Local vars 
>-
>
> C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
> in _get_response
>1.
>
>   response = wrapped_callback(request, *callback_args, 
> **callback_kwargs)
>
>
>
>
>
> On Mon, May 4, 2020 at 2:37 PM R D Saini  wrote:
>
>> path("welcome/",views.welcom),
>>
>> On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, <
>> django-users@googlegroups.com> wrote:
>>
>>> There are lots of issues with urls.py
>>> Please go through the django documents on how to write urls.py
>>>
>>> Sent from Yahoo Mail on Android
>>> 
>>>
>>> On Mon, 4 May 2020 at 23:39, Deepti sharma
>>>  wrote:
>>> Hi, I have just started learning django and was trying to make a meeting
>>> planner project y folllowing a course.
>>> I updated the setting.py file to add website into Instaled_Apps. Then
>>> have written a function named welcome in views.py
>>> Finally I added it's entry into urls.py fie
>>> But when I run the server, I am getting following error on webpage:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://127.0.0.1:8000/
>>>
>>> Using the URLconf defined in meeting_planner.urls, Django tried these
>>> URL patterns, in this order:
>>>
>>>1. admin/
>>>2. welcome.html/
>>>
>>> The empty path 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.
>>>
>>>
>>> Can someone please help me with this? I am stuck.
>>>
>>>
>>>
>>> This is my code:  (meeting_planner/website/views.py):
>>>
>>> from django.shortcuts import render
>>> from django.http import HttpRequest
>>> # Create your views here.
>>>
>>> def welcome(request):
>>> return HttpRequest("Welcome to the Meeting Planner Website!")
>>>
>>>
>>> (meeting_planner/meeting_planer/urls.py):
>>>
>>> from django.contrib import admin
>>> from django.urls import path
>>> from website import views
>>> from django.conf.urls import url,include
>>>
>>> from website.views import welcome
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('welcome.html', welcome)
>>> ]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com
>>> 

Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
Please import HttpResponse , 
HttpRequest will not work

Sent from Yahoo Mail on Android 
 
  On Tue, 5 May 2020 at 0:14, Amitesh Sahay wrote:   
path("", views.welcome)
This should work

Sent from Yahoo Mail on Android 
 
  On Tue, 5 May 2020 at 0:13, Deepti sharma wrote:   
@rdsaini...@gmail.com I updated it with: path("welcome/",views.welcome),But  no 
success.
Error at http://127.0.0.1:8000/welcome :

TypeError at /welcome/
__init__() takes 1 positional argument but 2 were given
| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/welcome/ |
| Django Version: | 3.0.5 |
| Exception Type: | TypeError |
| Exception Value: | __init__() takes 1 positional argument but 2 were given |
| Exception Location: | 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\meeting_planner\website\views.py
 in welcome, line 6 |
| Python Executable: | 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\Scripts\python.exe |
| Python Version: | 3.7.7 |
| Python Path: | 
['C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\meeting_planner',
 
'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\lib',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37',
 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv',
 
'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv\\lib\\site-packages']
 |
| Server time: | Mon, 4 May 2020 18:40:54 + |


Traceback Switch to copy-and-paste view
   
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\exception.py
 in inner  
  -   response = get_response(request) …
▶ Local vars
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
 in _get_response  
  -   response = 
self.process_exception_by_middleware(e, request) …
▶ Local vars
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
 in _get_response  
  -   response = wrapped_callback(request, 
*callback_args, **callback_kwargs) 




On Mon, May 4, 2020 at 2:37 PM R D Saini  wrote:

path("welcome/",views.welcom),
On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, 
 wrote:

There are lots of issues with urls.pyPlease go through the django documents on 
how to write urls.py

Sent from Yahoo Mail on Android 
 
  On Mon, 4 May 2020 at 23:39, Deepti sharma wrote:  
 Hi, I have just started learning django and was trying to make a meeting 
planner project y folllowing a course.I updated the setting.py file to add 
website into Instaled_Apps. Then have written a function named welcome in 
views.pyFinally I added it's entry into urls.py fieBut when I run the server, I 
am getting following error on webpage:

Page not found (404)

| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/ |


Using the URLconf defined in meeting_planner.urls, Django tried these URL 
patterns, in this order:
   
   - admin/
   - welcome.html/

The empty path 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.




Can someone please help me with this? I am stuck.







This is my code:  (meeting_planner/website/views.py):
from django.shortcuts import render
from django.http import HttpRequest
# Create your views here.

def welcome(request):
return HttpRequest("Welcome to the Meeting Planner Website!")

(meeting_planner/meeting_planer/urls.py):from django.contrib import admin
from django.urls import path
from website import views
from django.conf.urls import url,include

from website.views import welcome

urlpatterns = [
path('admin/', admin.site.urls),
path('welcome.html', welcome)
]



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com.
  


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
path("", views.welcome)
This should work

Sent from Yahoo Mail on Android 
 
  On Tue, 5 May 2020 at 0:13, Deepti sharma wrote:   
@rdsaini...@gmail.com I updated it with: path("welcome/",views.welcome),But  no 
success.
Error at http://127.0.0.1:8000/welcome :

TypeError at /welcome/
__init__() takes 1 positional argument but 2 were given
| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/welcome/ |
| Django Version: | 3.0.5 |
| Exception Type: | TypeError |
| Exception Value: | __init__() takes 1 positional argument but 2 were given |
| Exception Location: | 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\meeting_planner\website\views.py
 in welcome, line 6 |
| Python Executable: | 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\Scripts\python.exe |
| Python Version: | 3.7.7 |
| Python Path: | 
['C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\meeting_planner',
 
'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\lib',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37',
 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv',
 
'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv\\lib\\site-packages']
 |
| Server time: | Mon, 4 May 2020 18:40:54 + |


Traceback Switch to copy-and-paste view
   
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\exception.py
 in inner  
  -   response = get_response(request) …
▶ Local vars
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
 in _get_response  
  -   response = 
self.process_exception_by_middleware(e, request) …
▶ Local vars
   - 
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
 in _get_response  
  -   response = wrapped_callback(request, 
*callback_args, **callback_kwargs) 




On Mon, May 4, 2020 at 2:37 PM R D Saini  wrote:

path("welcome/",views.welcom),
On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, 
 wrote:

There are lots of issues with urls.pyPlease go through the django documents on 
how to write urls.py

Sent from Yahoo Mail on Android 
 
  On Mon, 4 May 2020 at 23:39, Deepti sharma wrote:  
 Hi, I have just started learning django and was trying to make a meeting 
planner project y folllowing a course.I updated the setting.py file to add 
website into Instaled_Apps. Then have written a function named welcome in 
views.pyFinally I added it's entry into urls.py fieBut when I run the server, I 
am getting following error on webpage:

Page not found (404)

| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/ |


Using the URLconf defined in meeting_planner.urls, Django tried these URL 
patterns, in this order:
   
   - admin/
   - welcome.html/

The empty path 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.




Can someone please help me with this? I am stuck.







This is my code:  (meeting_planner/website/views.py):
from django.shortcuts import render
from django.http import HttpRequest
# Create your views here.

def welcome(request):
return HttpRequest("Welcome to the Meeting Planner Website!")

(meeting_planner/meeting_planer/urls.py):from django.contrib import admin
from django.urls import path
from website import views
from django.conf.urls import url,include

from website.views import welcome

urlpatterns = [
path('admin/', admin.site.urls),
path('welcome.html', welcome)
]



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com.
  


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
@rdsaini...@gmail.com
I updated it with: path("welcome/",views.welcome),
But  no success.

Error at http://127.0.0.1:8000/welcome :

TypeError at /welcome/

__init__() takes 1 positional argument but 2 were given

Request Method: GET
Request URL: http://127.0.0.1:8000/welcome/
Django Version: 3.0.5
Exception Type: TypeError
Exception Value:

__init__() takes 1 positional argument but 2 were given

Exception Location:
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\meeting_planner\website\views.py
in welcome, line 6
Python Executable:
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\Scripts\python.exe
Python Version: 3.7.7
Python Path:

['C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\meeting_planner',
 
'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\lib',
 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37',
 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv',
 
'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv\\lib\\site-packages']

Server time: Mon, 4 May 2020 18:40:54 +
Traceback Switch to copy-and-paste view 

   -
   
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\exception.py
in inner
   1.

  response = get_response(request)

  …
   ▶ Local vars 
   -
   
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
in _get_response
   1.

  response =
self.process_exception_by_middleware(e, request)

  …
   ▶ Local vars 
   -
   
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
in _get_response
   1.

  response = wrapped_callback(request,
*callback_args, **callback_kwargs)





On Mon, May 4, 2020 at 2:37 PM R D Saini  wrote:

> path("welcome/",views.welcom),
>
> On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> There are lots of issues with urls.py
>> Please go through the django documents on how to write urls.py
>>
>> Sent from Yahoo Mail on Android
>> 
>>
>> On Mon, 4 May 2020 at 23:39, Deepti sharma
>>  wrote:
>> Hi, I have just started learning django and was trying to make a meeting
>> planner project y folllowing a course.
>> I updated the setting.py file to add website into Instaled_Apps. Then
>> have written a function named welcome in views.py
>> Finally I added it's entry into urls.py fie
>> But when I run the server, I am getting following error on webpage:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>>
>> Using the URLconf defined in meeting_planner.urls, Django tried these
>> URL patterns, in this order:
>>
>>1. admin/
>>2. welcome.html/
>>
>> The empty path 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.
>>
>>
>> Can someone please help me with this? I am stuck.
>>
>>
>>
>> This is my code:  (meeting_planner/website/views.py):
>>
>> from django.shortcuts import render
>> from django.http import HttpRequest
>> # Create your views here.
>>
>> def welcome(request):
>> return HttpRequest("Welcome to the Meeting Planner Website!")
>>
>>
>> (meeting_planner/meeting_planer/urls.py):
>>
>> from django.contrib import admin
>> from django.urls import path
>> from website import views
>> from django.conf.urls import url,include
>>
>> from website.views import welcome
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('welcome.html', welcome)
>> ]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> 

Re: Page 404 error after running Django server

2020-05-04 Thread R D Saini
path("welcome/",views.welcom),

On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, <
django-users@googlegroups.com> wrote:

> There are lots of issues with urls.py
> Please go through the django documents on how to write urls.py
>
> Sent from Yahoo Mail on Android
> 
>
> On Mon, 4 May 2020 at 23:39, Deepti sharma
>  wrote:
> Hi, I have just started learning django and was trying to make a meeting
> planner project y folllowing a course.
> I updated the setting.py file to add website into Instaled_Apps. Then have
> written a function named welcome in views.py
> Finally I added it's entry into urls.py fie
> But when I run the server, I am getting following error on webpage:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
>
> Using the URLconf defined in meeting_planner.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>2. welcome.html/
>
> The empty path 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.
>
>
> Can someone please help me with this? I am stuck.
>
>
>
> This is my code:  (meeting_planner/website/views.py):
>
> from django.shortcuts import render
> from django.http import HttpRequest
> # Create your views here.
>
> def welcome(request):
> return HttpRequest("Welcome to the Meeting Planner Website!")
>
>
> (meeting_planner/meeting_planer/urls.py):
>
> from django.contrib import admin
> from django.urls import path
> from website import views
> from django.conf.urls import url,include
>
> from website.views import welcome
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('welcome.html', welcome)
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL-j-zc8L27BKFgPhgtQ5JX-xMrukh8ZQCej_4v6jd6_%3DpiZmw%40mail.gmail.com.


Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Hi, I did replace it with: path('',welcome)
But it's still no working:

Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/welcome

Using the URLconf defined in meeting_planner.urls, Django tried these URL
patterns, in this order:

   1. admin/
   2.

The current path, welcome, 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.

On Mon, May 4, 2020 at 2:21 PM Franz Ulenaers  wrote:

> pleae change your urls.py as follow
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', welcome)
> ]
>
>
>
> Op maandag 4 mei 2020 20:09:51 UTC+2 schreef Deepti sharma:
>>
>> Hi, I have just started learning django and was trying to make a meeting
>> planner project y folllowing a course.
>> I updated the setting.py file to add website into Instaled_Apps. Then
>> have written a function named welcome in views.py
>> Finally I added it's entry into urls.py fie
>> But when I run the server, I am getting following error on webpage:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>>
>> Using the URLconf defined in meeting_planner.urls, Django tried these
>> URL patterns, in this order:
>>
>>1. admin/
>>2. welcome.html/
>>
>> The empty path 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.
>>
>>
>> Can someone please help me with this? I am stuck.
>>
>>
>>
>> This is my code:  (meeting_planner/website/views.py):
>>
>> from django.shortcuts import render
>> from django.http import HttpRequest
>> # Create your views here.
>>
>> def welcome(request):
>> return HttpRequest("Welcome to the Meeting Planner Website!")
>>
>>
>> (meeting_planner/meeting_planer/urls.py):
>>
>> from django.contrib import admin
>> from django.urls import path
>> from website import views
>> from django.conf.urls import url,include
>>
>> from website.views import welcome
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('welcome.html', welcome)
>> ]
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d02b62d5-caa4-4f5e-a128-e46bd6fa1e08%40googlegroups.com
> 
> .
>


-- 
Regards
Deepti Sharma
Blog: https://deepti96.wordpress.com/
Github: https://github.com/dsdeeptisharma
Gitlab: https://gitlab.com/u/dsdeepti
"Great works are not performed by strength but by perseverance"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJOjMFcgeruuEKnpB8VFXg1T9Kri6J7o%3Dxb%2BN8JsXGnK57D7Yg%40mail.gmail.com.


Re: Page 404 error after running Django server

2020-05-04 Thread Franz Ulenaers
pleae change your urls.py as follow

urlpatterns = [
path('admin/', admin.site.urls),
path('', welcome)
]



Op maandag 4 mei 2020 20:09:51 UTC+2 schreef Deepti sharma:
>
> Hi, I have just started learning django and was trying to make a meeting 
> planner project y folllowing a course.
> I updated the setting.py file to add website into Instaled_Apps. Then have 
> written a function named welcome in views.py
> Finally I added it's entry into urls.py fie
> But when I run the server, I am getting following error on webpage:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
>
> Using the URLconf defined in meeting_planner.urls, Django tried these URL 
> patterns, in this order:
>
>1. admin/
>2. welcome.html/
>
> The empty path 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.
>
>
> Can someone please help me with this? I am stuck.
>
>
>
> This is my code:  (meeting_planner/website/views.py):
>
> from django.shortcuts import render
> from django.http import HttpRequest
> # Create your views here.
>
> def welcome(request):
> return HttpRequest("Welcome to the Meeting Planner Website!")
>
>
> (meeting_planner/meeting_planer/urls.py):
>
> from django.contrib import admin
> from django.urls import path
> from website import views
> from django.conf.urls import url,include
>
> from website.views import welcome
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('welcome.html', welcome)
> ]
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d02b62d5-caa4-4f5e-a128-e46bd6fa1e08%40googlegroups.com.


Re: Page 404 error after running Django server

2020-05-04 Thread franz ulenaers

path('welcome.html', welcome)

should be :

path('', welcome)



Op 4/05/2020 om 20:11 schreef 'Amitesh Sahay' via Django users:

There are lots of issues with urls.py
Please go through the django documents on how to write urls.py

Sent from Yahoo Mail on Android 



On Mon, 4 May 2020 at 23:39, Deepti sharma
 wrote:
Hi, I have just started learning django and was trying to make a
meeting planner project y folllowing a course.
I updated the setting.py file to add website into Instaled_Apps.
Then have written a function named welcome in views.py
Finally I added it's entry into urls.py fie
But when I run the server, I am getting following error on webpage:


  Page not found (404)

Request Method: GET
Request URL:http://127.0.0.1:8000/

Using the URLconf defined in |meeting_planner.urls|, Django tried
these URL patterns, in this order:

 1. admin/
 2. welcome.html/

The empty path 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.


Can someone please help me with this? I am stuck.



This is my code: (meeting_planner/website/views.py):

from django.shortcutsimport render
from django.httpimport HttpRequest
# Create your views here. def welcome(request):
 return HttpRequest("Welcome to the Meeting Planner Website!")

(meeting_planner/meeting_planer/urls.py):

from django.contribimport admin
from django.urlsimport path
from websiteimport views
from django.conf.urlsimport url,include

from website.viewsimport welcome

urlpatterns = [
 path('admin/', admin.site.urls),
 path('welcome.html', welcome)
]



-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com

.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com 
.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5eaf7787-ad7c-434a-c848-698bd068b686%40gmail.com.


Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
There are lots of issues with urls.pyPlease go through the django documents on 
how to write urls.py

Sent from Yahoo Mail on Android 
 
  On Mon, 4 May 2020 at 23:39, Deepti sharma wrote:  
 Hi, I have just started learning django and was trying to make a meeting 
planner project y folllowing a course.I updated the setting.py file to add 
website into Instaled_Apps. Then have written a function named welcome in 
views.pyFinally I added it's entry into urls.py fieBut when I run the server, I 
am getting following error on webpage:

Page not found (404)

| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/ |


Using the URLconf defined in meeting_planner.urls, Django tried these URL 
patterns, in this order:
   
   - admin/
   - welcome.html/

The empty path 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.




Can someone please help me with this? I am stuck.







This is my code:  (meeting_planner/website/views.py):
from django.shortcuts import render
from django.http import HttpRequest
# Create your views here.

def welcome(request):
return HttpRequest("Welcome to the Meeting Planner Website!")

(meeting_planner/meeting_planer/urls.py):from django.contrib import admin
from django.urls import path
from website import views
from django.conf.urls import url,include

from website.views import welcome

urlpatterns = [
path('admin/', admin.site.urls),
path('welcome.html', welcome)
]



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com.


Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Hi, I have just started learning django and was trying to make a meeting 
planner project y folllowing a course.
I updated the setting.py file to add website into Instaled_Apps. Then have 
written a function named welcome in views.py
Finally I added it's entry into urls.py fie
But when I run the server, I am getting following error on webpage:

Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/

Using the URLconf defined in meeting_planner.urls, Django tried these URL 
patterns, in this order:

   1. admin/
   2. welcome.html/

The empty path 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.


Can someone please help me with this? I am stuck.



This is my code:  (meeting_planner/website/views.py):

from django.shortcuts import render
from django.http import HttpRequest
# Create your views here.

def welcome(request):
return HttpRequest("Welcome to the Meeting Planner Website!")


(meeting_planner/meeting_planer/urls.py):

from django.contrib import admin
from django.urls import path
from website import views
from django.conf.urls import url,include

from website.views import welcome

urlpatterns = [
path('admin/', admin.site.urls),
path('welcome.html', welcome)
]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com.


Re: 404 error

2020-02-12 Thread Chucky Mada Madamombe
Hi,

404 error means Django searched your urls.py file and cannot find the
requested page. Take screen shot of your urls.py and views.py and
traceback. That may help us to figure out the problem.

Regards

Chuck G. Madamombe
NAM: +264 81 842 1284
RSA: +27 78 208 7034
Twitter: @chuckygari
Skype: chuckygari
Facebook: Chucky Mada Madamombe
LinkedIn: Chucknorris Garikayi Madamombe

On Thu, 13 Feb 2020, 00:29 mahshid asadi  wrote:

> Hi everyone. Im a beginner. i use this sites tutorial and still i cant fix
> the 404 error,please someone help me.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d7ce0e72-20a3-40eb-9f9c-a910389b09f0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d7ce0e72-20a3-40eb-9f9c-a910389b09f0%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJaKOsdXX5Ronp9orv0%2B1uHNa%3Dg0_-jdSVwk34j33T-G6K_9EA%40mail.gmail.com.


Re: 404 error

2020-02-12 Thread Jorge Gimeno
On Wed, Feb 12, 2020 at 2:29 PM mahshid asadi 
wrote:

> Hi everyone. Im a beginner. i use this sites tutorial and still i cant fix
> the 404 error,please someone help me.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d7ce0e72-20a3-40eb-9f9c-a910389b09f0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d7ce0e72-20a3-40eb-9f9c-a910389b09f0%40googlegroups.com?utm_medium=email_source=footer>
> .
>

Errors are frustrating!  As much as we may want to, we can't help without
some further information.  Since a 404 indicates that the page cannot be
found, we need at minimum the urls.py files involved.  Also, the traceback
in the terminal would be useful.  Cut and paste, please.  This list strips
attachments.

-Jorge

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANfN%3DK9yc%2BUvdn%2B4MTf4rKPk3A%2Bh7ARGBHp1dAMpJ0GquCRDHw%40mail.gmail.com.


404 error

2020-02-12 Thread mahshid asadi
Hi everyone. Im a beginner. i use this sites tutorial and still i cant fix 
the 404 error,please someone help me.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d7ce0e72-20a3-40eb-9f9c-a910389b09f0%40googlegroups.com.


Re: 404 error

2019-09-10 Thread ANi
The fastest way to know why is to read your error messages.

 

arpit Dubey於 2019年9月7日星期六 UTC+8下午11時38分38秒寫道:
>
> I have followed all the steps for creating our first app  polls but it is 
> showing the error of 404 
> could you please help me to finding it out why it is happening there after 
> copying each and every step from documentation.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/817bded2-a28f-456c-87d3-67d679eba312%40googlegroups.com.


404 error

2019-09-07 Thread arpit Dubey
I have followed all the steps for creating our first app  polls but it is 
showing the error of 404 
could you please help me to finding it out why it is happening there after 
copying each and every step from documentation.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38de38f7-9418-4ce5-8132-4bc96e730de4%40googlegroups.com.


Re: 404 error when posting a multipart/form-data form

2019-04-24 Thread Manlio Perillo
On Thursday, March 21, 2019 at 10:28:30 AM UTC+1, Manlio Perillo wrote:
>
> I have a Django application that works perfectly fine both on my PC and on 
> a hosting system with CloudLinux and Passenger.
> However when I added a form with a file field, I started to get 404 errors 
> on POST.
>
> I tried to remove all the middleware, but the problem is still here.
> The error message says that the 404 error was raised by my view, but 
> that's not true; my view is not called at all during a POST request.
>
> What's strange is that I have another Django application on a different 
> hosting account with the same environment and it works fine.
> The problem is probably in my application, but I'm unable to find it.
>
> Where should I search to find the cause of the problem?
>
>
The problem was caused by Passenger.
https://stackoverflow.com/questions/49594955/django-1-11-on-passenger-wsgi-not-routing-post-request?rq=1

Unlike the case from the stackoverflow question, in my case PATH_INFO was 
incorrectly set only for POST requests containing files.
The fix suggested solved the problem.


Regards
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ce75e7b-6f3c-4c3a-a636-186d4de52d75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Manlio Perillo
On Friday, March 22, 2019 at 8:35:13 PM UTC+1, Raffaele Salmaso wrote:
>
> On Thu, Mar 21, 2019 at 2:42 PM Manlio Perillo  > wrote:
>
>> The view code is here:
>> https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1
>>
> I d
>


Because I have remove every extra components.  I removed all the middleware 
and all the other apps.
However, as I said, this bug occurred original in the django admin app.

I'm using the latest version of Django, and to make sure that the original 
source files have not been modified, I uninstalled and installed it again.
The bug is still here.

It may be a bug of Passenger (5.3.7), however I checked with a custom 
wsgi.py file and it sets the PATH_INFO correctly.

This is my view:
https://gist.github.com/perillo/fe4149fa610a52d090bb2062a9c83731

As i said at the start of the thread, if I comment the `{{ form }}` and 
uncomment the ``, Django works correctly.
What I find strange is that it seems the problem is caused by my view 
(since only my view know the name of the form field), but my view *is not* 
called, and instead it seems (from the trace file) that the url resolver 
did not found a match for the request path.


Thanks
Manlio Perillo 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6fef4fca-2fab-4dd9-8180-f7009013d1b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Raffaele Salmaso
On Thu, Mar 21, 2019 at 2:42 PM Manlio Perillo 
wrote:

> The view code is here:
> https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1
>
I don't see the {% csrf_token %} in the template

-- 
| Raffaele Salmaso
| https://salmaso.org
| https://bitbucket.org/rsalmaso
| https://github.com/rsalmaso

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABgH4JsbmPbXrso8UXFWg-G1hLm%3DMDTzV%3DSvh2SUcb5tvQ0rjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Marcio Bernardes
Hey Manlio make sure to change the action option in the form html, use 
something like {% url ‘url_name’ %} there. Do not use this point path. 

Cheers!

Sent from my iPhone

> On 22. Mar 2019, at 16:09, Mohammad Etemaddar  
> wrote:
> 
> I'm not sure about this, but I think maybe it would be about your Django bug. 
> Have you updated your Django?
> 
>> On Friday, March 22, 2019 at 7:37:14 PM UTC+4:30, Manlio Perillo wrote:
>>> On Friday, March 22, 2019 at 3:23:32 PM UTC+1, Manlio Perillo wrote:
 On Friday, March 22, 2019 at 1:28:55 PM UTC+1, Hamady Medvall wrote:
 You have to add the path /bug in URLConfig
 
>>> 
>>> A GET request to /mp/bug/ does not return an error, only a POST request and 
>>> *only* when using a file upload.
>>> 
>>> From the trace I see that it's the URL resolver that raises the 404 
>>> exception.  But what I don't understand is why a GET request work.
>>> 
>>> This is the trace for a POST request: https://paste.ee/p/sjq5s
>>> 
>> 
>> Some more details.
>> 
>> I have the following main urlpatterns:
>> 
>> urlpatterns = [
>> urls.path('mp/', urls.include('lpg.mperillo.urls')),
>> ]
>> 
>> And in my application:
>> 
>> urlpatterns = [
>> urls.path('bug/', views.bug, name='bug'),
>> urls.path('debug/', views.debug, name='debug')
>> ]
>> 
>> When accessing https://fast-page.it/mp/bug/, Django tries to match the path 
>> `bug` with the pattern `mp` and it fail, raising a 404 exception.
>> This does not happen with a GET request or with a POST request without a 
>> file upload.  Also, I can't reproduce this error on my system, but only on 
>> the hosting server.
>> I have a different Django application on a different account of the same 
>> hosting company, and it works correctly.
>> 
>> I originally found the problem in the Django admin, when trying to create a 
>> model instance with a file field.
>> 
>> 
>> Thanks
>> Manlio Perillo 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/83a30de5-1f16-4694-88f8-d50e77844153%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1A13E75C-7DDF-4544-9940-A0823531B8F8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Mohammad Etemaddar
I'm not sure about this, but I think maybe it would be about your Django 
bug. Have you updated your Django?

On Friday, March 22, 2019 at 7:37:14 PM UTC+4:30, Manlio Perillo wrote:
>
> On Friday, March 22, 2019 at 3:23:32 PM UTC+1, Manlio Perillo wrote:
>>
>> On Friday, March 22, 2019 at 1:28:55 PM UTC+1, Hamady Medvall wrote:
>>>
>>> You have to add the path /bug in URLConfig
>>>
>>>
>> A GET request to /mp/bug/ does not return an error, only a POST request 
>> and *only* when using a file upload.
>>
>> From the trace I see that it's the URL resolver that raises the 404 
>> exception.  But what I don't understand is why a GET request work.
>>
>> This is the trace for a POST request: https://paste.ee/p/sjq5s
>>
>>
> Some more details.
>
> I have the following main urlpatterns:
>
> urlpatterns = [
> urls.path('mp/', urls.include('lpg.mperillo.urls')),
> ]
>
> And in my application:
>
> urlpatterns = [
> urls.path('bug/', views.bug, name='bug'),
> urls.path('debug/', views.debug, name='debug')
> ]
>
> When accessing https://fast-page.it/mp/bug/, Django tries to match the 
> path `bug` with the pattern `mp` and it fail, raising a 404 exception.
> This does not happen with a GET request or with a POST request without a 
> file upload.  Also, I can't reproduce this error on my system, but only on 
> the hosting server.
> I have a different Django application on a different account of the same 
> hosting company, and it works correctly.
>
> I originally found the problem in the Django admin, when trying to create 
> a model instance with a file field.
>
>
> Thanks
> Manlio Perillo 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/83a30de5-1f16-4694-88f8-d50e77844153%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Manlio Perillo
On Friday, March 22, 2019 at 3:23:32 PM UTC+1, Manlio Perillo wrote:
>
> On Friday, March 22, 2019 at 1:28:55 PM UTC+1, Hamady Medvall wrote:
>>
>> You have to add the path /bug in URLConfig
>>
>>
> A GET request to /mp/bug/ does not return an error, only a POST request 
> and *only* when using a file upload.
>
> From the trace I see that it's the URL resolver that raises the 404 
> exception.  But what I don't understand is why a GET request work.
>
> This is the trace for a POST request: https://paste.ee/p/sjq5s
>
>
Some more details.

I have the following main urlpatterns:

urlpatterns = [
urls.path('mp/', urls.include('lpg.mperillo.urls')),
]

And in my application:

urlpatterns = [
urls.path('bug/', views.bug, name='bug'),
urls.path('debug/', views.debug, name='debug')
]

When accessing https://fast-page.it/mp/bug/, Django tries to match the path 
`bug` with the pattern `mp` and it fail, raising a 404 exception.
This does not happen with a GET request or with a POST request without a 
file upload.  Also, I can't reproduce this error on my system, but only on 
the hosting server.
I have a different Django application on a different account of the same 
hosting company, and it works correctly.

I originally found the problem in the Django admin, when trying to create a 
model instance with a file field.


Thanks
Manlio Perillo 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a8efd09f-2050-40d3-94be-f66e3cc6d7dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Manlio Perillo
On Friday, March 22, 2019 at 1:28:55 PM UTC+1, Hamady Medvall wrote:
>
> You have to add the path /bug in URLConfig
>
>
A GET request to /mp/bug/ does not return an error, only a POST request and 
*only* when using a file upload.

>From the trace I see that it's the URL resolver that raises the 404 
exception.  But what I don't understand is why a GET request work.

This is the trace for a POST request: https://paste.ee/p/sjq5s


Thanks
Manlio Perillo

On Fri, Mar 22, 2019 at 10:45 AM Manlio Perillo  > wrote:
>
>> On Thursday, March 21, 2019 at 2:42:31 PM UTC+1, Manlio Perillo wrote:
>>>
>>> On Thursday, March 21, 2019 at 10:56:43 AM UTC+1, Mohammad Etemaddar 
>>> wrote:

 Can you send your view here?


>>> Here is the URL that reproduce the problem:
>>> https://fast-page.it/mp/bug/
>>>
>>> and here is the URL that prints the Django environment:
>>> https://fast-page.it/mp/debug/
>>>
>>> The view code is here:
>>> https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1
>>>
>>>
>>> What I find strange is that if I remove the {{ form }} and uncomment the 
>>> manual input element, there is no error.
>>>
>>>
>> No idea about the cause of the problem?
>>
>>
>> Thanks
>> Manlio Perillo
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/efac7049-20d6-4a33-b928-cf4a494a6995%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/51ff1c93-2204-4304-83df-e99ca4f5337e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Hamady Medvall
You have to add the path /bug in URLConfig

On Fri, Mar 22, 2019 at 10:45 AM Manlio Perillo 
wrote:

> On Thursday, March 21, 2019 at 2:42:31 PM UTC+1, Manlio Perillo wrote:
>>
>> On Thursday, March 21, 2019 at 10:56:43 AM UTC+1, Mohammad Etemaddar
>> wrote:
>>>
>>> Can you send your view here?
>>>
>>>
>> Here is the URL that reproduce the problem:
>> https://fast-page.it/mp/bug/
>>
>> and here is the URL that prints the Django environment:
>> https://fast-page.it/mp/debug/
>>
>> The view code is here:
>> https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1
>>
>>
>> What I find strange is that if I remove the {{ form }} and uncomment the
>> manual input element, there is no error.
>>
>>
> No idea about the cause of the problem?
>
>
> Thanks
> Manlio Perillo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/efac7049-20d6-4a33-b928-cf4a494a6995%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGd%2BjD4fMx0LALCV8shFHZGPT%2BsJ%3DGr_eLjOwSZtK0evJVBFUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-22 Thread Manlio Perillo
On Thursday, March 21, 2019 at 2:42:31 PM UTC+1, Manlio Perillo wrote:
>
> On Thursday, March 21, 2019 at 10:56:43 AM UTC+1, Mohammad Etemaddar wrote:
>>
>> Can you send your view here?
>>
>>
> Here is the URL that reproduce the problem:
> https://fast-page.it/mp/bug/
>
> and here is the URL that prints the Django environment:
> https://fast-page.it/mp/debug/
>
> The view code is here:
> https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1
>
>
> What I find strange is that if I remove the {{ form }} and uncomment the 
> manual input element, there is no error.
>
>
No idea about the cause of the problem?


Thanks
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/efac7049-20d6-4a33-b928-cf4a494a6995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error while loading uploaded image when debug is False

2019-03-21 Thread Mohammad Etemaddar
In production , we serve static files (like images) stright from httpd like
apache, and we do not call django to serve them.
But in testing while run django test server, we use static paths in urls.py
to serve them,

Maybe you have added mediaurls to your urlpatterns in urls.py conditionally
(when settings.debug == True) so they are not added when debug is False.

On Thu, 21 Mar 2019 21:35 mayank dubey,  wrote:

> Hii there,
>
> I am not able to load images which have been uploaded through the admin
> portal on my Django site if I set debug = false. While when debug = true,
> images are easily loaded. I am not able to understand what is the problem,
> please help me out.
>
> Thank you,
> M
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMJ6Xs6qROL597vvX53%3DSpLqagovcMcz_wROFp828zm%3DrYE8DA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALJt1nsRuK1yeyxsdoB6p50eOjz6-JCLkzY%3D%3Dz5Cy8eudiwzrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


404 error while loading uploaded image when debug is False

2019-03-21 Thread mayank dubey
Hii there,

I am not able to load images which have been uploaded through the admin
portal on my Django site if I set debug = false. While when debug = true,
images are easily loaded. I am not able to understand what is the problem,
please help me out.

Thank you,
M

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMJ6Xs6qROL597vvX53%3DSpLqagovcMcz_wROFp828zm%3DrYE8DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-21 Thread Manlio Perillo
On Thursday, March 21, 2019 at 10:56:43 AM UTC+1, Mohammad Etemaddar wrote:
>
> Can you send your view here?
>
>
Here is the URL that reproduce the problem:
https://fast-page.it/mp/bug/

and here is the URL that prints the Django environment:
https://fast-page.it/mp/debug/

The view code is here:
https://gist.github.com/perillo/2f828209cea84ff8c753f6f2524119f1


What I find strange is that if I remove the {{ form }} and uncomment the 
manual input element, there is no error.

> [...]


Thanks
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/70539534-9f0b-4479-ac44-22b087701a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-03-21 Thread Mohammad Etemaddar
Can you send your view here?

On Thu, 21 Mar 2019 12:58 Manlio Perillo,  wrote:

> I have a Django application that works perfectly fine both on my PC and on
> a hosting system with CloudLinux and Passenger.
> However when I added a form with a file field, I started to get 404 errors
> on POST.
>
> I tried to remove all the middleware, but the problem is still here.
> The error message says that the 404 error was raised by my view, but
> that's not true; my view is not called at all during a POST request.
>
> What's strange is that I have another Django application on a different
> hosting account with the same environment and it works fine.
> The problem is probably in my application, but I'm unable to find it.
>
> Where should I search to find the cause of the problem?
>
>
> Thanks
> Manlio Perillo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/313db9e4-340c-475a-abe6-f12f96213b05%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/313db9e4-340c-475a-abe6-f12f96213b05%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALJt1nvkXie8yTG%2BG9c7C8C%3D3modPsubLK%2B2R-RHgGBXiSizxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


404 error when posting a multipart/form-data form

2019-03-21 Thread Manlio Perillo
I have a Django application that works perfectly fine both on my PC and on 
a hosting system with CloudLinux and Passenger.
However when I added a form with a file field, I started to get 404 errors 
on POST.

I tried to remove all the middleware, but the problem is still here.
The error message says that the 404 error was raised by my view, but that's 
not true; my view is not called at all during a POST request.

What's strange is that I have another Django application on a different 
hosting account with the same environment and it works fine.
The problem is probably in my application, but I'm unable to find it.

Where should I search to find the cause of the problem?


Thanks
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/313db9e4-340c-475a-abe6-f12f96213b05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error on tried these URL patterns, in this order: ^polls/ ^admin/

2018-06-18 Thread emmanuel wyckens
Hello,

Thank you C. Kirby for yout help,
You have solved my issue by your question.

In fact, I 've forgotten each time to add  /polls or /admin to access to 
the good web page.
http://127.0.0.1:8000/polls/
http://127.0.0.1:8000/admin

It's working fine now.



Le vendredi 15 juin 2018 22:36:53 UTC+2, C. Kirby a écrit :
>
> What it the url you tried to access? 
>
> On Friday, June 15, 2018 at 10:41:41 AM UTC-4, emmanuel wyckens wrote:
>>
>> Hello
>>
>> I didn't find my 404 error, it's seems that the issue is arround the urls 
>> configuration on the project. In additionnal, find the zip project for more 
>> details.
>> Confg : django 1.11.11, python 2.7
>>
>> Please could you help me ?
>>
>> Thanks
>>
>> In urls.py 
>>
>> from django.conf.urls import url, include
>> from django.contrib import admin
>>
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>>
>> In polls/urls.py
>>
>> # -*- coding: utf-8 -*-
>> from django.conf.urls import url, include
>>
>> from . import views
>>
>> urlpatterns = [
>> url('', views.index, name='index'),
>> ]
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/867cde36-352e-4988-90f7-c7d40d73099b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error on tried these URL patterns, in this order: ^polls/ ^admin/

2018-06-15 Thread C. Kirby
What it the url you tried to access? 

On Friday, June 15, 2018 at 10:41:41 AM UTC-4, emmanuel wyckens wrote:
>
> Hello
>
> I didn't find my 404 error, it's seems that the issue is arround the urls 
> configuration on the project. In additionnal, find the zip project for more 
> details.
> Confg : django 1.11.11, python 2.7
>
> Please could you help me ?
>
> Thanks
>
> In urls.py 
>
> from django.conf.urls import url, include
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
>
> In polls/urls.py
>
> # -*- coding: utf-8 -*-
> from django.conf.urls import url, include
>
> from . import views
>
> urlpatterns = [
> url('', views.index, name='index'),
> ]
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3fa686e-8185-49ba-82b2-76831bb66bf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


404 error on tried these URL patterns, in this order: ^polls/ ^admin/

2018-06-15 Thread emmanuel wyckens
Hello

I didn't find my 404 error, it's seems that the issue is arround the urls 
configuration on the project. In additionnal, find the zip project for more 
details.
Confg : django 1.11.11, python 2.7

Please could you help me ?

Thanks

In urls.py 

from django.conf.urls import url, include
from django.contrib import admin

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]

In polls/urls.py

# -*- coding: utf-8 -*-
from django.conf.urls import url, include

from . import views

urlpatterns = [
url('', views.index, name='index'),
]



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/25321b55-f2e3-48e7-a9e5-c7d5456a6f32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<>


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Sorry for my last message! I only checked the main page which don´t have 
any page. Forgot to check the /polls/ 

You are perfectly right - not completing the ^ with return before the next 
character makes the difference! 
Thanks!


tirsdag 7. mars 2017 18.02.48 UTC+1 skrev Vanja Falck følgende:
>
> Checked the ^ sign, but it was only missing a return - no syntax-error or 
> change in the current 404 error, so I assume it is interpreted right.
>
> The error message is only this (deliberately exchanged my actual site with 
> xxx) - with the 404 header:
>
> Using the URLconf defined in xxx.urls, Django tried these URL patterns, 
> in this order:
>
>1. ^polls/
>2. ^admin/
>
> The current URL, , didn't match any of these.
>
>
>
> tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>>
>> Is there any information on the 404 page ? 
>> I remember django being quite chatty as long it's in debug mode 
>>
>> 2017-03-07 10:56 GMT+01:00 Vanja Falck <vanja...@gmail.com>: 
>> > Hi, 
>> > I have startet the first part of the djangoproject tutorial and get 
>> stuck in 
>> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
>> > Any one have an idea about what is wrong? 
>> > 
>> > Followed the instructions carefully (django 1.10 - version). Running in 
>> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
>> > Did follow an advice in this group and added the polls app in 
>> settings.py, 
>> > but it did not help. Nothing else is changed in the autosettings from a 
>> > fresh install of django 10.1.6. 
>> > 
>> > Is this a python problem or an OS problem? 
>> > 
>> > Here is my code: 
>> > 
>> > # Your first view: opprettet polls/urls.py 
>> > 
>> > from django.conf.urls import url 
>> > 
>> > from . import views 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆ$', views.index, name='index'), 
>> > ] 
>> > 
>> > # Your first view polls/views.py 
>> > 
>> > from django.http import HttpResponse 
>> > 
>> > def index(request): 
>> > return HttpResponse("Hoppla, polls index her..") 
>> > 
>> > # Site/urls.py 
>> > 
>> > from django.conf.urls import include, url 
>> > from django.contrib import admin 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆpolls/', include('polls.urls')), 
>> > url(r'^admin/', admin.site.urls), 
>> > ] 
>> > # Site/settings.py 
>> > # Application definition 
>> > 
>> > INSTALLED_APPS = [ 
>> > 'django.contrib.admin', 
>> > 'django.contrib.auth', 
>> > 'django.contrib.contenttypes', 
>> > 'django.contrib.sessions', 
>> > 'django.contrib.messages', 
>> > 'django.contrib.staticfiles', 
>> > 'polls.apps.PollsConfig', 
>> > 
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Django users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to django-users...@googlegroups.com. 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > Visit this group at https://groups.google.com/group/django-users. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>
>> -- 
>>
>> Cordialement, Coues Ludovic 
>> +336 148 743 42 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ccecd63c-6f9c-4158-a9dc-d84682154197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Checked the ^ sign, but it was only missing a return - no syntax-error or 
change in the current 404 error, so I assume it is interpreted right.

The error message is only this (deliberately exchanged my actual site with 
xxx) - with the 404 header:

Using the URLconf defined in xxx.urls, Django tried these URL patterns, in 
this order:

   1. ^polls/
   2. ^admin/

The current URL, , didn't match any of these.



tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>
> Is there any information on the 404 page ? 
> I remember django being quite chatty as long it's in debug mode 
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck <vanja...@gmail.com >: 
>
> > Hi, 
> > I have startet the first part of the djangoproject tutorial and get 
> stuck in 
> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
> > Any one have an idea about what is wrong? 
> > 
> > Followed the instructions carefully (django 1.10 - version). Running in 
> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
> > Did follow an advice in this group and added the polls app in 
> settings.py, 
> > but it did not help. Nothing else is changed in the autosettings from a 
> > fresh install of django 10.1.6. 
> > 
> > Is this a python problem or an OS problem? 
> > 
> > Here is my code: 
> > 
> > # Your first view: opprettet polls/urls.py 
> > 
> > from django.conf.urls import url 
> > 
> > from . import views 
> > 
> > urlpatterns = [ 
> > url(r'ˆ$', views.index, name='index'), 
> > ] 
> > 
> > # Your first view polls/views.py 
> > 
> > from django.http import HttpResponse 
> > 
> > def index(request): 
> > return HttpResponse("Hoppla, polls index her..") 
> > 
> > # Site/urls.py 
> > 
> > from django.conf.urls import include, url 
> > from django.contrib import admin 
> > 
> > urlpatterns = [ 
> > url(r'ˆpolls/', include('polls.urls')), 
> > url(r'^admin/', admin.site.urls), 
> > ] 
> > # Site/settings.py 
> > # Application definition 
> > 
> > INSTALLED_APPS = [ 
> > 'django.contrib.admin', 
> > 'django.contrib.auth', 
> > 'django.contrib.contenttypes', 
> > 'django.contrib.sessions', 
> > 'django.contrib.messages', 
> > 'django.contrib.staticfiles', 
> > 'polls.apps.PollsConfig', 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2db41c0f-284d-42e5-9f54-6b58452827b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
I think I see your problem.
Look like you can type a character looking a lot like ^ but being different.
^ is ascii character 94, which represent the start of a line in a
regular expression.

2017-03-07 14:10 GMT+01:00 ludovic coues :
> Is there any information on the 404 page ?
> I remember django being quite chatty as long it's in debug mode
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck :
>> Hi,
>> I have startet the first part of the djangoproject tutorial and get stuck in
>> part 1 - getting 404 errors on /polls/ - the admin page is ok.
>> Any one have an idea about what is wrong?
>>
>> Followed the instructions carefully (django 1.10 - version). Running in
>> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
>> Did follow an advice in this group and added the polls app in settings.py,
>> but it did not help. Nothing else is changed in the autosettings from a
>> fresh install of django 10.1.6.
>>
>> Is this a python problem or an OS problem?
>>
>> Here is my code:
>>
>> # Your first view: opprettet polls/urls.py
>>
>> from django.conf.urls import url
>>
>> from . import views
>>
>> urlpatterns = [
>> url(r'ˆ$', views.index, name='index'),
>> ]
>>
>> # Your first view polls/views.py
>>
>> from django.http import HttpResponse
>>
>> def index(request):
>> return HttpResponse("Hoppla, polls index her..")
>>
>> # Site/urls.py
>>
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>> urlpatterns = [
>> url(r'ˆpolls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>> # Site/settings.py
>> # Application definition
>>
>> INSTALLED_APPS = [
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'polls.apps.PollsConfig',
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTaWSevQaw4ngdHJCm27S8CGp66%3DCj2LjtAO4STszACgyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
Is there any information on the 404 page ?
I remember django being quite chatty as long it's in debug mode

2017-03-07 10:56 GMT+01:00 Vanja Falck :
> Hi,
> I have startet the first part of the djangoproject tutorial and get stuck in
> part 1 - getting 404 errors on /polls/ - the admin page is ok.
> Any one have an idea about what is wrong?
>
> Followed the instructions carefully (django 1.10 - version). Running in
> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
> Did follow an advice in this group and added the polls app in settings.py,
> but it did not help. Nothing else is changed in the autosettings from a
> fresh install of django 10.1.6.
>
> Is this a python problem or an OS problem?
>
> Here is my code:
>
> # Your first view: opprettet polls/urls.py
>
> from django.conf.urls import url
>
> from . import views
>
> urlpatterns = [
> url(r'ˆ$', views.index, name='index'),
> ]
>
> # Your first view polls/views.py
>
> from django.http import HttpResponse
>
> def index(request):
> return HttpResponse("Hoppla, polls index her..")
>
> # Site/urls.py
>
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'ˆpolls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
> # Site/settings.py
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'polls.apps.PollsConfig',
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTbHytjDdJ9Ti36oRrqWv89Cmzb_xNfP0M7%3D43sfEM%3Da_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Hi,
I have startet the first part of the djangoproject tutorial and get stuck 
in part 1 - getting 404 errors on /polls/ - the admin page is ok.
Any one have an idea about what is wrong?

Followed the instructions carefully (django 1.10 - version). Running in 
virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
Did follow an advice in this group and added the polls app in settings.py, 
but it did not help. Nothing else is changed in the autosettings from a 
fresh install of django 10.1.6.

Is this a python problem or an OS problem?

Here is my code:

# Your first view: opprettet polls/urls.py

from django.conf.urls import url

from . import views

urlpatterns = [
url(r'ˆ$', views.index, name='index'),
]

# Your first view polls/views.py

from django.http import HttpResponse

def index(request):
return HttpResponse("Hoppla, polls index her..")

# Site/urls.py

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'ˆpolls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
# Site/settings.py
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls.apps.PollsConfig',
  


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread Melvyn Sopacua
On Friday 03 March 2017 20:37:29 Tom Tanner wrote:
> When the iframe requests
> `/interactive`, it loads `interactive-1/index.html`.

But the iframe still loads /interactive. So it's base url is /interactive and a 
request for scripts/main.js is /interactive/scripts/main.js.

Unless you either:
1/ Do a redirect, which is the simplest
2/ Request your resources incorporating the session id

I still would go for 1/, simply because that fixes the disconnect between 
template path / view path and requested url.
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1534032.trWzQqoBk9%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread chris rose
there is a lack of information here, though you last post suggests maybe 
you missed a couple of template tags

at the start of you index.html add:

{% load staticfiles %}

and then when adding you scripts use:



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a87d42ff-b73d-4c59-b384-e77a5a52971d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-04 Thread Daniel Roseman
On Saturday, 4 March 2017 15:57:49 UTC, Tom Tanner wrote:
>
> >How are you referring to the assets in the template?
>
> In `interactive/index.html`, in the `` tag, I have ` src="scripts/main.js">`
>

Well, if you wanted to load the scripts from 
/interactive-1/scripts/main.js, then that's what you should use as the src, 
surely?
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5fe5c543-8d35-4521-836b-163de1554a72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-04 Thread Tom Tanner
>How are you referring to the assets in the template?

In `interactive/index.html`, in the `` tag, I have ``

On Saturday, March 4, 2017 at 8:55:22 AM UTC-5, Daniel Roseman wrote:
>
> On Saturday, 4 March 2017 13:30:37 UTC, Tom Tanner wrote:
>>
>> In my `views.py`, I have one path render an html file:
>>
>> def interactive(request):
>> if request.session.get('interactiveID') == None:
>> t= get_template('blank-interactive.html')
>> else:
>> interactive_template= 'interactive-' + str(request.session['id']) + 
>> '/index.html'
>> t= get_template(interactive_template)
>> 
>> return HttpResponse(t.render())
>>
>> So `form.html` has an `` that requests `/interactive`, and 
>> `request.session['id']` is set to `1`. When the iframe requests 
>> `/interactive`, it loads `interactive-1/index.html`. The iframe loads the 
>> HTML from that page, but cannot get the JS file at 
>> `interactive-1/scripts/main.js`. 
>>
>> When I check the terminal, I see this 404 error: `GET 
>> /interactive/scripts/main.js`. If it would just load 
>> `/interactive-1/scripts/main.js`, there would be no problem. But Django 
>> loads `/interactive-1/index.html`, but not 
>> `/interactive-1/scripts/main.js`. Same goes for the CSS and image assets, 
>> which are in CSS and image folders.
>>
>> What do I need to change in Django for it to correctly load the JS, CSS, 
>> images and other assets?
>>
>
> There's not really enough information here to answer your question. How 
> are you referring to the assets in the template? Why do you have a 
> different path for those assets? Note though that template paths and asset 
> paths have nothing whatsoever to do with each other.
> -- 
> DR.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a788ad6-a6bb-4586-8a89-681ceacb857c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-04 Thread Daniel Roseman
On Saturday, 4 March 2017 13:30:37 UTC, Tom Tanner wrote:
>
> In my `views.py`, I have one path render an html file:
>
> def interactive(request):
> if request.session.get('interactiveID') == None:
> t= get_template('blank-interactive.html')
> else:
> interactive_template= 'interactive-' + str(request.session['id']) + 
> '/index.html'
> t= get_template(interactive_template)
> 
> return HttpResponse(t.render())
>
> So `form.html` has an `` that requests `/interactive`, and 
> `request.session['id']` is set to `1`. When the iframe requests 
> `/interactive`, it loads `interactive-1/index.html`. The iframe loads the 
> HTML from that page, but cannot get the JS file at 
> `interactive-1/scripts/main.js`. 
>
> When I check the terminal, I see this 404 error: `GET 
> /interactive/scripts/main.js`. If it would just load 
> `/interactive-1/scripts/main.js`, there would be no problem. But Django 
> loads `/interactive-1/index.html`, but not 
> `/interactive-1/scripts/main.js`. Same goes for the CSS and image assets, 
> which are in CSS and image folders.
>
> What do I need to change in Django for it to correctly load the JS, CSS, 
> images and other assets?
>

There's not really enough information here to answer your question. How are 
you referring to the assets in the template? Why do you have a different 
path for those assets? Note though that template paths and asset paths have 
nothing whatsoever to do with each other.
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8176ee4a-9946-4c3a-80db-cab0d780e984%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-04 Thread Tom Tanner
In my `views.py`, I have one path render an html file:

def interactive(request):
if request.session.get('interactiveID') == None:
t= get_template('blank-interactive.html')
else:
interactive_template= 'interactive-' + str(request.session['id']) + 
'/index.html'
t= get_template(interactive_template)

return HttpResponse(t.render())

So `form.html` has an `` that requests `/interactive`, and 
`request.session['id']` is set to `1`. When the iframe requests 
`/interactive`, it loads `interactive-1/index.html`. The iframe loads the 
HTML from that page, but cannot get the JS file at 
`interactive-1/scripts/main.js`. 

When I check the terminal, I see this 404 error: `GET 
/interactive/scripts/main.js`. If it would just load 
`/interactive-1/scripts/main.js`, there would be no problem. But Django 
loads `/interactive-1/index.html`, but not 
`/interactive-1/scripts/main.js`. Same goes for the CSS and image assets, 
which are in CSS and image folders.

What do I need to change in Django for it to correctly load the JS, CSS, 
images and other assets?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d94bfa19-0250-4a90-93be-63e18889cb53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: URLconf problem: why I'm geting 404 error when I should'nt?

2016-08-23 Thread Lao Zzi
read the django tutorial first. There is good django tutorial on the official site and also there is "django girls" tutorial on the internet. Both of them is good. Django doesn't see your urlconf. See at error, django find only ^admin/ regex. Your regex is not finded, so you have to edit you urls.py file. There is so mess inside it. Write it like this:urls.py filefrom django.conf.urls import url, includefrom django.contrib import adminfrom . import viewsurlpatterns=[    url('r^admin/', admin.site.urls),    url('r^hello/', views.hello),] The dot sign '.' means the current directory. You are importing views.py file from current directory, and then call hello view from it, like this views.hello.I think, it's also possible to write "from .views import hello", and use this view just by name 'hello', without writing "view." before it, but I don't this way, because using views.hello is more logical and clear.20.08.2016, 17:36, "Anahita Hedayati-Fard" <a.hedayat...@gmail.com>: Hello I'm a beginner in Django. I'm trying to write my first URlconf but it doesn't work and it shows me 404 error just like this: And this my code on urls.py: And this is my code on views.py : And I ran the python manage.py runserve too. What is the problem here? *Sorry for my English. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/967673b8-07f4-416e-ad61-ad489c9826d2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/340541471880459%40web13o.yandex.ru.
For more options, visit https://groups.google.com/d/optout.


Re: Getting a PageNotFound 404 Error

2015-07-29 Thread Александр Мусаров
Thanks a lot!!! Damned regexes...

среда, 29 июля 2015 г., 19:56:46 UTC+3 пользователь James Schneider написал:
>
> Instead of /w you should use \w in your URL regex, right now all you are 
> matching is literally  - and / and w...
>
> -James
> On Jul 29, 2015 9:52 AM, "Александр Мусаров"  > wrote:
>
>> Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it, 
>> and now I'm having a mistake that I can not find in code myself. Please 
>> help me..
>>
>> The code is the following: 
>>
>> The trouble URL code line :   url(r'^(?P[-/w]+)/$', 
>> views.category, name = 'category_detail'),
>>
>> The view code : def category(request, category_slug):
>>c = get_object_or_404(Category, category_slug 
>> = category_slug)
>>products = c.product_set.all()
>>page_title = c.category_name
>>meta_keywords = c.category_meta_keywords
>>meta_description = c.category_meta_description
>>return render(request, 
>> 'categories/category.html', locals())
>>
>> Thanks for your help in advance..
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aed27f33-b955-4d32-a381-eaa65503de31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting a PageNotFound 404 Error

2015-07-29 Thread James Schneider
Instead of /w you should use \w in your URL regex, right now all you are
matching is literally  - and / and w...

-James
On Jul 29, 2015 9:52 AM, "Александр Мусаров"  wrote:

> Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it,
> and now I'm having a mistake that I can not find in code myself. Please
> help me..
>
> The code is the following:
>
> The trouble URL code line :   url(r'^(?P[-/w]+)/$',
> views.category, name = 'category_detail'),
>
> The view code : def category(request, category_slug):
>c = get_object_or_404(Category, category_slug =
> category_slug)
>products = c.product_set.all()
>page_title = c.category_name
>meta_keywords = c.category_meta_keywords
>meta_description = c.category_meta_description
>return render(request,
> 'categories/category.html', locals())
>
> Thanks for your help in advance..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW65g%2BGYTg6Ok3%2BSUep1jUROkohAU%2BB_vfGs5Ges2ddfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Getting a PageNotFound 404 Error

2015-07-29 Thread Александр Мусаров
Hi, folks! I'm new to Django, now I'm writing my first e-commerce in it, 
and now I'm having a mistake that I can not find in code myself. Please 
help me..

The code is the following: 

The trouble URL code line :   url(r'^(?P[-/w]+)/$', 
views.category, name = 'category_detail'),

The view code : def category(request, category_slug):
   c = get_object_or_404(Category, category_slug = 
category_slug)
   products = c.product_set.all()
   page_title = c.category_name
   meta_keywords = c.category_meta_keywords
   meta_description = c.category_meta_description
   return render(request, 
'categories/category.html', locals())

Thanks for your help in advance..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3866fec2-4497-48c9-9f83-86f98c0143cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keep getting 404 error

2012-03-25 Thread Sergiy Khohlov
try to open http://127.0.0.1:8000/hello

2012/3/25 Sithembewena Lloyd Dube :
> Hi Mika,
>
> Welcome to Django.
>
> I think the issue is that the URL 'http://127.0.0.1:8000/' merely points to
> your local machine's port (8000), whereas you want to browse to
> 'http://127.0.0.1:8000/hello/' - which is the URL defined in your urls.py
> file which maps to your "homepage" view (hello).
>
>
> On Sat, Mar 24, 2012 at 11:40 PM, Mika  wrote:
>>
>> I'm a total newbie to django and just started the book. I created a
>> project and I'm now trying to create my first page, but I keep getting
>> an error page that says:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL:    http://127.0.0.1:8000/
>> Using the URLconf defined in redlab.urls, Django tried these URL
>> patterns, in this order:
>> ^hello/$
>> The current URL, , didn't match any of these.
>>
>>
>> Here's what's in my urls.py file:
>>
>> from django.conf.urls.defaults import*
>> from redlab.views import hello
>>
>> urlpatterns = patterns('', ('^hello/$', hello),)
>>
>> # Uncomment the next two lines to enable the admin:
>> # from django.contrib import admin
>> # admin.autodiscover()
>> # Examples:
>>    # url(r'^$', 'redlab.views.home', name='home'),
>>    # url(r'^redlab/', include('redlab.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)),
>>
>>
>> please advise. thnx.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Keep getting 404 error

2012-03-24 Thread Mika
I'm a total newbie to django and just started the book. I created a
project and I'm now trying to create my first page, but I keep getting
an error page that says:

Page not found (404)
Request Method: GET
Request URL:http://127.0.0.1:8000/
Using the URLconf defined in redlab.urls, Django tried these URL
patterns, in this order:
^hello/$
The current URL, , didn't match any of these.


Here's what's in my urls.py file:

from django.conf.urls.defaults import*
from redlab.views import hello

urlpatterns = patterns('', ('^hello/$', hello),)

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
# Examples:
# url(r'^$', 'redlab.views.home', name='home'),
# url(r'^redlab/', include('redlab.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)),


please advise. thnx.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: StackedLinein and 404 error

2011-10-13 Thread akshar raaj
As pointed by the error message you are getting, the url you tried did not
match any of the urls django is aware of.

For using any Model in the admin, you need to register it with the admin. As
evident from your url, you are trying to use a model named Choice under
polls app. But you have not registered this model in the admin.

So, in your admin.py you need to add the following line:

admin.site.register(Choice)

This line should be added after or before the following line:

admin.site.register(Poll, PollAdmin)

Hopefully this should work if everything else is correct.

Thanks,
Akshar


On Sun, Oct 9, 2011 at 7:45 AM, EdgarAllenPoe wrote:

> Working on django tutorial here:
> https://docs.djangoproject.com/en/dev/intro/tutorial02/
> and I am stuck where they start the instructions about Stackedlnline.
> I keep getting the following error:
>
> Page not found (404)
> Request Method: GET
> Request URL:http://127.0.0.1:8000/admin/polls/choice/add/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>^admin/ ^$ [name='index']
>^admin/ ^logout/$ [name='logout']
>^admin/ ^password_change/$ [name='password_change']
>^admin/ ^password_change/done/$ [name='password_change_done']
>^admin/ ^jsi18n/$ [name='jsi18n']
>^admin/ ^r/(?P\d+)/(?P.+)/$
>^admin/ ^(?P\w+)/$ [name='app_list']
>^admin/ ^polls/poll/
>^admin/ ^auth/group/
>^admin/ ^sites/site/
>^admin/ ^auth/user/
>
> The current URL, admin/polls/choice/add/, didn't match any of these.
>
> My admin.py and urls.py are shown below
>
> Can some one take a look and tell me where I am going wrong?
>
> *admin.py**
>
> from polls.models import Poll
> from polls.models import Choice
> from django.contrib import admin
>
> class ChoiceInline(admin.StackedInline):
>model = Choice
>extra = 3
>
> class PollAdmin(admin.ModelAdmin):
>fieldsets = [
>(None,   {'fields': ['question']}),
>('Date information', {'fields': ['pub_date'], 'classes':
> ['collapse']}),
>]
>inlines = [ChoiceInline]
>
> admin.site.register(Poll, PollAdmin)
>
> *urls.py*
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
># Example:
># (r'^mysite/', include('mysite.foo.urls')),
>
># Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
># to INSTALLED_APPS to enable admin documentation:
># (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
># Uncomment the next line to enable the admin:
>(r'^admin/', include(admin.site.urls)),
> )
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



StackedLinein and 404 error [SOLVED]

2011-10-08 Thread EdgarAllenPoe
There was nothing wrong with the code.  I just needed to restart my
server, and it worked like a charm


On Oct 8, 11:15 pm, EdgarAllenPoe  wrote:
> Working on django tutorial 
> here:https://docs.djangoproject.com/en/dev/intro/tutorial02/
> and I am stuck where they start the instructions about Stackedlnline.
> I keep getting the following error:
>
> Page not found (404)
> Request Method:         GET
> Request URL:    http://127.0.0.1:8000/admin/polls/choice/add/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>     ^admin/ ^$ [name='index']
>     ^admin/ ^logout/$ [name='logout']
>     ^admin/ ^password_change/$ [name='password_change']
>     ^admin/ ^password_change/done/$ [name='password_change_done']
>     ^admin/ ^jsi18n/$ [name='jsi18n']
>     ^admin/ ^r/(?P\d+)/(?P.+)/$
>     ^admin/ ^(?P\w+)/$ [name='app_list']
>     ^admin/ ^polls/poll/
>     ^admin/ ^auth/group/
>     ^admin/ ^sites/site/
>     ^admin/ ^auth/user/
>
> The current URL, admin/polls/choice/add/, didn't match any of these.
>
> My admin.py and urls.py are shown below
>
> Can some one take a look and tell me where I am going wrong?
>
> *admin.py**
>
> from polls.models import Poll
> from polls.models import Choice
> from django.contrib import admin
>
> class ChoiceInline(admin.StackedInline):
>     model = Choice
>     extra = 3
>
> class PollAdmin(admin.ModelAdmin):
>     fieldsets = [
>         (None,               {'fields': ['question']}),
>         ('Date information', {'fields': ['pub_date'], 'classes':
> ['collapse']}),
>     ]
>     inlines = [ChoiceInline]
>
> admin.site.register(Poll, PollAdmin)
>
> *urls.py*
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
>     # Example:
>     # (r'^mysite/', include('mysite.foo.urls')),
>
>     # Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
>     # to INSTALLED_APPS to enable admin documentation:
>     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
>     # Uncomment the next line to enable the admin:
>     (r'^admin/', include(admin.site.urls)),
> )

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



StackedLinein and 404 error

2011-10-08 Thread EdgarAllenPoe
Working on django tutorial here: 
https://docs.djangoproject.com/en/dev/intro/tutorial02/
and I am stuck where they start the instructions about Stackedlnline.
I keep getting the following error:

Page not found (404)
Request Method: GET
Request URL:http://127.0.0.1:8000/admin/polls/choice/add/

Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:

^admin/ ^$ [name='index']
^admin/ ^logout/$ [name='logout']
^admin/ ^password_change/$ [name='password_change']
^admin/ ^password_change/done/$ [name='password_change_done']
^admin/ ^jsi18n/$ [name='jsi18n']
^admin/ ^r/(?P\d+)/(?P.+)/$
^admin/ ^(?P\w+)/$ [name='app_list']
^admin/ ^polls/poll/
^admin/ ^auth/group/
^admin/ ^sites/site/
^admin/ ^auth/user/

The current URL, admin/polls/choice/add/, didn't match any of these.

My admin.py and urls.py are shown below

Can some one take a look and tell me where I am going wrong?

*admin.py**

from polls.models import Poll
from polls.models import Choice
from django.contrib import admin

class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3

class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None,   {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':
['collapse']}),
]
inlines = [ChoiceInline]

admin.site.register(Poll, PollAdmin)

*urls.py*

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.foo.urls')),

# Uncomment the admin/doc line below and add
'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Mystery... Faked Referrer Generates 500 Instead of 404 Error

2011-08-31 Thread Reinout van Rees

On 31-08-11 21:19, charris wrote:

Hello.  I hope someone can provide some clues.I have begun receiving
regular 500 errors from a page that does not exist.  Without providing
the entire error page, here are the essentials:

   [Django] ERROR (EXTERNAL IP): Internal Server Error:/sample/
path/calendar.pl

   IOError: request data read error

   'HTTP_REFERER': 'http://mydomain.org/calendar.pl',
   'PATH_INFO': u'/sample/path/calendar.pl',

If I visit the pagehttp://mydomain.org/calendar.pl, I get a 404
error, but the error message referencing the same page generates an
internal server (500) error.


Some ideas:

.pl sounds like a perl script. Perhaps google is hitting your server 
with now-non-existing urls?


Regarding the error 500: can you put your server in debug mode for a 
couple of minutes? Then you can see the exact error in your browser. 
(Note that django 1.3 allows you to set up your logging so that those 
500 errors end up in the logfile.)


The HTTP_REFERER header lists the page the request comes from, so 
getting a 404 on that page and a 500 on another page isn't strange.


Request data read error: perhaps someone is trying to DDOS you: open 
connections to your webserver but not closing them in an effort to hose 
your webserver. Django gives a request data read error, perhaps, because 
the connection stayed open but no data was forthcoming.


I don't know about your webserver, but you can probably tell your 
webserver to immediately tell visitors to those specific pages that the 
page is gone (apache rewriterule, for instance, with a "410 GONE" response).



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Mystery... Faked Referrer Generates 500 Instead of 404 Error

2011-08-31 Thread charris
Hello.  I hope someone can provide some clues.I have begun receiving
regular 500 errors from a page that does not exist.  Without providing
the entire error page, here are the essentials:

  [Django] ERROR (EXTERNAL IP): Internal Server Error: /sample/
path/calendar.pl

  IOError: request data read error

  'HTTP_REFERER': 'http://mydomain.org/calendar.pl',
  'PATH_INFO': u'/sample/path/calendar.pl',

If I visit the page http://mydomain.org/calendar.pl, I get a 404
error, but the error message referencing the same page generates an
internal server (500) error.

QUESTIONS:
Should I be concerned?
Why do I get a 500 error instead of 404 error?
Any suggestions for troubleshooting?

This has been driving me nuts for a few days.  Any help is very
appreciated.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 404 error in admin interface with mod_python and >=django-1.1

2010-06-11 Thread Jan Meier

On 11 Jun., 15:30, Karen Tracey  wrote:
> Yes, you've got your admin registrations in your models.py file. models.py
> won't necessarily be loaded early in a production environment with
> DEBUG=False, so these registration calls are not running before you start
> using admin. Move admin registrations to an admin.py file and call
> admin.autodiscover() in your urls.py file 
> (seehttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-admin...)
> and the problem will go away.

Thank you very much, that solved my problem. :-)

Regards,
Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 404 error in admin interface with mod_python and >=django-1.1

2010-06-11 Thread Karen Tracey
On Fri, Jun 11, 2010 at 4:49 AM, Jan Meier  wrote:

> And my model my_app/models.py looks as follows:
>
> from django.db import models
> from django.contrib import admin
>
> class Blubb(models.Model):
>x = models.IntegerField()
>
> admin.site.register(Blubb)
>
> Any ideas what could be wrong?
>


Yes, you've got your admin registrations in your models.py file. models.py
won't necessarily be loaded early in a production environment with
DEBUG=False, so these registration calls are not running before you start
using admin. Move admin registrations to an admin.py file and call
admin.autodiscover() in your urls.py file (see
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf)
and the problem will go away.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



404 error in admin interface with mod_python and >=django-1.1

2010-06-11 Thread Jan Meier
Hi,

I am serving my django project with mod_python and ran into a problem
regarding the admin interface (django.contrib.admin). If DEBUG = False
is set in settings.py the admin interface generates 404 error messages
when clicking on any of my models, for example to add a new entry. The
django shipped models work without any problems. If I set DEBUG = True
everything works fine as expected. It is odd that the models show up
in the interface but clicking them generates 404 errors.
The problem occurs with django-1.1.2 and django-1.2.1, django-1.0.*
works fine.
I tested this on debian and ubuntu with different projects. To hunt
the problem down I tested with mod_wsgi, which has the same problem.

Here is my apache configuration with mod_python:


ServerAdmin webmas...@localhost
DocumentRoot /home/jan/tmp/my_project
Options Indexes FollowSymLinks


SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/jan/tmp/my_project/', ] +
sys.path"
SetEnv DJANGO_SETTINGS_MODULE my_project.settings
PythonOption django.root /mynew
PythonDebug On

 
SetHandler None


SetHandler None



Here is my settings.py configuration file:

DEBUG = False
TEMPLATE_DEBUG = DEBUG
[...]
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'my_project.urls'
TEMPLATE_DIRS = (
'/home/jan/tmp/my_project/templates'
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'my_project.my_app',
)

My urls.py url configuration file looks like this:

from django.conf.urls.defaults import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
 (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 (r'^admin/', include(admin.site.urls)),
)

And my model my_app/models.py looks as follows:

from django.db import models
from django.contrib import admin

class Blubb(models.Model):
x = models.IntegerField()

admin.site.register(Blubb)

Any ideas what could be wrong?

Kind regards,

Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: URL Matching: 404 Error

2010-01-30 Thread When ideas fail
Ah, I see, the problem is with the keys.., not the URLs

On 30 Jan, 22:16, When ideas fail  wrote:
> Hi, I seem to be having a problem matching one of my URLs.
> I have this URL in my .py file in one of my user app.
>
>  url(r'^activate/(?P\w+)/$',
>                            activate,
>                            name='registration_activate'),
>
> and then thats added to my project urls:
>
> (r'^users/', include('mysite.users.urls')),
>
> but then if I try to go 
> onhttp://localhost:8080/mysite/users/activate/sha1$7a0a7$37aacf25bd9d26...
>
> it says Page not found (404)
>
> but then it shows the list of URL patterns on the debug screen
> including:
>
> ^users/ ^activate/(?P\w+)/$.
>
> All my other URLs work fine, could someone suggest what might be wrong
> with this one?
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



URL Matching: 404 Error

2010-01-30 Thread When ideas fail
Hi, I seem to be having a problem matching one of my URLs.
I have this URL in my .py file in one of my user app.

 url(r'^activate/(?P\w+)/$',
   activate,
   name='registration_activate'),

and then thats added to my project urls:

(r'^users/', include('mysite.users.urls')),

but then if I try to go on
http://localhost:8080/mysite/users/activate/sha1$7a0a7$37aacf25bd9d262fe6137666cb29c558fb7630bd/

it says Page not found (404)

but then it shows the list of URL patterns on the debug screen
including:

^users/ ^activate/(?P\w+)/$.

All my other URLs work fine, could someone suggest what might be wrong
with this one?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: generic views 404 error

2009-10-27 Thread Brian McKeever

More info is needed. Could you post your urls?

On Oct 25, 8:39 pm, Ross  wrote:
> I just neared the end of the poll application and converted everything
> to generic views according to the tutorial. Once I started up the
> server though, I could only find my admin page. I tried using the
> newly named urls but I keep getting Page not Found 404 errors. Same
> thing happens when I type in the old urls. What did I do wrong? I've
> combed my syntax and can't find anything different from what the
> tutorial instructed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



generic views 404 error

2009-10-25 Thread Ross

I just neared the end of the poll application and converted everything
to generic views according to the tutorial. Once I started up the
server though, I could only find my admin page. I tried using the
newly named urls but I keep getting Page not Found 404 errors. Same
thing happens when I type in the old urls. What did I do wrong? I've
combed my syntax and can't find anything different from what the
tutorial instructed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URL Parameter is not found, 404 error

2009-09-22 Thread Malcolm MacKinnon
Thanks for your help, Daniel. I made the change.

On Mon, Sep 21, 2009 at 11:47 PM, Daniel Roseman wrote:

>
> On Sep 22, 2:31 am, Malcolm MacKinnon  wrote:
> > Thanks, Karen. With your help, I manged to fix it.
>
> Note that - quite apart from your original problem - you've got a
> serious inefficiency in this view. You iterate through every customer
> to find a matching customer number which, once you get more than a
> few, is going to take some time and use up tons of memory.
>
> Instead of getting all the customers and looping through, just do
> this:
>
> try:
>Customer.objects.get(custno=custnum)
> except Customer.DoesNotExist:
>return HttpResponseRedirect('/denied/')
>
> --
> DR.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URL Parameter is not found, 404 error

2009-09-22 Thread Daniel Roseman

On Sep 22, 2:31 am, Malcolm MacKinnon  wrote:
> Thanks, Karen. With your help, I manged to fix it.

Note that - quite apart from your original problem - you've got a
serious inefficiency in this view. You iterate through every customer
to find a matching customer number which, once you get more than a
few, is going to take some time and use up tons of memory.

Instead of getting all the customers and looping through, just do
this:

try:
Customer.objects.get(custno=custnum)
except Customer.DoesNotExist:
return HttpResponseRedirect('/denied/')

--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URL Parameter is not found, 404 error

2009-09-21 Thread Malcolm MacKinnon
Thanks, Karen. With your help, I manged to fix it.

On Mon, Sep 21, 2009 at 5:52 PM, Karen Tracey <kmtra...@gmail.com> wrote:

> On Mon, Sep 21, 2009 at 3:28 PM, Malcolm MacKinnon <mmack3...@gmail.com>wrote:
>
>> Hi,
>> I'm new to Django.
>>
> I keep getting a 404 error when I try to pass a "prod" parameter to a url.
>>
> I think it is just this last parameter that is giving me trouble.
>>
>> Here is my error:
>> Page not found (404)
>>
>> Request Method:GET
>> Request URL:
>> http://localhost/order_closeouts/imgs/WMS%20DIVA%20PANT%20BLK/ Here's my
>> url:
>>
>> (r'^order_closeouts/(?P\w{4})/(?P)w+/$',
>>  'onhand.views.order_closeouts',  ),
>>
>>
> First, the closing paren for the "prod" capture needs to be after the
> pattern of characters you are willing to accept for it, so:
>
> (r'^order_closeouts/(?P\w{4})/(?Pw+)/$',
>  'onhand.views.order_closeouts',  ),
>
> But that says you are willing to accept one or more 'w' characters for
> prod.  I expect you meant the character class \w:
>
> (r'^order_closeouts/(?P\w{4})/(?P\w+)/$',
>  'onhand.views.order_closeouts',  ),
>
> which would accept one or more alphanumerics or the underscore, that is the
> set [a-zA-Z0-9_].
>
> But that won't quite work for the URL you have specified, as it includes
> spaces (url-encoded as %20).  If you want to allow spaces as well you'll
> need to change the pattern to allow that:
>
> (r'^order_closeouts/(?P\w{4})/(?P[ \w]+)/$',
> 'onhand.views.order_closeouts',  ),
>
> Karen
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URL Parameter is not found, 404 error

2009-09-21 Thread Karen Tracey
On Mon, Sep 21, 2009 at 3:28 PM, Malcolm MacKinnon <mmack3...@gmail.com>wrote:

> Hi,
> I'm new to Django.
>
I keep getting a 404 error when I try to pass a "prod" parameter to a url.
>
I think it is just this last parameter that is giving me trouble.
>
> Here is my error:
> Page not found (404)
>
> Request Method:GET
> Request 
> URL:http://localhost/order_closeouts/imgs/WMS%20DIVA%20PANT%20BLK/Here's
> my url:
>
> (r'^order_closeouts/(?P\w{4})/(?P)w+/$',
>  'onhand.views.order_closeouts',  ),
>
>
First, the closing paren for the "prod" capture needs to be after the
pattern of characters you are willing to accept for it, so:

(r'^order_closeouts/(?P\w{4})/(?Pw+)/$',
 'onhand.views.order_closeouts',  ),

But that says you are willing to accept one or more 'w' characters for
prod.  I expect you meant the character class \w:

(r'^order_closeouts/(?P\w{4})/(?P\w+)/$',
 'onhand.views.order_closeouts',  ),

which would accept one or more alphanumerics or the underscore, that is the
set [a-zA-Z0-9_].

But that won't quite work for the URL you have specified, as it includes
spaces (url-encoded as %20).  If you want to allow spaces as well you'll
need to change the pattern to allow that:

(r'^order_closeouts/(?P\w{4})/(?P[ \w]+)/$',
'onhand.views.order_closeouts',  ),

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



URL Parameter is not found, 404 error

2009-09-21 Thread Malcolm MacKinnon
Hi,
I'm new to Django. I keep getting a 404 error when I try to pass a "prod"
parameter to a url. I think it is just this last parameter that is giving me
trouble.

Here is my error:
Page not found (404)Request Method:GETRequest URL:
http://localhost/order_closeouts/imgs/WMS%20DIVA%20PANT%20BLK/

Here's my url:

(r'^order_closeouts/(?P\w{4})/(?P)w+/$',
 'onhand.views.order_closeouts',  ),

Here is my view:

def order_closeouts(request,  foo=None,  prod=None):
prod=prod
ok='notok'
message1=''
u=request.user.username
custs=Cust.objects.all()
c_num=User.objects.get(username=u)
custnum=c_num.first_name
if not custnum or custnum=='':
return HttpResponseRedirect('/denied/')
cus=custnum
for i in custs:
if custnum in i.custno:
ok='ok'
if ok !='ok':
return HttpResponseRedirect('/denied/')
search_i=SearchForm()
form=InvtForm2()
forms=CustForm()
forms_mast=SoMastForm()
forms_tran=SoTranForm()
#use date
day=date.today()
today=day.isoformat()
if foo=='nchg':
message1='You did not order any products yet. Please proceed below.'
if foo=='chgs':
message1='Your changes were successful! Please continue.'
if foo=='edit':
customers=SomastTemp.objects.get(custno=request.user.first_name)
else:
customers=Cust.objects.get(custno=request.user.first_name)

return render_to_response('order_closeouts.html', {'prod':prod,
'foo':foo,'search':search_i,'form':form,'forms':forms, 'today': today,
'user':cus, 'forms_mast':forms_mast,  'forms_tran':forms_tran,
'customers':customers, 'message':message1}, context_instance =
RequestContext(request))

Any help or suggestions would be very much appreciated. Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



URL Parameter is not found, 404 error

2009-09-21 Thread Malcolm MacKinnon
Hi,
I'm new to Django. I keep getting a 404 error when I try to pass a "prod"
parameter to a url. I think it is just this last parameter that is giving me
trouble.

Here is my error:
Page not found (404)Request Method:GETRequest URL:
http://localhost/order_closeouts/imgs/WMS%20DIVA%20PANT%20BLK/

Here's my url:

(r'^order_closeouts/(?P\w{4})/(?P)w+/$',
 'onhand.views.order_closeouts',  ),

Here is my view:

def order_closeouts(request,  foo=None,  prod=None):
prod=prod
ok='notok'
message1=''
u=request.user.username
custs=Cust.objects.all()
c_num=User.objects.get(username=u)
custnum=c_num.first_name
if not custnum or custnum=='':
return HttpResponseRedirect('/denied/')
cus=custnum
for i in custs:
if custnum in i.custno:
ok='ok'
if ok !='ok':
return HttpResponseRedirect('/denied/')
search_i=SearchForm()
form=InvtForm2()
forms=CustForm()
forms_mast=SoMastForm()
forms_tran=SoTranForm()
#use date
day=date.today()
today=day.isoformat()
if foo=='nchg':
message1='You did not order any products yet. Please proceed below.'
if foo=='chgs':
message1='Your changes were successful! Please continue.'
if foo=='edit':
customers=SomastTemp.objects.get(custno=request.user.first_name)
else:
customers=Cust.objects.get(custno=request.user.first_name)

return render_to_response('order_closeouts.html', {'prod':prod,
'foo':foo,'search':search_i,'form':form,'forms':forms, 'today': today,
'user':cus, 'forms_mast':forms_mast,  'forms_tran':forms_tran,
'customers':customers, 'message':message1}, context_instance =
RequestContext(request))

Any help or suggestions would be very much appreciated. Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 500 Errors on 404 error?

2009-06-16 Thread Wiiboy

Fixed.  I had accidentally set handler404 to a blank string.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



500 Errors on 404 error?

2009-06-16 Thread Wiiboy

I finally got Django to email me about 404 and 500 errors.  To test
it, I typed in a random path, that I knew would be a 404 error.
However, I got an email, and an error page, about a 500 error.  The
email said the following:

 File "/home/schoo37/webapps/schoolgoo/lib/python2.5/django/core/
handlers/base.py", line 118, in get_response
   callback, param_dict = resolver.resolve404()

 File "/home/schoo37/webapps/schoolgoo/lib/python2.5/django/core/
urlresolvers.py", line 226, in resolve404
   return self._resolve_special('404')

 File "/home/schoo37/webapps/schoolgoo/lib/python2.5/django/core/
urlresolvers.py", line 221, in _resolve_special
   return getattr(import_module(mod_name), func_name), {}

 File "/home/schoo37/webapps/schoolgoo/lib/python2.5/django/utils/
importlib.py", line 35, in import_module
   __import__(name)

ValueError: Empty module name


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 11:45 PM, Julien Phalip  wrote:

>
> On Feb 10, 3:19 pm, Karen Tracey  wrote:
> > On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip  wrote:
> > > Hello again,
> >
> > > I finally fixed it with the following nasty hack:
> >
> > > class Entry(models.Model):
> > >... some fields ...
> >
> > > objects = models.Manager() # Nasty hack
> > >published = PublishedEntryManager()
> >
> > > It seems like the 'change_state' view uses the custom manager instead
> > > of the default one. Explicitly setting 'objects' make it work. If you
> > > can think of a more elegant fix, please let me know ;)
> >
> > ? The first manager declared IS the default manager, so if the first and
> > only manager you had declared was the restrictive one, that was the
> default,
> > so that is what was used.  Declaring an unrestricted manager first, as
> you
> > have done, is the documented way to have an unrestricted default manager
> > plus one or more custom more restrictive managers.
>
> I just checked out the doc again, and I had indeed missed that part on
> the order of managers. Thank you Karen for the pointer.
>
> What I found confusing though, is that the "change list" view
> displayed *all* entries, including the unpublished ones. So that view
> supposedly didn't use the one and only, restrictive, manager that I
> had defined. As opposed to the "change object" view which apparently
> made use of that restrictive manager. In effect, the unpublished
> entries were listed but when you clicked on them you got that 404
> page. Had the unpublished entries not showed up at all (including in
> the change list) I would have thought of an issue with managers
> earlier.
>
> Because it's an old version of Django, and not even a official
> release, that might just be a bug which was then fixed at a later
> stage.
>

I have a vague recollection of trying to recreate a ticket with a
description like that.  It had been written against old admin but I could
not recreate it with newforms-admin.  So yes, I think that was a bug fixed
along the way somewhere to newforms-admin.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Julien Phalip

On Feb 10, 3:19 pm, Karen Tracey  wrote:
> On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip  wrote:
> > Hello again,
>
> > I finally fixed it with the following nasty hack:
>
> > class Entry(models.Model):
> >        ... some fields ...
>
> >         objects = models.Manager() # Nasty hack
> >        published = PublishedEntryManager()
>
> > It seems like the 'change_state' view uses the custom manager instead
> > of the default one. Explicitly setting 'objects' make it work. If you
> > can think of a more elegant fix, please let me know ;)
>
> ? The first manager declared IS the default manager, so if the first and
> only manager you had declared was the restrictive one, that was the default,
> so that is what was used.  Declaring an unrestricted manager first, as you
> have done, is the documented way to have an unrestricted default manager
> plus one or more custom more restrictive managers.

I just checked out the doc again, and I had indeed missed that part on
the order of managers. Thank you Karen for the pointer.

What I found confusing though, is that the "change list" view
displayed *all* entries, including the unpublished ones. So that view
supposedly didn't use the one and only, restrictive, manager that I
had defined. As opposed to the "change object" view which apparently
made use of that restrictive manager. In effect, the unpublished
entries were listed but when you clicked on them you got that 404
page. Had the unpublished entries not showed up at all (including in
the change list) I would have thought of an issue with managers
earlier.

Because it's an old version of Django, and not even a official
release, that might just be a bug which was then fixed at a later
stage.

Regards,

Julien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip  wrote:

> Hello again,
>
> I finally fixed it with the following nasty hack:
>
> class Entry(models.Model):
>... some fields ...
>
> objects = models.Manager() # Nasty hack
>published = PublishedEntryManager()
>
> It seems like the 'change_state' view uses the custom manager instead
> of the default one. Explicitly setting 'objects' make it work. If you
> can think of a more elegant fix, please let me know ;)
>

? The first manager declared IS the default manager, so if the first and
only manager you had declared was the restrictive one, that was the default,
so that is what was used.  Declaring an unrestricted manager first, as you
have done, is the documented way to have an unrestricted default manager
plus one or more custom more restrictive managers.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Julien Phalip

On Feb 10, 7:52 am, Julien Phalip  wrote:
> On Feb 10, 7:41 am, Alex Gaynor  wrote:
>
> > I don't know what manager old forms admin used, but do you have a custom
> > manager that blocks access to some objects.
>
> Thanks Alex for your reply. You've made a really good point which
> helped me track this down. Here are the model and manager:
>
> class PublishedEntryManager(models.Manager):
>         def get_query_set(self):
>                 return super(PublishedEntryManager, 
> self).get_query_set().filter
> (pub_date__lte=datetime.now)
>
> class Entry(models.Model):
>         ... some fields ...
>         pub_date = models.DateTimeField()
>
>         published = PublishedEntryManager()
>
> In fact, if an entry has a pub_date set in the future, then it is not
> accessible in the admin. Somehow the admin seems to be using the
> PublishedEntryManager as default manager. Is there a way to force the
> admin to use the default manager?
>
> Thanks again,
>
> Julien

Hello again,

I finally fixed it with the following nasty hack:

class Entry(models.Model):
... some fields ...

objects = models.Manager() # Nasty hack
published = PublishedEntryManager()

It seems like the 'change_state' view uses the custom manager instead
of the default one. Explicitly setting 'objects' make it work. If you
can think of a more elegant fix, please let me know ;)

Regards,

Julien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Julien Phalip

On Feb 10, 7:41 am, Alex Gaynor  wrote:
> I don't know what manager old forms admin used, but do you have a custom
> manager that blocks access to some objects.

Thanks Alex for your reply. You've made a really good point which
helped me track this down. Here are the model and manager:

class PublishedEntryManager(models.Manager):
def get_query_set(self):
return super(PublishedEntryManager, self).get_query_set().filter
(pub_date__lte=datetime.now)

class Entry(models.Model):
... some fields ...
pub_date = models.DateTimeField()

published = PublishedEntryManager()

In fact, if an entry has a pub_date set in the future, then it is not
accessible in the admin. Somehow the admin seems to be using the
PublishedEntryManager as default manager. Is there a way to force the
admin to use the default manager?

Thanks again,

Julien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 3:40 PM, Julien Phalip  wrote:

>
> On Feb 9, 7:20 pm, Julien Phalip  wrote:
> > Hi,
> >
> > This is a strange case. I have a simple blog entry model which can be
> > edited in the admin, from the URL that looks like:
> http://www.example.com.au/admin/blog/entry/52/
> >
> > Now, what is strange is that the link above returns a 404. Same with
> > the entry id=51. Yet, entries with id=51,52 do exist.
> >
> > - All other entries (with id < 51) work fine in the admin.
> > - All entries (including id=51,52) work fine on the front end.
> > - Everything works fine when I test it locally on my computer with a
> > replica of the online database.
> >
> > I've never come across something like that, and I'm not sure where to
> > look to debug this. Would you have some hints to suggest?
> >
> > Thanks a lot for your help,
> >
> > Julien
> >
> > PS: It is using a quite old version of Django, a trunk revision
> > between 0.96 and 1.0.
>
> Hi,
>
> I've narrowed down the issue a bit. First, it's using revision 7901,
> that is before newforms-admin.
> The problem is in the 'change_stage' view:
>
> def change_stage(request, app_label, model_name, object_id):
>...
>try:
>manipulator = model.ChangeManipulator(object_id)
>except model.DoesNotExist:
>raise Http404('%s object with primary key %r does not exist' %
> (model_name, escape(object_id)))
>...
>
> When retrieving the manipulator it raises a 'DoesNotExist' exception:
>
> str: Traceback (most recent call last):
>  File "", line 1, in 
>  File "C:\Djangos\catalyst\django\db\models\manipulators.py", line
> 260, in __init__
>self.original_object = self.manager.get(pk=obj_key)
>  File "C:\Djangos\catalyst\django\db\models\manager.py", line 82, in
> get
>return self.get_query_set().get(*args, **kwargs)
>  File "C:\Djangos\catalyst\django\db\models\query.py", line 294, in
> get
>% self.model._meta.object_name)
> DoesNotExist: Entry matching query does not exist.
>
> But I only get that with those two Entry items (id=51,52). Why don't I
> get it for the other items (id < 51)?
>
> I'm really lost here. There must be some kind of corruption in the
> data meaning it cannot find those particular items, but what could it
> be? Again, those 2 blog entries work fine when displayed in the
> frontend.
>
> Do you think it could be a bug in that particular revision of Django
> I'm using?
>
> Any help would be appreciated.
>
> Julien
> >
>
I don't know what manager old forms admin used, but do you have a custom
manager that blocks access to some objects.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strange 404 error in admin

2009-02-09 Thread Julien Phalip

On Feb 9, 7:20 pm, Julien Phalip  wrote:
> Hi,
>
> This is a strange case. I have a simple blog entry model which can be
> edited in the admin, from the URL that looks 
> like:http://www.example.com.au/admin/blog/entry/52/
>
> Now, what is strange is that the link above returns a 404. Same with
> the entry id=51. Yet, entries with id=51,52 do exist.
>
> - All other entries (with id < 51) work fine in the admin.
> - All entries (including id=51,52) work fine on the front end.
> - Everything works fine when I test it locally on my computer with a
> replica of the online database.
>
> I've never come across something like that, and I'm not sure where to
> look to debug this. Would you have some hints to suggest?
>
> Thanks a lot for your help,
>
> Julien
>
> PS: It is using a quite old version of Django, a trunk revision
> between 0.96 and 1.0.

Hi,

I've narrowed down the issue a bit. First, it's using revision 7901,
that is before newforms-admin.
The problem is in the 'change_stage' view:

def change_stage(request, app_label, model_name, object_id):
...
try:
manipulator = model.ChangeManipulator(object_id)
except model.DoesNotExist:
raise Http404('%s object with primary key %r does not exist' %
(model_name, escape(object_id)))
...

When retrieving the manipulator it raises a 'DoesNotExist' exception:

str: Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Djangos\catalyst\django\db\models\manipulators.py", line
260, in __init__
self.original_object = self.manager.get(pk=obj_key)
  File "C:\Djangos\catalyst\django\db\models\manager.py", line 82, in
get
return self.get_query_set().get(*args, **kwargs)
  File "C:\Djangos\catalyst\django\db\models\query.py", line 294, in
get
% self.model._meta.object_name)
DoesNotExist: Entry matching query does not exist.

But I only get that with those two Entry items (id=51,52). Why don't I
get it for the other items (id < 51)?

I'm really lost here. There must be some kind of corruption in the
data meaning it cannot find those particular items, but what could it
be? Again, those 2 blog entries work fine when displayed in the
frontend.

Do you think it could be a bug in that particular revision of Django
I'm using?

Any help would be appreciated.

Julien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Strange 404 error in admin

2009-02-09 Thread Julien Phalip

Hi,

This is a strange case. I have a simple blog entry model which can be
edited in the admin, from the URL that looks like:
http://www.example.com.au/admin/blog/entry/52/

Now, what is strange is that the link above returns a 404. Same with
the entry id=51. Yet, entries with id=51,52 do exist.

- All other entries (with id < 51) work fine in the admin.
- All entries (including id=51,52) work fine on the front end.
- Everything works fine when I test it locally on my computer with a
replica of the online database.

I've never come across something like that, and I'm not sure where to
look to debug this. Would you have some hints to suggest?

Thanks a lot for your help,

Julien

PS: It is using a quite old version of Django, a trunk revision
between 0.96 and 1.0.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django + Apache (FastCGI): how to spread 404 error

2008-11-29 Thread Alexey Moskvin

Hi, I am using Django + Apache (via FastCGI).
I've made my own 404 page (404.html in templates dir) and turned debug
mode off.
When I'm requesting for non-existed page I see my custom error page,
but in Apache's log there is something like this:
"GET /authors/333.html HTTP/1.1" 200 368 "-" (the return code is 200,
not 404).
Also I've tried custom error view (handler404 in urls.py):

from django.http import HttpResponse

def handler404(request):
return HttpResponse('qqq', status=404)

I see 'qqq' when requesting for non-existed page, but there is still
200 code in logs, not 404.
How can I fix it?




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 404 Error HTTP_FORBIDDEN

2008-11-12 Thread Brandon Martin

Sorry it was as usual a stupid me error. I didn't have the correct document
root set in the main apache conf file.

Thanks
--
Brandon


On Wed, 12 Nov 2008 11:05:14 -0800 (PST), Raja <[EMAIL PROTECTED]> wrote:
> 
> Did you get this working fine in a dev environment? Id assume that
> everything under ~user/public_html will have Apache Location directive
> setup for allowing access and that might not be the case for other
> directories.
> Testing this on a sandbox environment should help to know where the
> problem is (With Django or apache setup).
> 
> -- Raja
> 
> On Nov 12, 11:57 pm, Brandon Martin <[EMAIL PROTECTED]> wrote:
>>  I had everything running fine with my django setup and apache vhost.
>> My project root dir was:
>>
>>  /home/user/public_html/django/project
>>
>>  I wanted to change the dir so I moved everything to:
>>
>>  /srv/django/project
>>
>>  I went into my vhost and changed the paths so they correspond to the
>> new root in the apache vhost file, but now when I navigate to the
>> website I get a Page Not Found 404 HTTP_FORBIDDEN.
>>
>>  I must have missed something. I did a google search but did't turn
>> up anything that looked helpful. Any ideas
>>
>>  Thanks
> -- 
--
Brandon Martin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 404 Error HTTP_FORBIDDEN

2008-11-12 Thread Raja

Did you get this working fine in a dev environment? Id assume that
everything under ~user/public_html will have Apache Location directive
setup for allowing access and that might not be the case for other
directories.
Testing this on a sandbox environment should help to know where the
problem is (With Django or apache setup).

-- Raja

On Nov 12, 11:57 pm, Brandon Martin <[EMAIL PROTECTED]> wrote:
>  I had everything running fine with my django setup and apache vhost.
> My project root dir was:
>
>  /home/user/public_html/django/project
>
>  I wanted to change the dir so I moved everything to:
>
>  /srv/django/project
>
>  I went into my vhost and changed the paths so they correspond to the
> new root in the apache vhost file, but now when I navigate to the
> website I get a Page Not Found 404 HTTP_FORBIDDEN.
>
>  I must have missed something. I did a google search but did't turn
> up anything that looked helpful. Any ideas
>
>  Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



404 Error HTTP_FORBIDDEN

2008-11-12 Thread Brandon Martin


 I had everything running fine with my django setup and apache vhost.
My project root dir was:  

 /home/user/public_html/django/project  

 I wanted to change the dir so I moved everything to:  

 /srv/django/project  

 I went into my vhost and changed the paths so they correspond to the
new root in the apache vhost file, but now when I navigate to the
website I get a Page Not Found 404 HTTP_FORBIDDEN.  

 I must have missed something. I did a google search but did't turn
up anything that looked helpful. Any ideas  

 Thanks 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache & mod_python 404 error on page access

2008-04-03 Thread Evert Rol

> Okay, so whenever I request anything through my apache server I get a
> 404 error. Here are my configuration files.
>
> Apache:
> 
> DocumentRoot /home/chainsofheaven.net/html
> ServerName chainsofheaven.net
> ServerAlias *.chainsofheaven.net
> 
> allow from all
> Options +Indexes
> 
> 
> SetHandler python.program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE html.settings
> PythonDebug On
> PythonPath "['/home/chainsofheaven.net/html', '/usr/lib/python2.4/ 
> site-
> packages'] + sys.path"
> 
> 

Not sure if this will solve your problem, but it appears you have some  
settings in your httdp.conf file that may clash, such as the  
DocumentRoot (which would normally serve static html files) being the  
same as the place where your Django apps live.
Also, you have DJANGO_SETTINGS_MODULE set to html.settings. I don't  
know your where that file is, but if it's /home/chainsofheave.net/html/ 
settings.py , then Django is not going to find it: it will search for / 
home/chainsofheave.net/html/html/settings.py instead, since /home/ 
chainsofheave.net/html is in your Python Path. So your Python Path  
should also include the directory above that (cf the basic  
configuration example in the docs, which even has settings.py in an  
entirely different place).

 From the log, it looks like Apache wants to show the directory  
listing of your DocumentRoot. If that's what you want, Jared  
suggestion may be correct, although a clash with Django/mod_python is  
also likely. If you want Django to serve your base URL, then the above  
should probably be corrected (and perhaps the DocumentRoot be moved as  
well).


> urls.py:
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
># Example:
># (r'^html/', include('html.foo.urls')),
>
># Uncomment this for admin:
> (r'^admin/', include('django.contrib.admin.urls')),
> )
>
>
> The error.log entries generated:
> [Mon Apr 07 09:35:15 2008] [notice] SIGHUP received.  Attempting to
> restart
> [Mon Apr 07 09:35:15 2008] [notice] mod_python: Creating 8 session
> mutexes based on 150 max processes and 0 max threads.
> [Mon Apr 07 09:35:15 2008] [notice] mod_python: using  
> mutex_directory /
> tmp
> [Mon Apr 07 09:35:15 2008] [notice] Apache/2.2.3 (Debian) mod_python/
> 3.2.10 Python/2.4.4 PHP/5.2.0-8+etch10 configured -- resuming normal
> operations
> [Mon Apr 07 09:35:17 2008] [error] [client 68.34.229.145] Attempt to
> serve directory: /home/chainsofheaven.net/html/
>
>
> I'm not sure what the problem is here. At this point I have nothing
> deployed except the admin interface.
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache & mod_python 404 error on page access

2008-04-03 Thread Jared

I'm certainly no django expert, but have you checked the ownership and
permissions on the html area you're trying to serve?

On Apr 3, 5:13 pm, pieaholicx <[EMAIL PROTECTED]> wrote:
> Okay, so whenever I request anything through my apache server I get a
> 404 error. Here are my configuration files.
>
> Apache:
> 
> DocumentRoot /home/chainsofheaven.net/html
> ServerName chainsofheaven.net
> ServerAlias *.chainsofheaven.net
> 
> allow from all
> Options +Indexes
> 
> 
> SetHandler python.program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE html.settings
> PythonDebug On
> PythonPath "['/home/chainsofheaven.net/html', '/usr/lib/python2.4/site-
> packages'] + sys.path"
> 
> 
>
> urls.py:
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>     # Example:
>     # (r'^html/', include('html.foo.urls')),
>
>     # Uncomment this for admin:
>      (r'^admin/', include('django.contrib.admin.urls')),
> )
>
> The error.log entries generated:
> [Mon Apr 07 09:35:15 2008] [notice] SIGHUP received.  Attempting to
> restart
> [Mon Apr 07 09:35:15 2008] [notice] mod_python: Creating 8 session
> mutexes based on 150 max processes and 0 max threads.
> [Mon Apr 07 09:35:15 2008] [notice] mod_python: using mutex_directory /
> tmp
> [Mon Apr 07 09:35:15 2008] [notice] Apache/2.2.3 (Debian) mod_python/
> 3.2.10 Python/2.4.4 PHP/5.2.0-8+etch10 configured -- resuming normal
> operations
> [Mon Apr 07 09:35:17 2008] [error] [client 68.34.229.145] Attempt to
> serve directory: /home/chainsofheaven.net/html/
>
> I'm not sure what the problem is here. At this point I have nothing
> deployed except the admin interface.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Apache & mod_python 404 error on page access

2008-04-03 Thread pieaholicx

Okay, so whenever I request anything through my apache server I get a
404 error. Here are my configuration files.

Apache:

DocumentRoot /home/chainsofheaven.net/html
ServerName chainsofheaven.net
ServerAlias *.chainsofheaven.net

allow from all
Options +Indexes


SetHandler python.program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE html.settings
PythonDebug On
PythonPath "['/home/chainsofheaven.net/html', '/usr/lib/python2.4/site-
packages'] + sys.path"



urls.py:
from django.conf.urls.defaults import *

urlpatterns = patterns('',
# Example:
# (r'^html/', include('html.foo.urls')),

# Uncomment this for admin:
 (r'^admin/', include('django.contrib.admin.urls')),
)


The error.log entries generated:
[Mon Apr 07 09:35:15 2008] [notice] SIGHUP received.  Attempting to
restart
[Mon Apr 07 09:35:15 2008] [notice] mod_python: Creating 8 session
mutexes based on 150 max processes and 0 max threads.
[Mon Apr 07 09:35:15 2008] [notice] mod_python: using mutex_directory /
tmp
[Mon Apr 07 09:35:15 2008] [notice] Apache/2.2.3 (Debian) mod_python/
3.2.10 Python/2.4.4 PHP/5.2.0-8+etch10 configured -- resuming normal
operations
[Mon Apr 07 09:35:17 2008] [error] [client 68.34.229.145] Attempt to
serve directory: /home/chainsofheaven.net/html/


I'm not sure what the problem is here. At this point I have nothing
deployed except the admin interface.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin section 404 error

2008-02-17 Thread Karen Tracey
On Feb 15, 2008 11:26 PM, Shadow <[EMAIL PROTECTED]> wrote:

>
> Error message:
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>   1. ^admin/
>
> The current URL, my-site.com/admin, didn't match any of these.
>

The ^ at the beginning of the urlpattern is significant, it marks the
beginning of the url.  Since your url has 'my-site.com' at the beginning, it
does not match '^admin/'.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >