page index.html

86 visualitzacions
Ves al primer missatge no llegit

REMY TOUITOU

no llegida,
18 d’ag. 2022, 16:26:3118/8/22
a Django users
Hello , i tried to mke appear the page index.html in a django application in visual code , but i just obtained the  first page of the django site.
Someone could give  the right procedure to obtain thie page index.html?

hajar Benjat

no llegida,
18 d’ag. 2022, 17:07:2918/8/22
a django...@googlegroups.com
did you make it right (what about the urls.py and views.py )

 width=Sans virus.www.avast.com

hajar Benjat

no llegida,
18 d’ag. 2022, 17:17:1218/8/22
a django...@googlegroups.com
for example this is your project name 'firstproject' and this is your app name 'firstapp' in your template you will create a html page named 'index.html' in your 'firstapp' views.py you need to create a function for example : 
 def index(request):
    return render(request, 'index.html')

in your 'firstapp' urls.py you need something like this 
urlpatterns = [
     path('',views.index,name="index"),
]

and then in your 'firstproject' urls.py you need this 
from django.urls import path,include
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('firstapp.urls')),
]
--

HAJAR BENJAT

- Specialized Master in Information Systems Engineering

At CADI AYYAD UNIVERSITY FSSM Marrakech

- Computer Science Teacher 

P: +212698608188                   

E: hajar....@edu.uca.ma

LinkedIn: https://www.linkedin.com/in/hajar-benjat-a92132106

subin

no llegida,
18 d’ag. 2022, 19:03:0318/8/22
a django...@googlegroups.com
Sorry it took me so long to get back to 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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMcj6Wf3evMhypW%3DOChVi-nUXoDQRU%2BZB-AFLtyEfvh1JJVh6Q%40mail.gmail.com.

subin

no llegida,
18 d’ag. 2022, 19:03:3518/8/22
a django...@googlegroups.com
Please let me know if that is okay.

--
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.

subin

no llegida,
18 d’ag. 2022, 19:05:4518/8/22
a django...@googlegroups.com
Thank you for your immediate response.

On Thu, Aug 18, 2022 at 9:26 PM REMY TOUITOU <touit...@gmail.com> wrote:
Hello , i tried to mke appear the page index.html in a django application in visual code , but i just obtained the  first page of the django site.
Someone could give  the right procedure to obtain thie page index.html?

--
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.

REMY TOUITOU

no llegida,
21 d’ag. 2022, 12:23:4721/8/22
a django...@googlegroups.com
Hello ,thank you for your help , 
it doesn't work yet
project.urls.py and the firstapp urls.py are two diffeérents pages ?
I don't arrive to make appear this two differents pages on isualcode , how can i do this?

--
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.

user8234

no llegida,
21 d’ag. 2022, 16:09:4021/8/22
a django...@googlegroups.com
Hello touit...@gmail.com,. If you are using a framework web then a "static files" path should be defined or located in the root folder then maybe is not rendering *nothing*.

REMY TOUITOU

no llegida,
24 d’ag. 2022, 5:45:2324/8/22
a django...@googlegroups.com
hello  , i have a question , i can't make the server running , when i do the command  py manage;py runserver , it gives a lot of error in differents files , before the server was running well;
i use visual studio code and conda ;
thanks you 
remy

Le jeu. 18 août 2022 à 23:06, hajar Benjat <hajar...@gmail.com> a écrit :
--

Asif Ahmed Khan

no llegida,
24 d’ag. 2022, 8:12:2324/8/22
a django...@googlegroups.com
What type of errors are you facing?
Can you send some screenshots?
or error details?



--
K. Asif Ahmed
System Manager
Maharashtra State Seeds Co. Ltd, Akola
http://www.mahabeej.com/

REMY TOUITOU

no llegida,
24 d’ag. 2022, 8:56:1224/8/22
a django...@googlegroups.com
ok , i will send this to you this evening
thanks you

ALBERT ASHABA AHEEBWA

no llegida,
24 d’ag. 2022, 9:53:0324/8/22
a django...@googlegroups.com
You need to share a screenshot for better help.
Though it is manage.py and not manage;py



Best Regards,

Albert Ashaba Aheebwa
+256 781 435857

Håkon Øyen

no llegida,
24 d’ag. 2022, 9:53:2524/8/22
a Django users
Try locating the first of the listed files. That's usually where the error is.

ahmed doudou

no llegida,
24 d’ag. 2022, 9:53:4224/8/22
a django...@googlegroups.com

Danish Nagori

no llegida,
24 d’ag. 2022, 9:53:4324/8/22
a django...@googlegroups.com
Hi
Dear I  think you run py manage; py runserver 
So please 
You run this command 
 py manage.py runserver 
This is write commnd 
Thanks 


REMY TOUITOU

no llegida,
25 d’ag. 2022, 7:01:1625/8/22
a django...@googlegroups.com
Hello here is the kind of error i have when i try to make the server run

Thanks you

Le mer. 24 août 2022 à 14:11, Asif Ahmed Khan <aasif...@gmail.com> a écrit :
thumbnail.jpg

ALBERT ASHABA AHEEBWA

no llegida,
25 d’ag. 2022, 7:22:1925/8/22
a django...@googlegroups.com
So what happens when you just run $python manage.py? Does it bring up a list of commands you can run? If not you have to activate your virtual environment properly if you are using any.
Or path to the virtual environment py script 



hajar Benjat

no llegida,
25 d’ag. 2022, 8:27:4025/8/22
a django...@googlegroups.com
Sorry Is there any space between runser ver??
 Or am I wrong!...
It must be "runserver"


ALBERT ASHABA AHEEBWA

no llegida,
25 d’ag. 2022, 8:33:2025/8/22
a django...@googlegroups.com
No. There is no space. It's just "runserver". One word 

REMY TOUITOU

no llegida,
26 d’ag. 2022, 5:42:4926/8/22
a django...@googlegroups.com
hello , when i try to make the server running , it is written:    commanderror:you must set settings.ALLOWED_hosts if debug is false
thanks you

ALBERT ASHABA AHEEBWA

no llegida,
26 d’ag. 2022, 6:16:0526/8/22
a django...@googlegroups.com
Hello, Make sure in your project folder settings.py file has DEBUG=True and ALLOWED_HOSTS=[].
set debug to true and allowed hosts to empty list.
And ensure no local server is running before you runserver again

hajar Benjat

no llegida,
26 d’ag. 2022, 6:17:3626/8/22
a django...@googlegroups.com
you have DEBUG=False in your project.settings.py and you need to edit allowed hosts that is required for security reasons,  

example : 
ALLOWED_HOSTS=[".example.com" , "127.0.0.1:8000","localhost:port"]  or ALLOWED_HOSTS=["*"]  for quick test but DON'T use '*' in production .



Respon a tots
Respon a l'autor
Reenvia
0 missatges nous