Python Forum
how does importing work in django framewok ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how does importing work in django framewok ?
#1
I am new to python . Im learning django web framework . 

I dont understand how these lines of code works ?

at urls.py these two lines of code : 

from django.conf.urls import url
from . import views
in django\conf\urls I dont see any module with "url" name .how does it work actually?

and another question is how does " from . import views" work ? I dont understand this line of code .
Reply
#2
in the  /django/conf/urls/__init__.py you have url function.

for the second import see
https://docs.python.org/2/tutorial/modul...references
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,246 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020