Re: Link does not work correctly

2019-03-24 Thread Amirat A
Hey! so i viewed your code, and on your about page you have this:



Register

 (i found this here : 
recetas/greenf/greenfapp/templates/greenfapp/base.html)



but if you change it to what you suggested it should work perfectly fine :



Register

hope i could help?

On Tuesday, 12 March 2019 17:30:38 UTC, Barkalez XX wrote:
>
>
> Hi
>
> You can see my code in:
>
> https://github.com/barkalez/recetas
>
> I have it like this:
>
> Register
>
> El domingo, 10 de marzo de 2019, 18:22:29 (UTC+1), Gil Obradors escribió:
>>
>> Hi
>> I can't give you the exactly response,
>>
>> But I know that you are playing with href=url direct, without using 
>> django template code
>> I suggest you to change de href of register from about, to a href with 
>> django template code:
>> Something like : href="{% static 'greenfapp/main.css' %}
>> But I can't see at urls.py from user app, so I don't know if user apps 
>> register view has any name associociated to
>>
>> You must write something like href="{ url :'recetas-home' % }  ( nor 
>> direct url)
>>
>>
>> Good luck
>>
>>
>> Missatge de Barkalez XX  del dia dg., 10 de març 2019 
>> a les 15:28:
>>
>>>
>>> In the browser, when I'm in "http://127.0.0.1:8000/; and click in 
>>> register it takes me to "http://127.0.0.1:8000/register; and it works 
>>> correctly, but if I'm in "http: //127.0.0.1:8000/about/ "and click on 
>>> register takes me to" http://127.0.0.1:8000/about/register/ "instead 
>>> of" http://127.0.0.1:8000/register " . My project : 
>>> https://github.com/barkalez/recetas
>>>
>>> -- 
>>> 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/f77b7e65-3e0c-4f29-b951-d052e669fe20%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/4c497e7a-829f-4129-be4e-272212044351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in Django url mapping

2019-03-24 Thread omar ahmed
hello ...
your code is good 
but you forgot to put comma after second path in urls.py

urlpatterns = [

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

path('first_app/', include('first_app.urls')),


]

On Saturday, March 23, 2019 at 6:08:24 PM UTC+2, The Aryas wrote:
>
> Hey Guys, I am facing problem on django url mapping, I did exactly what my 
> couse said and copied the code text exactly,but it throws the error:-
>
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/index
>
> Using the URLconf defined in protwo.urls, Django tried these URL 
> patterns, in this order:
>
>1. admin/
>2. [name='index']
>
> The current path, index, 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.
>
>
>
>
> ##The code I written in my project are;:-
>
> 
>
> 
>
>
> from django.contrib import admin
>
> from django.urls import path, include
>
>
> urlpatterns = [
>
> path('admin/', admin.site.urls),
>
> path('first_app/', include('first_app.urls'))
>
>
> ]
>
> --
>
> ---
>
>
> 
>
>
> from django.contrib import admin
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
>
> path('index/', views.index, name="index"),
>
> ]
>
> -
> --
> 
>
> from django.shortcuts import render
> from django.http import HttpResponse
>
> # Create your views here.
> def index(request):
> return HttpResponse("Hello World")
>
> 
>
> 
>
> 
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'first_app'
> ]
>
>
> ---
>
> I dont know what to do , I could not find the error plz assist me, I am a 
> begginer to this cousre,
> Thank You!!
>
>

-- 
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/a526e914-6770-469c-9737-42e55ecba052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to filter 'Invalid HTTP_HOST header ...' errors

2019-03-24 Thread Mike Dewhirst

On 24/03/2019 9:28 pm, Jani Tiainen wrote:

Hi.

Usually HTTP_HOST should be generated from your frontend http server 
(nginx, apache or similar) and it shouldn't change randomly. If it 
does it's indication that someone actually had bypassed your http 
server and managed to call django directly.


Jani

Could you please explain what is happening in more detail?

Django is definitely generating these errors because it is saying 'You 
may need to add u'123.456.789.012' to ALLOWED_HOSTS.' Where the IP 
address is the IP address of the Apache server.


Thanks

Mike




On Sun, Mar 24, 2019 at 2:48 AM Mike Dewhirst > wrote:


I'm getting hundreds of Invalid HTTP_HOST header errors and need
to avoid having them emailed to ADMINS. My ISP has a limit on the
number of messages which can be sent per hour and occasionally
that gets exceeded and he complains the site is jamming his
queues. While that is a more or less jocular response I still need
to invest my time looking at these stupid emails.

My ALLOWED_HOSTS setting is locked down to only the correct
hostname and no IP addresses. All the errors are attempts to
access well known scripts which don't exist on the server or '/'

I am reasonably certain the answer to the problem sits somewhere
in the logging configuration but that's not trivial - for me anyway.

I'm having trouble deciphering
https://docs.djangoproject.com/en/1.11/topics/logging/#examples

Can anyone please point me to a worked example which addresses this?

Thanks

Mike


-- 
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/3a45a72c-714d-c003-e237-417c899c430e%40dewhirst.com.au

.
For more options, visit https://groups.google.com/d/optout.



--
Jani Tiainen
Software wizard

https://blog.jani.tiainen.cc/

Always open for short term jobs or contracts to work with Django.
--
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/CAHn91ofA0wT8SAePhPRhEm5VK6ooVD619X9xpX4tpycqO4K-Fw%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/1d6f48a7-d4d8-b670-b99c-797f8e837905%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


RE: Error in Django url mapping

2019-03-24 Thread Thaddeaus Iorbee
In your urls.py first_app, change 'index' to ''. That is empty string. 

127.0.0.1:8000/first_app  

That's all you need. It should work.

-- 
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/1e0af27f-b50f-4a3f-acd2-b796192645de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Error in Django url mapping

2019-03-24 Thread Thaddeaus Iorbee
Sorry, it should be first_project

-- 
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/b66998d7-769e-4dfb-887b-28c0d70b599f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to filter 'Invalid HTTP_HOST header ...' errors

2019-03-24 Thread Jani Tiainen
Hi.

Usually HTTP_HOST should be generated from your frontend http server
(nginx, apache or similar) and it shouldn't change randomly. If it does
it's indication that someone actually had bypassed your http server and
managed to call django directly.


On Sun, Mar 24, 2019 at 2:48 AM Mike Dewhirst  wrote:

> I'm getting hundreds of Invalid HTTP_HOST header errors and need to avoid
> having them emailed to ADMINS. My ISP has a limit on the number of messages
> which can be sent per hour and occasionally that gets exceeded and he
> complains the site is jamming his queues. While that is a more or less
> jocular response I still need to invest my time looking at these stupid
> emails.
>
> My ALLOWED_HOSTS setting is locked down to only the correct hostname and
> no IP addresses. All the errors are attempts to access well known scripts
> which don't exist on the server or '/'
>
> I am reasonably certain the answer to the problem sits somewhere in the
> logging configuration but that's not trivial - for me anyway.
>
> I'm having trouble deciphering
> https://docs.djangoproject.com/en/1.11/topics/logging/#examples
>
> Can anyone please point me to a worked example which addresses this?
>
> Thanks
>
> Mike
>
>
> --
> 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/3a45a72c-714d-c003-e237-417c899c430e%40dewhirst.com.au
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Jani Tiainen
Software wizard

https://blog.jani.tiainen.cc/

Always open for short term jobs or contracts to work with Django.

-- 
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/CAHn91ofA0wT8SAePhPRhEm5VK6ooVD619X9xpX4tpycqO4K-Fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.