Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is there possibility for integrating css and html files with django?
i'm working on a personal project that involves full-stack development of a AI Recruiting website.I developed its backend using django.I know basic front end development.(HTML,CSS).But the thing is how to integrate my frontend designs with my django ?. -
Inserting v-modal attribute form django forms
I have a long form and I use django generated forms. {{form.myfield}} I want to insert v-model attribute form django forms. If in forms.py I do: widgets:{ 'my_field': forms.Textarea(attrs={ "v-model":"value", 'my-attrs':'value1', 'rows':4,} } Only my-attrs is rendered. <textarea name="my_fiels" my-attrs="value1" maxlength="500" cols="40" rows="4" class="textarea form-control">My text goes here</textarea> Is this possible to achieve? I want to do some frontend validation and manipulation and use vue instead of jquery. I now probably it is not the best practice, but in this case I would not need to re-write 50+ forms fields.. -
How to avoid url hitting from browser for Python Django application
I have a Djnago web application and my url looks like path('desgjson/', master.desg_get), and it direct to def desg_get(request): if request.method == 'GET': formm = mMasters.Masters() formm.entity_gid = decry_data(request.session['Entity_gid']) dict_add = formm.get_designation() return JsonResponse(json.dumps(dict_add), safe=False) Now i need the url only be access by the application, and by any browser url hit or from any tool. Thanks. -
BootStrap wokrs well locally yet failed after deploied on PythonAnyWhere
I learn from a tutorial of Django which builds a board. I follow everystep it tells me, and I really build a simple board locally. When I visit 127.0.0.1:8000 it look OK. However, it doesn't works well after I deploied it on PythonAnyWhere. I guess the problem maybe comes from the failing of Bootstrap? I checked some parallel Questions on stackoverflow, and I changed my setting.py to this. Still failed. STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'assets') STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] Thank you for your help! PS: the source code of this project on github is here: LINK -
How to implement PermissionRequiredMixin in function based view Django?
I can implement PermissionRequiredMixin in class based view but dont know hoe to implement in function based view. Can anybody help me? -
Django orm query access value
Respected Sir/Mam, I have two models want to get value of one model from another.Every this is explained in view.py comments. models.py class Service(models.Model): name = models.CharField(max_length=50) image = models.ImageField(upload_to='image', blank = True) #business_profile = models.ManyToManyField("BusinessProfile", blank=True, related_name="business_of_services") def __str__(self): return "Service - {}".format(self.name) class BusinessProfile(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE) business_name = models.CharField(max_length=100, unique =True) register_date = models.DateTimeField(default=timezone.now) pan_number = models.IntegerField(unique=True) pan_name = models.CharField(max_length=100) address = models.TextField(max_length=200) pincode = models.IntegerField() city = models.CharField(max_length=50) state = models.CharField(max_length=50) service = models.ManyToManyField("Service", blank=True, related_name="services_of_business") image = models.ManyToManyField("Service", related_name="image_of_business") Views.py service = Service.objects.all() #getting all the services for i in service : print(i.name) # working # Now as services is also connected to bussinessprofile i want to print bussiness_id for this service. print(i.bussiness_id) # something like this -
'crop_image.png' but when i change self.profile_picture.name field name floder create in media file
when i am call self.profile_picture.save() method in under 'crop_image.png' but when i change self.profile_picture.name field name floder create in media file Create your models here. class UserProfile(models.Model): """ This table is join with User table. User profile picture information is save in it""" user = models.OneToOneField(User, related_name="profile", on_delete=models.CASCADE) profile_picture = models.ImageField(upload_to="profilepic/",default='profilepic/default-user.png', null=True, blank=True) company_logo = models.ImageField(upload_to="profilepic/",default='profilepic/default-user.png', null=True, blank=True) def save(self, args, *kwargs): import numpy as np from PIL import Image, ImageDraw from io import BytesIO from django.core.files.base import ContentFile # Open the input image as numpy array, convert to RGB img=Image.open(self.profile_picture).convert("RGB") npImage=np.array(img) h,w=img.size print('h -w, ===',h,w) alpha = Image.new('L', img.size,0) draw = ImageDraw.Draw(alpha) draw.pieslice([0,0,h,w],0,360,fill=255) npAlpha=np.array(alpha) # Add alpha layer to RGB npImage=np.dstack((npImage,npAlpha)) image_data = Image.fromarray(npImage) new_image_io = BytesIO() image_data.save(new_image_io, format='PNG') # self.profile_picture = new_image_io.getvalue() # self.profile_picture = '../surveyapp_project/media/profile_pic/a1.png' self.profile_picture.save( # 'crop_image.png', # self.profile_picture.name, content=ContentFile(new_image_io.getvalue()), save=False # os.path.basename(self.url), ) img.close() new_image_io.close() super(UserProfile,self).save(*args, **kwargs) -
Django 3.0: Reverse for 'product' with no arguments not found. 1 pattern(s) tried: ['product/(?P<slug>[^/]+)/$']
I have model named Book in models.py file. And this model has slug field to display details of books Books are being displayed in home.html template and product.html template is to display details of selected book. I really don't know much about slugs, and how they work. Models.py: class Book(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) title = models.CharField('Title', max_length=255) authors = models.ManyToManyField(Author, related_name='books_written') publisher = models.ForeignKey(Publisher, on_delete=models.DO_NOTHING, related_name='books_published') price = models.DecimalField('Price', decimal_places=2, max_digits=10) description = models.TextField('Description') upload_timestamp = models.DateTimeField('Uploading DateTime', auto_now_add=True) categories = models.ManyToManyField(Category, related_name='book_category') cover = models.ImageField(upload_to='covers', null=True,blank=True) copyright_proof = models.ImageField(upload_to=book_copyrights_path, null=True,blank=True) slug = models.SlugField(max_length=100,blank=True) def get_absolute_url(self): return reverse("bookrepo:product", kwargs={ 'slug': self.slug }) class Meta: unique_together = ('title', 'publisher') get_latest_by = '-upload_timestamp' def get_authors(self): return ', '.join([author.__str__() for author in self.authors.all()]) def __str__(self): return "Title: {} | Authors: {} | Price: {}".format( self.title, self.get_authors(), self.price ) urls.py app_name = 'bookrepo' urlpatterns = [ path('product/<slug>/', ItemDetailView.as_view(), name='product'), path('',views.home,name='home'), path('about/',views.about,name='about'), path('faq/',views.faq,name='faq'), path('login/',views.user_login,name='login'), path('shop/',views.shop,name='shop'), path('signup/',views.registration,name='signup'), path('logout/', views.user_logout, name='logout'), ] views.py class ItemDetailView(DetailView): model = Book template_name = "bookrepo/product.html" def home(request): bookz = Book.objects.order_by('title') var = {'books': bookz, 'range': 10} return render(request, 'bookrepo/home.html', context=var) home.html <div class="row"> {% load my_filters %} {% for b in books|slice:":10" %} <div class="col-lg-2 col-md-3 col-sm-4"> <div class="item"> … -
I'm trying to deploy Django on Docker in AWS Lightsail, and the pages are stuck loading with no connection to server
I have been trying to deploy a Django app on Lightsail with Gunicorn, NginX, and Docker. I've looked at multiple tutorials, all without success. I'm not familiar with most of the concepts, and I've pretty much been following blindly. So far, everything seems to work on the server itself, but I can't see the results on a webpage. I have configured it for "production" (not sure if I'm even doing it right), and I've added a record to my domain which redirects to this server. The webpage just buffers continuously, even when I try to set it to port 8000 (for development). I think I've gotten a few instances where I saw a "301 5" permanently moved log show up on the docker-compose logs, but that's about it. Here are the Dockerfile, docker-compose.yml, and nginx conf.d file (which are probably the most important. docker-compose.yml version: '3.7' services: web: build: environment: - ENVIRONMENT=production - SECRET_KEY=NOT IMPORTANT - DEBUG=0 - EMAIL_HOST_USER=EMAIL - EMAIL_HOST_PASSWORD=PASSWORD volumes: - .:/code - static_volume:/code/staticfiles depends_on: - db networks: - nginx_network - db_network db: image: postgres:11 env_file: - config/db/db_env networks: - db_network volumes: - db_volume:/var/lib/postgresql/data nginx: image: nginx:1.17.0 ports: - 80:80 volumes: - ./config/nginx/conf.d:/etc/nginx/conf.d - static_volume:/code/staticfiles depends_on: - web … -
How to generate a csv file using django ?
Say there's a dataframe whose structure like below: import pandas as pd indexs = {0: ['cost', '2020-01', 'testing'], 1: ['cost', '2020-01', '360 Limited'], 2: ['cost', '2020-02', 'Korea Co.,LTD'], 3: ['cost', '2020-02', 'ADS4EACH HK TECH LIMITED']} columns =[['jim'], ['amy'], ['tom'], ['zara'], ['jay'], ['Lee'], ['Uzi'], ['Zome'], ['Qoe'], ['Aoi'], ['Yeezy'], ['Hazy'], ['Wash'], ['pany'], ['zoey'], ['Moe'], ['total']] data = { 0: [0.0, 0.0, 0.0, 0.0, 0.0, 7.85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.85], 1: [0.0, 0.0, 0.0, 0.0, 0.0, 7.85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.85], 2: [0.0, 0.0, 0.0, 0.0, 0.0, 7.85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.85], 3: [0.0, 0.0, 0.0, 0.0, 0.0, 7.85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.85] } index = pd.MultiIndex.from_tuples(indexs.values()) column = pd.MultiIndex.from_tuples(columns) data = data.values() df = pd.DataFrame(data, index=index, columns=column) print(df) jim amy tom zara ... pany zoey Moe total cost 2020-01 testing 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 7.85 360 Limited 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 7.85 2020-02 Korea Co.,LTD 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 7.85 ADS4EACH HK TECH LIMITED 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 … -
DJango switch between databases
I'm a newbie in python and in DJango, so please, if you can, explain in details. I want to use in DJango 3 databases: 1) For DJango auth, admin etc 2) For local website store 3) For the main database So, frist of all, in my old project (PHP) i was using two databases: *Frist Database ( localdatabase ): -> This database was running on my webhost and contains some variables for the main database *Second Database ( the main database): -> Contains a lot of tables and rows inside which the localdatabase dosn't. So i want to make a script that reads the tables in this order: Auth > Localdatabase > Maindatabase Ex: * Localdatabase have this tables: ->autobrands ->autoparts Maindatabase have this tables: ->AllAutoBrands ->AllAutoParts. I been trying to connect multiple databases, but i don't get it, why is reading only 2 of them. The code is reading the auth database and the local database. I have this code: settings.py DATABASES = { 'default': {}, 'auth_db': { 'NAME': 'gws2', 'ENGINE': 'django.db.backends.mysql', 'USER': 'root', 'PASSWORD': '', }, 'primary': { 'NAME': 'gws', 'ENGINE': 'django.db.backends.mysql', 'USER': 'root', 'PASSWORD': '', }, 'secondary':{ 'NAME': 'gwsautqe_ocar890', 'ENGINE': 'django.db.backends.mysql', 'USER': 'root', 'PASSWORD': 'UkVP0qdlle9TKP2z', 'HOST': '46.231.42.12', … -
get parameter value in url Django
I am new to Django, I want to receive a value from the URL and then use it in a filter, but I am having this problem. where value is a field of a model, in the view.py class ModelNumber(generics.ListAPIView): permission_classes = [ IsAuthenticated, ] serializer_class = ModelSerializer def get_queryset(self): queryset = Model.objects.all() value = self.request.query_params.get('value') return Model.objects.filter(value = value) at urls.py path('model_number/(?P<receipt_ballot>\w+)$', views.ModelNumber.as_view()), and Model.py class Model(models.Model): value = models.CharField("Number Value", max_length=12, null=True) -
can anyone make me understand simply
def single(request,slug): pro = products.objects.get(slug=slug) images=productImage.objects.filter(product=pro) template = 'products.html' context = {'pro': pro,'images':images} return render(request, template, context) class products(models.Model): title = models.CharField(max_length=120) desc = models.TextField() price = models.DecimalField(max_digits=10, decimal_places=2, default=29.99) sales_price = models.DecimalField(max_digits=10, decimal_places=2, blank=False, null=False, default=0) slug = models.SlugField(unique=True) timestamp = models.DateTimeField(auto_now_add=True, auto_now=False) update = models.DateTimeField(auto_now_add=False, auto_now=True) active = models.BooleanField(default=True) def __str__(self): return self.title def get_price(self): return self.price def get_absolute_url(self): return reverse("single", kwargs={"slug": self.slug}) class productImage(models.Model): product = models.ForeignKey(products, on_delete=models.CASCADE) image = models.ImageField(upload_to='images/') featured = models.BooleanField(default=False) Thumbnail = models.BooleanField(default=False) active = models.BooleanField(default=True) update = models.DateTimeField(auto_now_add=False, auto_now=True) def __str__(self):`enter code here` return self.product.title what is the task of pro = products.objects.get(slug=slug) and images=productImage.objects.filter(productt=product). what is the difference between using product.productImage_set.all rahter than productImage.objects.filter(product=product) -
Restrict url base Django Api with drf
Hi I want to filter one of my Api models by one field. Building the queryset for the view I need to use the whole model using model.objects.all() and the model serializer. Once I set the filterset which the parameter I want to filter. It filters correctly when I make the consult directly but the problem is when I access to the url for the filter, it by default shows me all the elements of this models and if I search for an element that not exist it also shows al the elements. How can do to make it show me the elements that I'm searching, restrict the url base and if the element doesn't exists in the database just show it empty. Any idea? Thanks -
NoReverseMatch at /each_product/1/
I have an anchor tag in an html template as : <a href="{% url 'each_product' pk=product.id %}"> View</a> In urls.py i have set up the url path as follow for this: path("each_product/<int:pk>/", views.each_product, name="each_product") And in view i have defined the function each_product as: def each_product(request, pk): return render(request, "store/view_each_product.html") I have template named as view_each_product.html. Whenever i try to click view tag , it says "Reverse for 'each_product' with no arguments not found. 1 pattern(s) tried: ['each_product/(?P[0-9]+)/$']" But , when i try to render other templates such as home page , or any other than this ! It doesn't show error. -
how can i use the object_list in django listview in multiple templates?
class PostListView(ListView): model = Post def get_queryset(self): return Post.objects.filter(published_date__lte = timezone.now()).order_by('-published_date') I want to use the object_list in this listview in multiple templates. I have 4 templates each of a certain category in which i want to use this list and filter the list according to the template.So is it possible to use this list in more than 1 template -
django user custom model authentication and authorization
I have created a custom user model and wanted to move it from the app panel to the auth panel in the admin page. To do that I created a proxy user model the following: class User(AbstractUser): pass class ProxyUser(User): pass class Meta: app_label = 'auth' proxy = True and then in admin.py: from django.contrib.auth.admin import UserAdmin from .models import User, ProxyUser admin.site.register(ProxyUser, UserAdmin) The problem is that when I go to group model both user models are shown in the permissions list: Am I missing something? Thanks in advance -
django-select2 store multiple selection
What is the correct way of saving multiple selections selected from Django-select2 Widget? this is my model class Rgn_Details(models.Model): request_no = models.ForeignKey(Request_Flow, on_delete=models.CASCADE, related_name='request_ref') region = models.ForeignKey(Region, on_delete=models.PROTECT, related_name='regn') class Meta: ordering= ['-region'] def __str__(self): return self.region I have a model form like this. class RegionForm(forms.ModelForm): region = forms.ModelMultipleChoiceField(queryset=Region.objects.all().order_by('region_id'), widget=Select2MultipleWidget) class Meta: model = Rgn_Details fields = ['region'] this is my view def create(request): if request.method == 'POST': form1 = RequestForm(request.POST, prefix="form1") form2 = RegionForm(request.POST, prefix="form2") if form1.is_valid() and form2.is_valid(): req = form1.save() region = form2.save(commit=False) region.request_no = req region.save() if I try region.save() its not working though form validation have no errors... I am getting Cannot insert the value NULL into column 'region_id', table 'rgn_details' Am I doing something wrong with save method when you have multiple selections with Django-Select2 widget?? Please suggest solution... -
Django Get All Lesson Durations For A Single Course
Similarly to other video based websites, I want to get the the total duration of all the lessons in a single course. My current code was able to get all lesson durations for all courses which is not desirable, the .all() is too much. I keep hearing annotate is the solution but not sure how to implement it myself. Template: {{object.total_duration}} {{object.total_iso_duration}} Models.py: class Course(models.Model): name = models.CharField(max_length=120) def __str__(self): return self.name @property def lessons(self): return self.lesson_set.all().order_by('position') class Meta: ordering = ('name',) @property def total_duration(self): seconds_dictionary = Lesson.objects.all().aggregate(Sum('duration')) sec = seconds_dictionary['duration__sum'].total_seconds() if sec >= 3600: return '%2d:%02d:%02d' % (int((sec/3600)%3600), int((sec/60)%60), int((sec)%60)) #return hh:mm:ss else: return '%2d:%02d' % (int((sec/60)%60), int((sec)%60)) #return mm:ss @property def total_iso_duration(self): seconds_dictionary = Lesson.objects.all().aggregate(Sum('duration')) return to_iso8601(seconds_dictionary['duration__sum']) class Lesson(models.Model): course = models.ForeignKey(Course, on_delete=models.SET_NULL, null=True) duration = models.DurationField(default=timedelta()) def __str__(self): return self.title @property def iso_duration(self): return to_iso8601(self.duration) @property def formatted_duration(self): #To add leading zeros use %02d sec = self.duration.total_seconds() if sec >= 3600: return '%2d:%02d:%02d' % (int((sec/3600)%3600), int((sec/60)%60), int((sec)%60)) #return hh:mm:ss else: return '%2d:%02d' % (int((sec/60)%60), int((sec)%60)) #return mm:ss Views.py: class CourseDetailView(DetailView): model = Course def get(self, request, *args, **kwargs) : response = super().get(request, *args, **kwargs) Course.objects.filter(pk=self.object.pk).update(views=F('views') … -
Django rank search in Postgres not matching
I have a Tutorial model with name 'building'. Here is search. tutorial_search = Tutorial.objects.annotate( rank=SearchRank(SearchVector('name'), query) ).filter(rank__gte=0.0001).order_by('-rank') This query finds my model query = 'bui:*' But this one doesnt query = 'buildi:*' I cant figure out what is causing it. Is it english accent? Seems like simple search. Thanks! -
How do I uninstall dj-stripe from my project?
I ran pip uninstall dj-stripe and removed it from INSTALLED_APPS and removed the other settings.py entries. Everything is working, but the DB still has a lot of dj-stripe tables. Is there a quick way to remove these? I ran migrate to create them, but they are not in my models.py file. They were made with something from the dj-stripe installation. Thank you. -
Django remove Duplicates after filtering from model objects
I have a model called Course , I have been trying to get a list of them using the filter function. Now each course has different fields. My course model is: class Course(models.Model): course_code = models.CharField(max_length=20) course_university = models.CharField(max_length=100) course_instructor = models.CharField(max_length=100) course_year = models.IntegerField(('year'), validators=[MinValueValidator(1984), MaxValueValidator(max_value_current_year())]) course_likes = models.ManyToManyField(Profile, blank=True, related_name='course_likes') course_dislikes = models.ManyToManyField(Profile, blank=True, related_name='course_dislikes') course_reviews = models.ManyToManyField(Review, blank=True, related_name='course_reviews') I am trying to get the courses for instructor named "Smiths" at Oxford university courses = Course.objects.filter(course_instructor="smiths",course_university="university") How can I remove duplicated with this name for instance show the one with the latest year? Sine, for example, there will be course ABC123 by professor Smith in Oxford university in years 2017,2018,2019,... how can I return only one of those? I have tried distinct() but it doesn't work. Is there any way to do that? Or should I change the whole structure of my database? -
Dealing with three django forms inside a page - Django/Python/CSS
i am working in a web app, there is a section in which i would like to show three forms one of them is obligatory to fill and the other two dont, i would like to show them side by side each but i can t find a way, i've been trying as many ways as possible but i can't achieve it, but i will leave the source code with which i started styling this form. HTML {%extends 'base.html'%} {%load staticfiles%} {%block body_block%} <link rel="stylesheet" href="{%static 'patients/css/patientform.css'%}"> <form method="POST" class="box" > {%csrf_token%} <div> <h3>Informacion del Paciente</h3> {{patientinfo.as_p}} </div> <h3>Antecedentes Familiares</h3> <h5>Primer Caso</h5> <div class="FirstRelative"> {{first_relative.as_p}} </div> <h5>Segundo Caso</h5> <div class="Second Relative"> {{second_relative.as_p}} </div> <input id="submit" type="submit" value="Agregar"> </form> {%endblock%} CSS .box{ width: 300px; padding: 40px; position: absolute; margin-top: 100px; background: #191919; text-align: center; } .box input{ border: 0; background: none; display: block; margin: 20px auto; text-align: center; border: 2px solid #3498db; padding: 14px 10px; width: 200px; outline: none; color: white; border-radius: 24px; transition: 0.50s; } .box dropdown{ border: 0; background: none; display: block; margin: 20px auto; text-align: center; border: 2px solid #3498db; padding: 14px 10px; width: 200px; outline: none; color: white; border-radius: 24px; transition: 0.50s; } .box input:focus{ width: 280px; … -
Forms, Model, and updating with current user
I think this works, but I came across a couple of things before getting it to work that I want to understand better, so the question. It also looks like other people do this a variety of ways looking at other answers on stack overflow. What I am trying to avoid is having the user to have to select his username from the pulldown when creating a new search-profile. The search profile model is: class Search_Profile(models.Model): author_of_profile = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,blank=True) keyword_string = models.CharField(max_length=200) other_stuff = models.CharField(max_length=200) The form I ended up with was: class Search_Profile_Form(ModelForm): class Meta: model = Search_Profile fields = [ 'keyword_string', 'other_stuff'] Where I deliberately left out 'author_of_profile' so that it wouldn't be shown or need to be validated. I tried hiding it, but then the form would not save to the model because a field hadn't been entered. If I was o.k. with a pulldown I guess I could have left it in. I didn't have any issues with the HTML while testing for completeness: <form action="" method="POST"> {% csrf_token %} {{ form.author_of_profile}} {{ form.keyword_string }} {{ form.other_stuff }} <input type="submit" value="Save and Return to Home Page"> </form> And the View is where I ended up treating … -
Django testing - ImportError/ModuleNotFoundError
I'm working through the Django tutorial, currently on part 5 — testing, when I go to run the test through the Django shell I keep getting the following error message: (venv) My-MacBook-Pro:mysite Me$ python manage.py test polls System check identified no issues (0 silenced). E ====================================================================== ERROR: mysite.polls (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: mysite.polls Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/loader.py", line 470, in _find_test_path package = self._get_module_from_name(name) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name __import__(name) ModuleNotFoundError: No module named 'mysite.polls' ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (errors=1) I'm not really sure what's going on here, the test code is copy and pasted directly out off the Django site. My tree: Mysite Venv -__init__.py -db.sqlite3 -manage.py -Mysite --__init__.py --asgi.py --settings.py --urls.py --wsgi.py -Polls --migrations --template --__init__.py --admin.py --apps.py --models.py --tests.py --urls.py --views.py Thanks for the help.