Skip to content
Advertisement

Tag: django

Why am I getting a Django NoReverseMatch error?

I am trying to send an activation email to users when signing up, but I keep getting a NoReverseMatch error when trying to render the URL in the template. The error I get is: urls.py template.txt Answer The pattern for the token variable is: THis thus means that there are two sequence of [0-9A-Za-z] characters: one with one to thirteen

Dependencies of Django Project

I created a setup.py and setup.cfg like explained in the Django docs. Now I am unsure how to add dependencies to my project. If someone installs my code, other tools like Pillow should automatically get installed. I read that install_requires is the right way (not requirements.txt), but how to specify this? The file setup.py looks pretty generic, and all content

Django. DEBUG in production

I’m writing my first real project in Django and I have a problem with properly setting DEBUG in development and production. In my settings.py project file I have: So I expect that it should work as follows. By default DEBUG is set to True (I use this in my development). But on my production server I have an environmental variable

Django admin panel has no styling

When I started my project and went to the admin panel the admin panel had no styling There is no styling as usual. What should I do to fix it. Thank you Answer run python manage.py collectstatic to collect the admin static files ensure your webserver can serve static files from your STATIC_DIR

django Count show different value after search

I simulate Instagram app. I have Followers, Actions models. Each action is done on a “follower”. Many actions can point to one follower. Admin panel: I then override the get_queryset for followers: I get really strange results in the admin panel: no search in panel USERNAME : lior___shahar BEEN FOLLOWED COUNT:5 FOLLOW BACK COUNT:5 This is the True VALUE in

Django Rest Framework: Access to passed arguments from views in serializers

Before asking this question, I have seen the following links but they don’t help me at all: pass extra arguments to serializer pass request context to serializer from viewset pass context from one serializer to another I have an author model that has foreign key to default django user model: apps/author/models.py Post model has a foreign key to Author. apps/posts/models.py

I am having trouble changing the url.py within Django

Hello I am needing assistance. I am currently doing within url.py for Django: urlpatterns = [ path(‘cookies/’, admin.site.urls), ] This is being done from urls.py in atom and when I look at the terminal it is not able to GET the new url. When I have 127.0.0.1/cookies/ I am still directed to a not found page. Anyone please help I

Advertisement