Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django python contact email form error post not allowed 405
I dont know why i get this error in the bash: Method Not Allowed (POST): /curriculum/ [14/Sep/2017 20:47:24] "POST /curriculum/ HTTP/1.1" 405 0 views.py: from django.views.generic import TemplateView from Profile.forms import ContactForm from django.core.mail import send_mail, BadHeaderError, EmailMessage from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, redirect from django.template import Context from django.template.loader import get_template Create your views here. class HomePageView(TemplateView): def get(self, request, **kwargs): return render(request, 'index.html', context=None) class ProjectsPageView(TemplateView): template_name = 'projects.html' class TutorialsPageView(TemplateView): template_name = 'tutorials.html' class ArticlesPageView(TemplateView): template_name = 'articles.html' class LanguagesPageView(TemplateView): template_name = 'languages.html' class VideosPageView(TemplateView): template_name = 'videos.html' class CurriculumPageView(TemplateView): template_name = 'curriculum.html' def post(self, request, **kwargs): form_class = ContactForm # new logic! if request.method == 'POST': form = form_class(data=request.POST) if form.is_valid(): contact_name = request.POST.get( 'contact' , '') contact_email = request.POST.get( 'email' , '') form_content = request.POST.get('message', '') # Email the profile with the # contact information template = get_template('templates/contact_template.txt') context = Context({ 'contact_name': contact_name, 'contact_email': contact_email, 'form_content': form_content, }) content = template.render(context) email = EmailMessage( "New contact form submission", content, "Your website" +'', ['juanmacedoal@gmail.com'], headers = {'Reply-To': contact_email } ) email.send() return redirect('curriculum') return render(request, 'PageJMMA/Profile/templates/index.html', { 'form': form_class, }) url.py: from django.conf.urls import url from Profile import views urlpatterns = [ … -
djangoCMS with Aldryn NewsBlog missing "New news/blog article"
I am currently setting up a django CMS website on my server. I want to add a blog and tried to follow this Divio Blog Guide, which works with the aldryn-newsblog plugin. As I am not using the divio servers I had to install aldryn-newsblog. I followed the Aldryn Newsblog Setup: pip install aldryn-newsblog and added the following to my settings 'aldryn_apphooks_config', 'aldryn_categories', 'aldryn_common', 'aldryn_newsblog', 'aldryn_people', 'aldryn_reversion', 'aldryn_translation_tools', 'parler', 'sortedm2m', 'taggit', I followed these last to steps from the Aldryn setup 1. Create a django CMS page in the normal way. 2. In Advanced settings... > Application settings, select NewsBlog. When I select NewsBlog and try to "Create" a new News/Blog article I end up with this menu where i miss the corresponding button "New news/blog article". Did i forget or oversee something here? -
Reverse for 'user_posts' with keyword arguments '{'username': ''}' not found. 1 pattern(s) tried: ['posts/by/(?P<username>[-\\w]+)/$']?
i keep getting this error in django "NoReverseMatch", an di cant solve the problem. please help!! my models.py from django.conf import settings from django.core.urlresolvers import reverse from django.db import models import misaka from groups.models import Group from django.contrib.auth import get_user_model User = get_user_model() class Post(models.Model): user = models.ForeignKey(User, related_name="posts") created_at = models.DateTimeField(auto_now=True) message = models.TextField() message_html = models.TextField(editable=False) group = models.ForeignKey(Group, related_name="posts",null=True, blank=True) def __str__(self): return self.message def save(self, *args, **kwargs): self.message_html = misaka.html(self.message) super().save(*args, **kwargs) def get_absolute_url(self): return reverse( "posts:single", kwargs={ "username": self.user.username, "pk": self.pk } ) class Meta: ordering = ["-created_at"] unique_together = ["user", "message"] and my views.py is this: from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.core.urlresolvers import reverse_lazy from django.http import Http404 from django.views import generic from braces.views import SelectRelatedMixin from . import forms from . import models from django.contrib.auth import get_user_model User = get_user_model() class PostList(SelectRelatedMixin, generic.ListView): model = models.Post select_related = ("user", "group") class UserPosts(generic.ListView): model = models.Post template_name = "posts/user_post_list.html" def get_queryset(self): try: self.post_user = User.objects.prefetch_related("posts").get( username__iexact=self.kwargs.get("username") ) except User.DoesNotExist: raise Http404 else: return self.post_user.posts.all() def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["post_user"] = self.post_user return context class PostDetail(SelectRelatedMixin, generic.DetailView): model = models.Post select_related = ("user", "group") def get_queryset(self): queryset = super().get_queryset() … -
Django update view won't save
I have this update view but it will not save upon form submission. 5 minutes ago everything was working fine and then I added the edit feature for user posts and all of a sudden nothing will save when trying to edit things. users app views: class UserEditProfileView(LoginRequiredMixin,UpdateView): login_url = '/login/' model = UserProfile fields = [ 'first_name', 'profile_pic', 'location', 'title', 'user_type', 'website', 'about', 'twitter', 'dribbble', 'github' ] template_name_suffix = '_edit_form' def get_success_url(self): userid = self.kwargs['pk'] return reverse_lazy('users:user_profile',kwargs={'pk': userid}) users app models: class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=50,default='User') join_date = models.DateTimeField(default=timezone.now) profile_pic = models.ImageField(upload_to='profile_pics',null=True,blank=True) location = models.CharField(max_length=150) title = models.CharField(max_length=250) user_type = models.IntegerField(choices=USER_TYPE_CHOICES,default=1) website = models.URLField(max_length=100,blank=True) about = models.TextField(max_length=500,default='about') twitter = models.CharField(max_length=50,blank=True) dribbble = models.CharField(max_length=50,blank=True) github = models.CharField(max_length=50,blank=True) @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: UserProfile.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.userprofile.save() def __str__(self): return self.user.username user profile_edit_form.html: {% extends "users/base.html" %} {% block content %} <div class="form-title"> <h2 class="form-title-text">Edit Profile</h2> </div> <div class="user-forms-base"> <form method="POST"> {% csrf_token %} {{ form.as_p }} <input type="submit" value="Save" /> </form> </div> {% endblock %} I am having the same issue with updating posts on the home page, however I am assuming the issues are the same and … -
Mongoengine with django: DuplicateKeyError
I'm using mongoengine (http://mongoengine.org/) in a Django project. I don't know if this is such a good idea, but I thought I'd just try to get it work since there seems to be no up to date MongoDB implementation for Django. When running my server and trying to access localhost:8000/workoutcal/ I get this error: Traceback (most recent call last): File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/workout/workoutcal/views.py", line 18, in calendar workouts_in_month = Workout.objects(Q(date__gte=datetime(year=today_year, month=today_month, day=today_day)) & Q(date__lt=datetime(year=today_year, month=today_month+1, day=1))) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/mongoengine/queryset/manager.py", line 37, in __get__ queryset = queryset_class(owner, owner._get_collection()) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/mongoengine/document.py", line 204, in _get_collection cls.ensure_indexes() File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/mongoengine/document.py", line 834, in ensure_indexes collection.create_index(fields, background=background, **opts) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/collection.py", line 1571, in create_index self.__create_index(keys, kwargs) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/collection.py", line 1472, in __create_index parse_write_concern_error=True) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/collection.py", line 232, in _command collation=collation) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/pool.py", line 477, in command collation=collation) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/network.py", line 116, in command parse_write_concern_error=parse_write_concern_error) File "/Users/sahandzarrinkoub/Documents/Programming/Web/Django/workout/lib/python3.6/site-packages/pymongo/helpers.py", line 203, in _check_command_response raise DuplicateKeyError(errmsg, code, response) pymongo.errors.DuplicateKeyError: E11000 duplicate key error collection: db.workout index: id_1 dup key: { : null } I have trouble understanding this error. Does it mean … -
django-screamshot "Html Render IMG TAG Image is not coming while generating PDF"
Using django-screamshot plug to generating PDF. Below is the URL of plugin https://github.com/makinacorpus/django-screamshot I am rending an HTML with Django-ScreamShot (CasperJs Option) to generate PDF. Imaging are not coming after generating PDF. It is showing ? at the center. Is it problem to rendering is fast so we need to wait ? -
Django Aggregate Query Values for Multiple Objects
In my project I have a model called Organization that can have multiple Campaign's. Each campaign can then have multiple donor's. Hopefully to clarify here is what my models look like: class Campaign(models.Model): name = models.CharField() organization = models.ForeignKey('org.Organization') class Donor(models.Model): lead = models.ForeignKey('org.Lead') amount = models.DecimalField() campaign = models.ForeignKey(Campaign) What I would like to do is show a campaign, then display the sum of all amounts made by donors (donor.amount). So for example, if "Campaign1" has three donors, each of whom donated $5, in my template it will show: "Campaign1: $15." Any idea on how I can accomplish this? I was thinking about using a backward relationship in my template but you can not create Aggregates this way. Thanks for any help. -
Django RestFramework method filter with multiple lookups
I have two models defined like this: class House(models.Model): # all the fields here def capacity(self): capacity = 0 for room in self.rooms.all(): capacity += room.capacity return capacity class Room(models.Model): house = models.ForeignKey( House, on_delete=models.CASCADE, related_name='rooms' ) capacity = models.PositiveIntegerField( default=1 ) What i need is to filter the houses by its capacity using all number lookups(lt, lte, gt, gte, range, exact) in restframework, i did this: import rest_framework_filters as filters def capacity_filter(qs, name, value): # filter implementation here class HouseFilter(filters.FilterSet): capacity = filters.NumberFilter( method=capacity_filter ) class Meta: fields = ('capacity',) class HouseViewSet(viewsets.ModelViewSet): filter_class = HouseFilter # other attrs here And it works but only for exact value, i cant filter using __gt, or __lt, i try with lookup_expr parametter in NumberFilter but not work. -
Let me know how to import columns that match other tables in django
this is my code def get_question_keyword(question_id): connection = connect(host=MYSQL_CONNECTION_INFO['HOST'], port=MYSQL_CONNECTION_INFO['PORT'], user=MYSQL_CONNECTION_INFO['USER'], password=MYSQL_CONNECTION_INFO['PASSWORD'], db=MYSQL_CONNECTION_INFO['DB'], charset=MYSQL_CONNECTION_INFO['CHARSET'], cursorclass=cursors.DictCursor) keyword_list = [] try: with connection.cursor() as cursor: query = ("SELECT keyword FROM question WHERE id=" + str(question_id)) cursor.execute(query) keyword = "" for item in cursor: keyword = item["keyword"] keyword_list = keyword.strip().split(",") finally: connection.close() return keyword_list That's one of those codes. query = ("SELECT keyword FROM question WHERE id=" + str(question_id)) -
django query aggregate function is slow?
I am working with Django to see how to handle large databases. I use a database with fields name and age and height. The database has about 500000 entries. The aggregate function in querying table takes about 10s. Is it usual or am I missing something. age = [i for i in Data.objects.values_list('age').distinct()] ht = [] for each in age: aggr = Data.objects.filter(age=each).aggregate(ag_ht=Avg('height') ht.append(aggr) -
Installing misago
I want to build a forum using misago but I cannot install it. Everytime I use pip install misago i get the following error. Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\HP\AppData\Local\Temp\pip-build-_sg0mt_y\misago\setup.py", line 11, in <module> README = open(os.path.join(SETUP_DIR, 'README.rst')).read() File "c:\users\hp\appdata\local\programs\python\python35-32\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 716: character maps to <undefined> Command "python setup.py egg_info" failed with error code 1 in C:\Users\HP\AppData\Local\Temp\pip-build-_sg0mt_y\misago\ I searched if they are compatible with python 3.X and they are. I've also installed ez-setup and setuptools to help but to no avail. I'm using windows 10, python 3.5. -
froala django doesn't work in template
i'm trying to use froala WYSIWYG in my django project i installed and prepared everything as it is mention in the docs but the content field still displayed as text field so any solution ?? my code forms.py from django import forms from .models import BlogPost from froala_editor.widgets import FroalaEditor class PostForm(forms.ModelForm): content = forms.CharField(widget=FroalaEditor()) class Meta: model = BlogPost fields = ('title','body','thumb','tags') template <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="/static/bootstrap-3.3.7-dist/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="/static/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="/static/font-awesome/css/font-awesome.css"> <link href="{{STATIC_URL}}froala_editor/css/font-awesome.min.css" type="text/css" media="all" rel="stylesheet" /> <link href="{{STATIC_URL}}froala_editor/css/froala_editor.min.css" type="text/css" media="all" rel="stylesheet" /> <script type="text/javascript" src="{{STATIC_URL}}froala_editor/js/froala_editor.min.js"></script </head> <body> </body> </html> note that editor = PostForm(request.POST, request.FILES ) in my views and i'm having trouble with jquery cookies error: Uncaught ReferenceError: getCookie is not defined at HTMLDocument.<anonymous> ((index):72) at i (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at Function.ready (jquery.min.js:2) at HTMLDocument.K (jquery.min.js:2) -
Django formset in javascript
I have a django formset with unknown number of forms. Each form has product name, price, quantity, and total. I want to calculate the simple product such as quantity x price = total. I loop forms in the formset and get the value of the price from each form. <input type="number" name="price" value="{{forms.price}}"> I can pass the number of quantity to javascript and do the calculation. var $price = $("input[name='price']"), $quantity = $("input[name='percentage']").on("input", calculatePrice), function calculatePrice() { var quantity = $(this).val(); var price = $price.val(); var calcPrice = price; $total.val( calcPrice ); } but how do I do it with unknown number of forms? Each form will have the same name. I assume i need to assingn different name to each form and then assign the same name to javascript but I have no idea how to do that. -
HttpResponseRedirect not working as expected
In my views.py I have: return HttpResponseRedirect('/account/forecast/') The problem I'm running into is that the response url is being appended. e.g. from: mysite.com/account the redirect goes to: mysite.com/account/account/forecast instead of: mysite.com/account/forecast. I'm using Django 1.11, gunicorn and nginx with SSL. -
Django can't lookup datetime field. int() argument must be a string, a bytes-like object or a number, not datetime.datetime
I'm trying to group objects 'Event' by their 'due' field, and finally return a dict of day names with a list of events on that day. {'Monday': [SomeEvent, SomeOther]} - that's the idea. However while looking up event's due__day I get: int() argument must be a string, a bytes-like object or a number, not datetime.datetime. Here's manager's code: # models.py class EventManager(models.Manager): def get_week(self, group_object): if datetime.datetime.now().time() > datetime.time(16, 0, 0): day = datetime.date.today() + datetime.timedelta(1) else: day = datetime.date.today() friday = day + datetime.timedelta((4 - day.weekday()) % 7) events = {} while day != friday + datetime.timedelta(1): events[str(day.strftime("%A"))] = self.get_queryset().filter(group=group_object, due__day=day) # ^^^ That's where the error happens, from what I understood it tries to convert this datetime to int() to be displayed by template day += datetime.timedelta(1) return events Here is the model: # models.py class Event(models.Model): title = models.CharField(max_length=30) slug = models.SlugField(blank=True) description = models.TextField() subject = models.CharField(max_length=20, choices=SUBJECTS) event_type = models.CharField(max_length=8, choices=EVENT_TYPES) due = models.DateTimeField() author = models.ForeignKey(User, blank=True) group = models.ForeignKey(Group, related_name='events') objects = EventManager() I created a template filter to call this method: @register.filter def get_week(group_object): return Event.objects.get_week(group_object=group_object) And I called it in event_list.html (Using an index because it's a list view, also this … -
How to update database using the form value & calculation in Django?
Currently using sqlite that comes with Django. In a CreateView of creating a project I want to search for tools that are in the tools database. Upon selecting one, it will display information in a row within the CreateView. Upon submitting my project I want to -1 from the quantity of that tool in the tools database. In reference to my title I am just looking to subtract the value of in the quantity input from the tools database and how to do that. -
django - POST after Get won't work in the view
I'm trying to write a view which will do two things: first it will show an empty form, if the request.method is Get. then it should submit the form into the database, if the method is POST. the problem is, that when the form is submitted and it should POST stuff, the same view won't run, instead it runs the root url of the project. here is the log: (add is the url I've set for this view) [14/Sep/2017 18:27:07] "GET /add HTTP/1.1" 200 1815 [14/Sep/2017 18:27:12] "POST / HTTP/1.1" 200 1683 (add is the url I've set for this view) and the code looks like this: def add_link(request): if request.method == 'POST': form = Form(request.POST) ... else: form = Form() return render(request, 'mytemp.html', {'form': form }) -
Django serializer with the same field, use different request and response
I'm using CreateAPIView with serializer below: class CategorySerializer(ModelSerializer): class Meta: model = Category fields = [ 'id', 'name', 'hexColor' ] class TransactionCreateSerializer(ModelSerializer): categoryz = CategorySerializer(read_only=True, source='category' ) class Meta: model = Transaction fields = [ 'id', 'category', 'categoryz' ] extra_kwargs = {"user": {"read_only": True}} As you can see I have a category and categoryz, I want this category field use id as a request (write_only) and use the CategorySerializer as the response. How can I do that? This code will work but I want to get a 'category' response rather than categoryz This is the response I get now: { "id": 12, "amount": 28.0, "date": "2017-09-14", "attachment": "", "category": 1, "categoryz": { "id": 1, "name": "White", "hexColor": "#FFFFFF" } } I want to change it to : { "id": 12, "amount": 28.0, "date": "2017-09-14", "attachment": "", "category": { "id": 1, "name": "White", "hexColor": "#FFFFFF" } } -
Django: Query to find total based on type
I have employees and types of leaves applied by each person like Casual,sick,vacation,maternity,paternity...I want a table for each employee containing number of leaves approved in different leave_types excluding sat,sun in the current year 2017 Eg: person 1 applied sick leave from 11th sept,Mon 2017 to 13 sept,Wed 2017--3 days person 1 applied Casual leave from 14th ,Thu 2017 to 15 sept,Fri 2017--2 days person 1 applied Vacation leave from 18th ,Mon 2017 to 26 sept,Tue 2017--7 days excluding sat,sun Then I need a table in the form of | leave type|count| | vacation | 7 | | casual | 2 | | sick | 3 | This is for single employee...I need it even for each and every employee models.py class employees(models.Model): emp_name = models.CharField(max_length = 100) emp_loc = models.CharField(max_length = 100) manager_id=models.IntegerField(null=True) class leave(models.Model): employee = models.ForeignKey(employees, on_delete=models.CASCADE, default='1') start_date = models.DateField() end_date = models.DateField() l_type=models.CharField(max_length=1) -
Can I use GitHub project in production?
I create project with Django backend and Angular frontend. I wonder whether it is legal to use someone's code from GitHub in my own project which will be deployed and will be profitable in the future? -
Am getting errors in trying to migrate using Django
"I get this error when am trying to start a project on Django. am a new user. kindly help me out. Thanks" (awd) C:\Users\Abdul-Waris\Desktop\awd>django-admin.py startproject muyipicky (awd) C:\Users\Abdul-Waris\Desktop\awd>python manage.py migrate Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "C:\Users\Abdul-Waris\Desktop\awd\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line utility.execute() File "C:\Users\Abdul-Waris\Desktop\awd\lib\site-packages\django\core\management\__init__.py", line 307, in execute settings.INSTALLED_APPS File "C:\Users\Abdul-Waris\Desktop\awd\lib\site-packages\django\conf\__init__.py", line 56, in __getattr__ self._setup(name) File "C:\Users\Abdul-Waris\Desktop\awd\lib\site-packages\django\conf\__init__.py", line 41, in _setup self._wrapped = Settings(settings_module) File "C:\Users\Abdul-Waris\Desktop\awd\lib\site-packages\django\conf\__init__.py", line 110, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "C:\Users\Abdul-Waris\Desktop\awd\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked ModuleNotFoundError: No module named 'muyipicky' -
Get newly added forms from django formset
I have a formset as follows: TableAddFormSet = modelformset_factory(Table, form=TableAddForm) The model looks like this: class Table(models.Model): restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) amount_of_people = models.IntegerField() category = models.CharField(max_length=10) reserved = models.BooleanField(default=False) Now the model required the attribute 'restaurant', which I will set on form-submission. Until now I've done the following: for form in formset: form.instance.restaurant = request.user.restaurant which means that even forms that already existed get looped through and updated. Is there a more efficient way to add this attribute to the newly added forms, something like: for form in formset.new_forms(): or is my implementation the most suitable way for solving this problem? -
How can I handle both pk and url values HyperlinkedModelSerializer in Django Rest Framework
Unsure if there is a good way to do this. If I have a ForeignKey relation - something like this: class ModelA(models.Model): modelb = models.ForeignKey(ModelB) class ModelASerializer(serializers.HyperlinkedModelSerializer): pass I am able to properly set modelb if I POST with this as part of the request "modelb": "http://localhost:8000/rest/modelb/1/" Whats the best way to continue to allow for this behavior, but also allow for directly using the pk? "modelb": 1 I've seen a few things reference using something like this, but I'm unable to determine how to properly set this up "modelb_id": 1 -
Docker + Django + Postgres Add-on + Heroku
So I'm running through the following: Created a Dockerfile and a docker-compose.yml to develop a django app locally, nothing to do here, everything works just fine. Dockerfile FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ All it does is fetches python3 image, copies the code from my source folder to the docker image Then I'm trying to deploy this to heroku, so I added postgres add-on on heroku apps, and configured it using dj_database_url, with the following command on my settings.py file : DATABASES = {} DATABASES['default'] = dj_database_url.config() After that I pushed my application to heroku using heroku container:push web and it got pushed to my app no problem at all... The final piece is when I open my application using heroku open it says I got an error: Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. This is what get printed on the heroku website Now, when I log using heroku logs -t, it says that exited with code 0, then it crashes What am I missing? … -
djangotables2 shows bullets near pagenumbers
I am new to django-tables2 and was trying out few things. I followed the django-tables2 tutorial of using data from model directly without creating tables with another dataset. However bullets appear near the page numbers area. How do I remove the bullet points? Screenshot of the bottom of page