Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Getting Module parse failed: Unexpected token (1:0) error when I try to import css file for a specific component in react
I am building a gym website using React and Django. I am getting this error when I try to import external css file in my Homepage component.Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders > #mainDiv{ | position: absolute; | top: 50%; @ ./src/components/HomePage.js 4:0-28 @ ./src/components/App.js 3:0-34 10:90-98 @ ./src/index.js 1:0-35 webpack 5.68.0 compiled with 1 error and 1 warning in 2286 ms This my component code: import ReactDom from "react-dom"; import Navbar from "./Navbar"; import React, { Component } from "react"; import "./css/Homepage.css"; export default class HomePage extends Component { constructor(props) { super(props); } render() { return ( <body> {/*<Navbar />*/} <div id="mainDiv" className="container"> <div id="Homepgbtn1" className="mainbtns"> <button type="button" class="btn btn-success"> Plans </button> </div> <div id="Homepgbtn2" className="mainbtns "> <button type="button" class="btn btn-success"> Get Started </button> </div> </div> <div id="rbdiv"> <button type="button" class="btn btn-light"> Instagram </button> <button type="button" class="btn btn-light"> Twitter </button> <button type="button" class="btn btn-light"> Youtube </button> </div> </body> ); } } This is my webpack.config.js code: const path = require("path"); const webpack = require("webpack"); module.exports = { entry: "./src/index.js", output: { path: path.resolve(__dirname, "./static/frontend"), filename: "[name].js", }, … -
Checking properties of an object based on separete view (Django|Django-Rest-Framework)
I am using django-rest-framework and React.js. I need a seperate function in the backend to check if CartItem.amount is lower then ProductStock.quantity, if CartItem.product equals ProductStock.id of course (this part does not work). For the same function I need to check if the pricing is the same as in Product model, but suprisingly this part of a function works. What can I do to make sure CartItem.amount will get lowered if it is higher than ProductStock.quantity? Code below: Product is a blueprint for the rest of the models. ProductStock tracks the amount of different sizes of all of products. CartItem is a model used for tracking how many products a user bought. models.py class Product(models.Model): name = models.CharField(max_length=150) price = models.IntegerField() slug = models.SlugField(blank=True, null=True) def __str__(self): return self.name def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Product, self).save() class ProductStock(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE) size = models.CharField(max_length=6) quantity = models.IntegerField(default=0) def __str__(self): return f'{self.quantity} x {self.product.name}: {self.size}' class CartItem(models.Model): user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) product = models.ForeignKey(ProductStock, on_delete=models.CASCADE, blank=True, null=True) amount = models.IntegerField(default=0, blank=True, null=True) size = models.CharField(max_length=10, blank=True, null=True) price = models.IntegerField(blank=True, null=True) def __str__(self): return f'{self.user.email}, {self.product.product.name}, {self.product.size}: {self.amount}' def save(self, *args, **kwargs): if self.amount > self.product.quantity: self.amount = … -
Duplicate instance returned in QuerySet
I'm attempting to create a method that filters questions based on tags which are only found in a particular user's questions. There is an issue with the QuerySet where it returns Queryset([Question13, Question 14, Question13]). Yet when the .distinct() is added it returns the desired result of QuerySet([Question13, Question 14]). Why does the chained .filter() method add the duplicate instance in the QuerySet? class Post(Model): body = TextField() date = DateField(default=date.today) comment = ForeignKey('Comment', on_delete=CASCADE, null=True) profile = ForeignKey( 'authors.Profile', on_delete=SET_NULL, null=True, related_name='%(class)ss', related_query_name="%(class)s" ) score = GenericRelation( 'Vote', related_query_name="%(class)s" ) class Meta: abstract = True class Question(Post): title = CharField(max_length=75) tags = ManyToManyField( 'Tag', related_name="questions", related_query_name="question" ) objects = Manager() postings = QuestionSearchManager() class QuestionSearchManager(Manager): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def by_week(self, profile): today = date.today() weekago = today - timedelta(days=7) queryset = self.get_queryset().filter( date__range=(weekago, today) ).filter(tags__name__in=profile.questions.values_list( "tags__name", flat=True )) return queryset postings.json { "model": "posts.question", "pk": 13, "fields": { "body": "Content of Question 005", "date": "2022-02-12", "comment": null, "profile": 2, "title": "Question__005", "tags": [ 1, 7 ] } }, { "model": "posts.question", "pk": 14, "fields": { "body": "Content of Question 006", "date": "2022-02-12", "comment": null, "profile": 3, "title": "Question__006", "tags": [ 1, 2 ] } } -
object data editting form
I'm making django app which allow me to study. It has multiple tests with multiple question each. Every question has one correct answer. I'm trying to make form which allow me to edit answer If I made mistake in passing correct answer during making question. That's what I have already made: models.py class Answer(models.Model): text = models.CharField(max_length=200) question = models.ForeignKey(Question, on_delete=models.CASCADE, related_name='parent') def __str__(self): return self.text forms.py class AnswerEditForm(ModelForm): class Meta: model = Answer exclude = ('question',) views.py def UpdateAnswerView(request, pk): form = AnswerEditForm() if request.method == 'POST': form = AnswerEditForm(request.POST) if form.is_valid(): obj = form.save(commit=False) obj.question = Question.objects.get(id=pk) obj.save() return redirect('home') context = {'form':form} return render(request, 'exam/update_answer.html', context) urls.py urlpatterns = [ ~some other urls~ path('answer/edit/<int:pk>/', views.UpdateAnswerView, name='update-answer'), ] while I'm trying to edit answer i'm getting Question matching query does not exist. error. Where did i make mistake ? -
AWS Elastic Beanstalk Degraded
I am deploying a Django application on Elastic Beanstalk and getting 'Degraded' Health message. The gateway also shows 502 error. When I check for causes, I get the following messages: 'Following services are not running: web' and 'Impaired services on all instances. How do I resolve this? -
React POST request to Django Rest ManyToMany field
What I want to do is post a ListLink object, which contains Link objects, to the database. The Link objects are added by input field by the user and stored in the state until a request is sent for them to be saved in the database. I am trying to make a post request to DRF, but I am getting the following response: "Invalid data. Expected a dictionary, but got list." I am using axios to make the request: Home.jsx handleSave = event => { event.preventDefault(); return axios({ method: 'post', url: 'http://localhost:8000/api/lists/', headers: { 'Authorization': 'Token ' + localStorage.getItem('token') }, data: { links: this.state.links, name: this.state.listName }}) .then(res => { console.log(res); }); } This is the state I am using to save the lists in: this.state = { listName: 'Link List', listDescription: 'Add description here', listURL: '', currentLink: 'https://www.example.com', links: [] }; Here are my models and serializers: LinkList class LinkList(models.Model): owner = models.ForeignKey( User, related_name='lists', on_delete=models.CASCADE) name = models.CharField(max_length=100) description = models.CharField(max_length=250) public = models.BooleanField(default=False) links = models.ManyToManyField( Link, related_name='linklists') def __str__(self): return "%s - %s" % (self.owner, self.name) def save(self, *args, **kwargs): super().save(*args, **kwargs) Serializer: class LinkListSerializer(serializers.ModelSerializer): url = serializers.HyperlinkedIdentityField(view_name="lists-detail") owner = serializers.ReadOnlyField(source='owner.username') links = LinkSerializer() class Meta: … -
'conda' is not recognized as the name of a cmdlet, function, script file, or operable program
So I am working on Atom IDE and making a venv. I used this line of code in my terminal conda create --name myDjangoEnv Django But this is giving following error: **conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 conda create --name myDjangoEnv Django + CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException** How should I proceed further?? -
Django - How to get attribute from queryset objects list
I have a list of queryset objects like this: [<QuerySet [<Stuff: Phone>]>, <QuerySet [<Stuff: Vodka>]>, <QuerySet [<Stuff: Dictionary>]>] Now i need to get attributes of each object from it. Here is my html template <html lang="en"> <head> <meta charset="UTF-8"> <title>Changes saved</title> </head> <body> <p>Изменены объекты:</p> {% for el in elements %} <p>{{el.name}} new price: {{el.price}}</p> {% endfor %} </body> </html> And in my browser i have just "new price:" 3 times -
Django How to do a correlated EXISTS or NOT EXISTS
How can I perform the following correlated EXISTS and NOT EXISTS in Django? I do not want to use IN and NOT IN. These are not the same as EXISTS and NOT EXISTS. Correlated EXISTS: SELECT * FROM foo WHERE EXISTS ( SELECT 1 FROM bar WHERE foo.baz = bar.baz ) Correlated NOT EXISTS: SELECT * FROM foo WHERE NOT EXISTS ( SELECT 1 FROM bar WHERE foo.baz = bar.baz ) -
Trying to link a form to a custom data table I set up in pgadmin
So I have a custom data table set up and I would like to set that table as a destination for info that goes through my form. How would I go about doing that? I currently have django and the database linked, but currently I have it set to use the default user_auth table, that django automatically sets up. Here is my views.py file for more context: def register(request): if request.method == 'POST': first_name = request.POST['first_name'] last_name = request.POST['last_name'] username = request.POST['username'] email = request.POST['email'] newuser= User.objects.create_user(first_name=first_name,last_name=last_name, email=email, username=username) newuser.save() print(request.POST) return redirect('/home') else: return render(request,'userinfo.html') -
How to get data from model fields in django?
I made a patient register form. I added two patient to database. And i wanna save each patient informations to text file. And i wanna make all txt file is uniqe name. So i am using this code for save txt file; file_name must be each patient name, and i am having problem in this line... I didnt filter or pull data from model def deneme(request): dir_path = Path('/Users/emr/Desktop/ngsaglik/homeo/patient/templates/kayitlar') file_name = str(Post.objects.get(???)) # i wanna pull each patient name as a txt file name f = open (dir_path.joinpath(file_name),'w') testfile = File(f) kayitlar = Post.objects.all() lines = [] for kayit in kayitlar: lines.append(f'{kayit.soru1}\n{kayit.soru2}\n') testfile.write(str(lines)) testfile.close f.close return HttpResponse() my models.py from django.db import models from django.contrib.auth.models import User from django.urls import reverse #from datetime import datetime, date class Post(models.Model): name = models.CharField(verbose_name='Ad Soyad',max_length=10000, default="") surname = models.CharField(verbose_name='Tarih', max_length=10000, default="") soru3 = models.CharField(verbose_name='Doğum Tarihi', max_length=10000, default="") soru4 = models.CharField(verbose_name='Doğum Yeri', max_length=10000, default="") soru5 = models.CharField(verbose_name='Medeni Hali', max_length=10000, default="") -
In Django, how to create a model that stores proposed changes to another model?
I'm using Python 3.9 and Django 3.2. I have the following model class Coop(models.Model): objects = CoopManager() name = models.CharField(max_length=250, null=False) types = models.ManyToManyField(CoopType, blank=False) addresses = models.ManyToManyField(Address, through='CoopAddressTags') enabled = models.BooleanField(default=True, null=False) phone = models.ForeignKey(ContactMethod, on_delete=models.CASCADE, null=True, related_name='contact_phone') email = models.ForeignKey(ContactMethod, on_delete=models.CASCADE, null=True, related_name='contact_email') web_site = models.TextField() description = models.TextField(null=True) approved = models.BooleanField(default=False, null=True) We would like to set up a situation where someone could propose a change to a row in the db that would be reviewed before being saved, so I've created this struture class CoopChange(Coop): """ """ created_at = models.DateTimeField(null=False, default=datetime.now) The problem is that when I create a migration, the table that is created simply points back to the original model, instead of storing all the fields Table "public.directory_coopchange" Column | Type | Modifiers -------------+--------------------------+----------- coop_ptr_id | integer | not null created_at | timestamp with time zone | not null This is non-ideal because the original table would contain both finalized entries and those suggested for changes. Is there a way to create an entity that stores proposed changes that mirrors the structure of the original entity? -
How to include ManyToMany Fields in DjangoRestFramework?
class EntityServiceSerializer(serializers.ModelSerializer): class Meta: model = Service fields = '__all__' class EntityCreateSerializer(serializers.ModelSerializer): entity_service = EntityServiceSerializerThrough(read_only=True, source='serviceschedule_set', many=True) class Meta: model = Entity fields = '__all__' Model looks like this class Entity(models.Model): entity_service = models.ManyToManyField(Service, through='ServiceSchedule') class ServiceSchedule(models.Model): service = models.ForeignKey(Service, on_delete=models.CASCADE) entity = models.ForeignKey(Entity, on_delete=models.CASCADE) class Service(models.Model): service_name = models.CharField(max_length=256, null=True) slug = models.SlugField(max_length=128, unique=True, null=False, editable=False) created_at = models.DateTimeField(editable=False, default=timezone.now) updated_at = models.DateTimeField(default=timezone.now) animal = models.ForeignKey(Animal, on_delete=models.CASCADE, default=None) I have these serializers (there are more fields in entity model, but they're irrelevant since the only problem i have is with the Many2Many) The thing is, when i put in body "entity_service": [1,2] in the response i still get = []. Even though i have in my database Services with pk 1,2,3,4. Do you know how can i make it work? -
django auto generate and create Models.py file and other files
In django using python manage.py startapp appname it generate folder with appname etc.... or when using admin-panel startproject projectname it generate folder with projectname and all its parameters classes how this work ??? -
Celery only updates in resulting backend only when we call a task twice(Windows)
I am exploring celery with django, I have observed a very strange thing and I was unable to find any solution of it as of now. I am using the following simple task. @shared_task def add(x, y): return x + y I'm calling the above celery task from one of my class based view, which is following. class CallMe(View): def get(self, request): rr = add.delay(random.randint(1, 999), random.randint(1, 999)) return HttpResponse(f'hellllo world {rr}') it is mapped to the the following url path('', CallMe.as_view()) whenever I'm accessing 127.0.0.1:8000, I have to hit twice to see the any update in the celery command log. I'm using following command for celery celery -A my_proj worker -l DEBUG --pool=solo I am using RabbitMQ as a broker. I have to hit 127.0.0.1:8000 twice to see any update(only the second hit) in celery command log. BUT the celery flower is able to show two tasks(even celery log is showing only one) and it is showing success for both the task with the correct result. ALSO django_celery_results_taskresult is only INSERTING that task which is logged by the celery command log. The other task not even has any record in the django_celery_results_taskresult table, even though it's showing in the … -
Mocking psycopg2 Exceptions in Django Unit Tests
I'm struggling to write unit tests in Django for specific psycopg2 errors that ultimately raise django.db.IntegrityError as the end result. Typically I'd use mock.patch and have the side_effect set to the exception I would like raised. Ex. with mock.patch( "path_to.method_that_throws_integrity_error", side_effect=IntegrityError(), ) as mock_method: self.assertEqual(value, value_two) This works great if I cared about the next steps after every IntegrityError. However, in the case of this test. I only care about the logic in my code that follows psycopg2.errors.UniqueViolation which eventually bubbles up and throws an IntegrityError which I check the error.__cause__.diag.constraint_name and handle logic based on the result. If the UniqueViolation is thrown, I have custom logic that currently performs an action. If an IntegrityError is thrown that is not a UniqueViolation I want the error to raise so I'm alerted that there is an issue. I've tried many things, and cannot mock raise the UniqueViolation so that it sets the same psycopg2.extensions.Diagnostics object as the one that I get from actually throwing the error by violating the unique constraint in my Db. I also cannot set the __cause__ on the IntegrityError as the UniqueViolation. What I would like is something like this - def side_effect(): try: raise UniqueViolation({"constraint_name": "my_unique_constraint"}) … -
Django HTML template tag for date
I get date data from an API on the internet, but it comes as a string. How do I convert this to the following format using django HTML template tag? Current date data format: 2022-02-13 00:00:00 UTC My wish format: 13 February 2022 00:00 My wish another format: 13 February 2022 -
Optimising ModelChoiceField - too much queries on formset.is_valid (post)
I have a query performance problem with formset include form for model with FK. I wrote code according to strategy 2 shown in DjangoCon 2020 | Choose, and choose quickly: Optimising ModelChoiceField - Carlton Gibson. It works for get, but not for post. In POST, even if nothing has changed, during formset.is_valid (or formset.save(commit = False)), I have queries for each FK in each form. In total, there are hundreds of queries about the same (in the example below for SampleModel). How to use initialized choices for formset.save(commit=False)? I have: class MyClass(models.Model): name = models.CharField(max_length=100) sample_model = models.ForeignKey('SampleModel', on_delete=models.PROTECT) ... class MyForm(forms.ModelForm): def __init__(self, *args, **kwargs): sample_model_choices = kwargs.pop("sample_model_choices", None) ... super().__init__(*args, **kwargs) if sample_model_choices: self.fields["sample_model"].choices = sample_model_choices ... class Meta: model = MyClass fields = ['name', 'sample_model', ...] class MyFormSet(BaseModelFormSet): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.sample_model_choices = [*forms.ModelChoiceField(SampleModel.objects.all()).choices] ... def get_form_kwargs(self, index): kwargs = super().get_form_kwargs(index) kwargs['sample_model_choices'] = self.sample_model_choices ... return kwargs class Meta: model = MyClass And in view for post: if request.method == "POST": myformset = modelformset_factory(MyClass, formset=MyFormSet, form=MyForm, extra=0, ...) qs = MyClass.objects.filter(... # i also tried prefetching data into qs but it doesn't help formset = myformset(request.POST or None, queryset=qs) if formset.is_valid(): # <- too … -
Django model data not appearing
My model data for my website wont appear on new page when using slug and I am unsure as to why this is happening as I managed to get it to work with the previous page of the website but when I try to call it on my html page nothing will load now and I use the slug in the view to access the page. Models.py class Parasite(models.Model): name = models.CharField(max_length=128, unique=True) slug = models.SlugField(max_length=100, unique=True) description = models.TextField(max_length=100000) image = models.ImageField(upload_to='parasite_images', default='default/default.jpg', blank=True) def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Parasite, self).save(*args, **kwargs) def __str__(self): return self.name views.py def view_parasite(request,parasite_name_slug): context_dict = {} try: parasite = Parasite.objects.get(slug=parasite_name_slug) context_dict['parasites'] = parasite except Parasite.DoesNotExist: context_dict['parasites'] = None return render(request, 'parasites_app/viewpara.html', context = context_dict) viewpara.html {% extends 'parasites_app/base.html' %} {% load static %} {% block content_block %} {% for p in parasite %} <h3>{{p.name}}</h3> {% endfor %} {% endblock %} urls.py urlpatterns = [ path('login/', views.user_login, name='login'), path('logout/', views.user_logout, name='logout'), path('admin/', admin.site.urls), path('', views.public, name='public'), path('public/', views.public, name='public'), path('private/', views.logged_in_content, name='private'), path('public/<slug:parasite_name_slug>/',views.view_parasite, name='view_parasite'), path('<slug:post_name_slug>/', views.show_post, name='show_post'), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) -
cannot connect redis sentinels on django
I'm trying to connect sentinels, but every time we got the same error Exception: Could not connect to any sentinel CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { "hosts": [ { "sentinels": [("redis-cluster.local.svc.cluster.local", 26379, )] , "master_name": "mymaster"} ]} }, } I can't figure out where to put the password key and db key. And do I need to put in the url the sentinels url's ? or service is enough? note: when trying to connect redis/sentinels without channels we do not have any issue at all -
Django show me a none type and a __str__ return
https://dpaste.com/665WCWNNL [My error page][1] [1]:Hi everyone, i have got this error page and i d'ont know why, could you give me a hand please? -
Passing a information between views in DJANGO
so i have this two views, one used to display information and one that returns a file responde. I am trying to download a pdf file using the information on the first view: @login_required() def detail(request, location_name): if request.method == "POST": return search_in_employees(request) current = CurrentInfo() pdf_data = current.detail_employees_by_location(location_name) # this gives me the list of people context = { 'present': current.detail_employees_by_location(location_name), 'location': location_name, } print('Data: -------------->', pdf_data) return render(request, 'user_area/detail.html', context) and my second view just formats it as a pdf: @login_required() def download_pdf(request): buf = io.BytesIO() canv = canvas.Canvas(buf, pagesize=letter, bottomup=0) textob = canv.beginText() textob.setTextOrigin(inch, inch) textob.setFont("Helvetica", 14) lines = [ "Line 1 ", "Line 2 ", "Line 3 ", "Line 4 ", ] for line in lines: textob.textLine(line) canv.drawText(textob) canv.showPage() canv.save() buf.seek(0) return FileResponse(buf, as_attachment=True, filename='employees.pdf') Right now the PDF file only contains dummy data, but how can i pass pdf_data from the first view to the second? -
TypeError: Field 'id' expected a number but got <django.db.models.fields.related_descriptors
I have a simple view for showing all the current users that are conditionally filtered based on the user type that is requesting the data. serializers.py class MyAccountSerializer(serializers.ModelSerializer): image = serializers.ImageField() class Meta: model = User fields = ['id', 'sex', 'type', 'phone', 'image', 'email', 'student_id', 'firstname', 'middlename', 'lastname', 'image', 'joined_date', 'is_active', 'is_superuser', 'is_staff', 'last_login'] views.py class TeacherList(generics.ListAPIView): permission_classes = [IsAuthenticated, ] serializer_class = ListUsersSerializer queryset = User.objects.filter(type=User.TYPES.TEACHER) A simple filter like this works without any errors but since I need to filter the response based on the requesting user this is what I want to use class TeacherList(generics.ListAPIView): permission_classes = [IsAuthenticated, ] serializer_class = ListUsersSerializer # queryset = User.objects.filter(type=User.TYPES.TEACHER) def get_queryset(self): request = self.request.user if request.type == User.TYPES.OWNER: queryset = User.objects.filter( type=User.TYPES.TEACHER, workes=request.owns) elif request.type in [User.TYPES.STAFF, User.TYPES.DIRECTOR, User.TYPES.VICE_DIR]: queryset = User.objects.filter( type=User.TYPES.TEACHER, workes=request.workes) return queryset however this shows me an error that goes like this: Field 'id' expected a number but got <django.db.models.fields.related_descriptors.create_forward_many_to_many_manager.<locals>.ManyRelatedManager object at 0x0000019D64AE7D60>. I suspect it has something to do with a many-to-many field of which I have one named owns which is what I'm using to filter in 1 of the conditions but don't know why it throws error -
Edit json object in form view, the JSON object must be str, bytes or bytearray, not NoneType
My model has Json Object. class BotContents(BaseModel): class Meta: db_table = 't_bot_contents' name = m.CharField(max_length=200) action = m.JSONField(blank=True, null=True) And in View. class BotContentsUpdateView(LoginRequiredMixin, UpdateView): model = BotContents template_name = 'bot_contents/bot_contents_edit.html' in bot_contents_edit.html {{form.action}} There comes error like this. the JSON object must be str, bytes or bytearray, not NoneType I thought it means the JSON object is already changed into dict. However how can I make the edit form (maybe textare?) in html? -
how can i convert django app to desktop app
I have a Django app up and running on DigitalOcean with Nginx and PostgreSQL. But some clients want an offline version of the app so that their data remains on their systems and they don't have to connect to the internet. One solution is to write the whole app from scratch but that would take time and cost. I was thinking of a solution where I can convert the Django app into a desktop app with minimal changes i.e. replace CDNs with files and remove functionality that requires internet. But I don't know how can I do this. I was thinking of electron, i,e, elctron will spawn a child process which will start django's server and then the electron will load 127.0.0.1:8000 in a webview. But how can I package this app into an executable because it would need python installed and configured on the user's system. Or does python itself has any library that can convert the Django app into a desktop app? Below is the file structure of my Django project project_folder/ app_1/ app_2/ app_3/ configurations/ templates/ __init__.py asgi.py settings.py urls.py wsgi.py media/ staticfiles/ manage.py Any help would be appreciated.