Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django: Ajas and Reverse error: "str" object is not callable
I have some code that will return to an ajax call a reverse-url that is defined in my urls.py I have the user update a page and then they click submit. When they click submit they should return to the item list view instead of the item update view. Views.py This returns the same page successfully, but it isn't what I want. return JsonResponse({"status": "success", "message": message}) This produces an error message "next_url": reverse("item:list"), TypeError: 'str' object is not callable return JsonResponse({"status": "success", "next_url": reverse("item:list"), "message": message}) HTML page Here is the template's ajax used to route the user: $.ajax({ url: '/item/ajax/approve/', data: { 'reply': reply, 'item': item, 'user_type': userType, }, type: "POST", dataType: 'json', success: function (data) { var successMsg = data.message if (data.status){ successMsg = successMsg + "<br/><br/><i class='fa fa-spin fa-spinner'></i> Redirecting..." //<i class> - 'font awesome' } if (data.next_url){ if ($.alert){ // if alert message is installed $.alert(successMsg) } else { alert("") } redirectToNext(data.next_url, 1500) } else { location.reload(); } } }); -
How to use javascript to display an alert box with the value of a html element in Django Templates?
I have an updateview with modelformsets that is rendered in a django temaplate, see Modelformset_factory render in django template. The template renders 3 modelformsets. I want when a user clicks the div with the class = "panel-footer", see template snippet, the value of {{ forma.instance.suggestReason }} is displayed in an alert box. Since the template will render 3 different modelformsets in three different panels with footer, I want the associated {{ forma.instance.suggestReason }} for a panel-footer to be displayed in an alert box when each of the divs with the class = "panel-footer" is clicked. Snippet of template: <form method="POST" enctype="multipart/form-data" style="margin-left: 40px; margin-right: 40px"> {% csrf_token %} {{ formset.management_form }} {{ formset.non_form_errors }} {% for forma in formset.forms %} <div class = "panel panel-primary"> <div class = "panel-heading"> <h3 class = "panel-title">{{forma.instance.attackPattern.APid}} : {{forma.instance.attackPattern.name}}</h3> </div> <div class = "panel-body"> {{ forma}} </div> <div class = "panel-footer"> {{ forma.instance.suggestReason }} </div> <a href="#{#% url 'RecSys:apid' forma.instance.attackPattern.APid %#}"></a> </div> {% endfor %} <input class="btn" type="submit" value="Update" /> </form> -
How to pass two model's pk in url Django? - <int:pk> | id
When I wrote code as below: path('project/<int:pk>/user/<int:pk>/project-detail', app.ProjectDetailView.as_view(), name='project_user_detail'), I got the error of raise source.error(err.msg, len(name) + 1) from None sre_constants.error: redefinition of group name 'pk' as group 2; was group 1 at position 35 I would like to know how to pass 2 pk/id from different models, thanks in advance for any advice. -
Django flatpages: store multiple values to access from template
Is there a way to store multiple values using flatpages. Say, you have a static page with 3 separate sections and you need to save content value for each of them. Maybe there is a way to store at least JSON formatted data, and access it from templates by the key. -
Check string name with list of strings and get matching part of string
I am struggling on a more 'complicated' filtering for a Django object. I have a list of Team names and list of periods in the names: teams = Hold.objects.all().exclude(name="test") fall = ['F18', 'F-18', 'F - 18'] spring = ['E18', 'E-18', 'E - 18', 'EFTERÅR', 'EFTERÅR18'] #### TEAMS #### # "Team#1, F18" # "Team#2, F-18" # "Team#3, E18" # "Team#4, F - 18" # ... # ... # "Course#X, Period" for team in teams: #if team.name includes any of the keywords in the lists: period = keyword that matched with team.name I have to create a variable name for period period = 'F18' or period = 'E18' depending on their respective periods. I cannot seem to get this to work though, I hope someone here is a list comprehension magician that can help me out! -
Django logging - ValueError: 'NoneType' object has no attribute 'split'
I am trying to configure some logging within an application that uses Django that will ultimately log a few different types of information to separate log files (such as time taken to run a module, markers for different modules to categorize flow, etc). The application is deploying to a VirtualBox Ubuntu 16.04 environment. Right now, I'm simply trying to get some simple test information logged into a file called eems-dashboard.log (which I created, is empty, and seem to have full access to) just to try to get the logging to work initially. The setup in settings.py looks like this: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' }, }, 'handlers': { 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'verbose' }, 'log_file':{ 'level': 'DEBUG', 'filename': '/var/log/eems-dashboard.log', 'formatter': 'verbose' } }, 'loggers': { '': { 'handlers': ['log_file'], 'level': 'DEBUG', }, 'django.request': { 'handlers': ['log_file'], 'propagate': True, 'level': 'DEBUG' }, 'apps': { 'handlers': ['log_file'], 'level': 'DEBUG', 'propagate': True, } } } However, whenever I try to run a local deployment of this application, I get the following error: Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/webapps/uiux/env/lib/python3.5/site-packages/django/core/management/__init__.py", line … -
With AWS, why I can't access my file, however it exists?
The issue is with django 1.11, python 3.5 I am struggling with it since 6 hours. When I visit the link into a browser, it shows the file correctly. http://bucket-name.s3.amazonaws.com/media/public/path/to/file.pdf But when I do this: with open(absolute_path, 'wb') as output: output.write(object_content) I get the following error: Exception Type: FileNotFoundError Exception Value: [Errno 2] No such file or directory: http://bucket-name.s3.amazonaws.com/media/public/path/to/file.pdf' Why I can't access the file? -
how do I get multiple url files remotely and zip them? django
I am trying to zip some files which might contain different formats, might be another zip, png, doc, pdf and etc. I am currently zipping one file as testing but I am getting errors such as [Errno 2] No such file or directory: 'filename_here' Which part am I doing this wrong though? import urllib2 from StringIO import StringIO from zipfile import ZipFile f = StringIO() zip = ZipFile(f, 'w') url = urllib2.urlopen("https://domain/filename_remote.zip") filename = 'filename_remote.zip' zip.write(filename, url.read()) zip.close() response = HttpResponse(f.getvalue(), content_type="application/zip") response['Content-Disposition'] = 'attachment; filename=test.zip' return response Thanks in advance for any suggestions and help P.S. this is with python2.7 -
How to deploy a Django site that uses numpy
I made a virtual environment on my local computer and installed numpy to be used in my web app. I found many tutorials on how to deploy django apps on a server, but I am not sure if those tutorial would work if my app depends on numpy. My app also uses static files some of which are csv files that are being parsed using python's csv library. I am not sure where to look or what to look for that would help me get started with this process. Any ideas or guides that would help? -
optimize prefetch_related objects
I have 2 models, and I both serialize them with django restframework class ModelA: idmodelA=model.Autofield(primary_key=True) class ModelB: idmodelB=model.Autofield(primary_key=True) modelA =models.ForeignKey(ModelA, on_delete=models.PROTECT) class ModelASerializer(serializers.ModelSerializer): class Meta: model = ModelA fields = "__all__" class ModelBSerializer(serializers.ModelSerializer): modelA=ModelASerializer() class Meta: model = ModelB fields = "__all__" I have the following code, which extracts all the records of model b, and relates it to model A, it works normally with a number of 2000 records, but when it exceeds this number, it generates an error It should be noted that the same number of records that exist in model B exists in model A, that is, modelA = 100000 modelB = 100000 query = ModelB.objects.raw(sql) query = list(query) prefetch_related_objects(query, "modelA") data = ModelBSerializer(query, many=True).data As I mentioned, if the models have more than 2000 records, it generates an error, I think it is related to the number of parameters that you can receive the prefetch_related_objects, because the error is generated in this line: prefetch_related_objects (query, "modelA") finally it is necessary to use raw, since I build the sql someone who can tell me how to solve this problem Use this example for prefetch_related_objects -
No reverse match error from django.contrib.auth.views.LoginView
This should be simple enough, but after spending multiple hours trying to figure this out, reviewing past code, and searching for answers online, I am out of ideas. Browser Error message: NoReverseMatch at /accounts/login/ Reverse for 'login' not found. 'login' is not a valid view function or pattern name. Request Method: GET Request URL: http://127.0.0.1:8000/accounts/login/ Django Version: 2.1 Exception Type: NoReverseMatch Exception Value: Reverse for 'login' not found. 'login' is not a valid view function or pattern name. Exception Location: C:\Anaconda3\envs\bookmarks\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 622 Python Executable: C:\Anaconda3\envs\bookmarks\python.exe Python Version: 3.6.6 Python Path: ['C:\\Users\\raine\\PycharmProjects\\Mapt\\bookmarks\\bookmarks', 'C:\\Anaconda3\\envs\\bookmarks\\python36.zip', 'C:\\Anaconda3\\envs\\bookmarks\\DLLs', 'C:\\Anaconda3\\envs\\bookmarks\\lib', 'C:\\Anaconda3\\envs\\bookmarks', 'C:\\Anaconda3\\envs\\bookmarks\\lib\\site-packages'] Server time: Tue, 7 Aug 2018 21:29:41 +0000 The project tree: bookmarks ├───accounts │ ├───migrations │ │ └───__pycache__ │ ├───templates │ │ └───accounts │ └───__pycache__ ├───bookmarks │ └───__pycache__ ├───static │ └───css └───templates bookmarks/urls.py urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('accounts.urls', namespace='accounts')) ] which redirects to accounts/urls.py . I don't expect my error because I'ved assigned the name 'login' in the url path. app_name = 'accounts' urlpatterns = [ path('login/', auth_views.LoginView.as_view(template_name='accounts/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='accounts/logout.html'), name='logout'), ] I am especially confused since the LogoutView works, and the LoginView does not. I've reviewed code from some other projects that accomplish the same thing and … -
Increment Visits Counter from Django REST
for some reason i can't figure out why my counter is only updating at first url fetch or when server is restarted (or when i just save my code and local server is updating) but not anymore after it. Made a simple counter class models.py class HitCount(models.Model): visits = models.IntegerField(default=0) And a simple update when view is supposed to be fetch from react views.py class HitCountViewSet(viewsets.ModelViewSet): HitCount.objects.filter(pk=1).update(visits=F('visits') + 1) queryset = HitCount.objects.all() serializer_class = HitCountSerializer Also, in case of, there's my serializer.py class HitCountSerializer(serializers.ModelSerializer): class Meta: model = HitCount fields = ('visits',) My goal is simply to update the counter when I fetch the url then get the count data for show purposes. -
django bootstrap4 app doesn't render form field errors in place
My form template looks like so: {% load bootstrap4 %} {% load i18n %} <form method="post" novalidate> <div class="panel panel-primary"> <div class="panel-body"> {% csrf_token %} {% bootstrap_form form %} </div> <div class="panel-footer"> <div class="row"></div> <div class="row"> <div class="col-md-5"></div> <div class="col-md-1"> <input class="btn btn-primary" type="submit" value="Save" /> </div> <div class="col-md-5"></div> </div> </div> </div> </form> But when a field is invalid, the errors are all presented at the top of the form instead of in-place next to the field in error. I'm not sure why. -
Deploy Django Application on Digital Ocean inside a VPN
I have a Django application that currently runs inside a LAN. It queries some other computers over LAN for specific data (REST API). It queries by directly providing the IP address of the computers on LAN like 10.16.1.19:8080/api/get_data. Now, I want to move the application to the cloud. However, I am not able to understand how I can then query the data in a similar fashion. Once deployed on the cloud, the application won't understand private IPs like 10.*. Has anyone faced this issue before?. How can I run the application on digital ocean inside a VPN and be it accessible to all the computers on our LAN? For eg: I use Cisco AnyConnect to connect to the computers from home. Once connected, I can use private IP's to query data. How can this be achieved in cloud environment?. Any pointers will be highly appreciated!. Thanks in Advance.... -
Django 'ModelForm' object has no attribute 'object'
I have a ModelForm and I'm trying to display it with some of the fields disabled. In this case, process_id. The important part of my Model looks like this: models.py class Process(models.Model): related_processes = models.ManyToManyField('self', blank=True, symmetrical=False) process_id = models.CharField(max_length=20, primary_key=True) normal_field = models.CharField(max_length=20) # a lot of fields here... So basically I have a Process that can have zero or more related processes. This is what I have on forms.py: forms.py class ProcessForm(ModelForm): class Meta: model = Process fields = '__all__' class EditProcessForm(ProcessForm): readonly_fields = ('process_id', ) def __init__(self, *args, **kwargs): super(EditProcessForm, self).__init__(*args, **kwargs) for field in (field for name, field in self.fields.items() if name in self.readonly_fields): field.widget.attrs['disabled'] = 'true' field.required = False def clean(self): for f in self.readonly_fields: self.cleaned_data.pop(f, None) return super(EditProcessForm, self).clean() class NewVersionProcessForm(EditProcessForm): readonly_fields = ('process_id', ) def __init__(self, *args, **kwargs): super(NewVersionProcessForm, self).__init__(*args, **kwargs) for field in (field for name, field in self.fields.items() if name in self.readonly_fields): # field.widget.attrs['disabled'] = 'true' # Remember this line ^ field.required = False The first time the client is filling the form, I want all fields to be editable, so I use ProcessForm. But when the client is editing the Process, I want some fields to be read-only. I found … -
What's the best way to dynamically change what fields serializer uses?
I have a DRF serializer that I want to use for multiple purposes. It should be able to update, create, and exclusively validate (no saving). I have no problem creating and updating, when validating, I run into problems. While I validate, I need to create an instance of the object, and return the serialized object back to the client. However, I don't want to use all the fields I normally would when creating saving an instance when I'm validating. Additionally, I just want to be able to create an instance and move on. My current solution is to use the rest_flex_fields' FlexFieldsModelSerializer. This seems to work fine, but when I attempt to create an instance without actually saving it, it fails to create an instance and returns None. I've overridden the create function as follows: def create(self, validated_data): instance = ModelClass(**validated_data) return instance but instance is always None. I do not know why. This is what I have in my viewset: if serializer.is_valid(raise_exception=True): instance = serializer.create(serializer.validated_data) return MySerializer(instance).data That, however, will never work if instance is None. So I guess the TL;DR here is the following: Is my approach to dynamically use different fields valid? Why does attepmting to create … -
Python + Django + Celery , Very low publish speed
I am having serious problems with task publish speed and I am currently working on debuging it, I think it's problem with celery settings. 1 down vote favorite 3 I'm using Django, Celery and RabbitMQ. I have a simple task that sends emails. This task works, but its very slow. For example I want to execute 10000 simple 'test_print() tasks' in a loop I can't publish more than 23-24/s. Before it would easily publish 1000+/s. I am having this problem with completely EVERY task i have in the system. It might have happened since i moved my code to Djcelery(wrapped celery project with django code) or something changed on the server(less possible option). Here are my settings maybe you guys would have an idea what might be a problem. It's using rabbitmq server. settings: CELERY_BROKER_POOL_LIMIT=0 CELERY_CELERYD_PREFETCH_MULTIPLIER=1 CELERY_BROKER_CONNECTION_TIMEOUT=20 CELERY_BROKER_CONNECTION_RETRY=True CELERY_BROKER_CONNECTION_MAX_RETRIES=100 CELERY_BROKER_HEARTBEAT=10 CELERY_TASK_SEND_SENT_EVENT =True CELERY_CELERYD_SEND_EVENTS =True CELERY_RESULT_BACKEND='rpc://' CELERY_CELERYD_MAX_TASKS_PER_CHILD=500 CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_TASK_ROUTES= { 'parse_x.*': { 'queue': 'parse_x', 'routing_key': 'parse_x', },... } tasks: @shared_task(name="solicitor_tracker.test_print") def test_print(i): print(i) time.sleep(0.1) @shared_task(name="setup_queue.test_print_task_setup_queue",acks_late=False, autoretry_for=(Exception,), retry_backoff=True) def redirection_check_setup_queue(): for i in range(0,100000): test_print.apply_async([i],queue="lawsociety_parse") -
Celery not working when running in Docker container
I am trying to develop an application which is composed of a listener which sends events to RabbitMQ, which Celery extracts from a queue. When running all the components locally my application works as expected. It also works if my listener is running locally, and all the other components are running in Docker containers. But if I also run my listener in a container then Celery does not receive any events. The application is based on Django and the connection to Celery is done like this: app = Celery('mini_iot') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() And in settings.py I have: CELERY_BROKER_URL = 'amqp://rabbitmq' Where rabbitmq is the hostname of the container. The listener sends tasks to Celery using the delay function. Can anyone help me debug the problem or does anyone have an idea about what the problem is? The containers can communicate with each other on the correct ports. I have tested using telnet. -
Django: How to automatically log a user in after clicking activation link in email?
I want to automatically log a user in after they click an activate account link. Here is my views.py: def signup(request): if request.user.is_authenticated: if request.user.is_active: return redirect('/') if request.method == 'POST': form = UserCreationForm(request.POST) if form.is_valid(): user = form.save(commit=False) to_email = form.cleaned_data['email'] email_suffix = to_email.split("@")[-1] university = University.objects.get(email_suffix=email_suffix) user.is_active = False user.university = university user.save() current_site = get_current_site(request) subject = 'Activate Your Account' html_content = render_to_string('core/email_templates/activate_account_email.html', { 'user': user, 'domain': current_site.domain, 'uid': urlsafe_base64_encode(force_bytes(user.pk)).decode(), 'token': account_activation_token.make_token(user), }) text_content = strip_tags(html_content) email = EmailMultiAlternatives(subject, text_content, to=[to_email]) email.attach_alternative(html_content, "text/html") email.send() message = ('<p class="bigTitle">Nearly Done...</p>' '<p class="noMargin">We\'ve just sent you an activation' ' email. Click the link in the email to activate your' ' account.</p>') return render(request, 'core/signup.html', {'message': message }) else: form = UserCreationForm(label_suffix="") return render(request, 'core/signup.html', {'form': form }) def activate(request, uidb64, token): try: uid = force_text(urlsafe_base64_decode(uidb64)) user = CustomUser.objects.get(pk=uid) except(TypeError, ValueError, OverflowError, User.DoesNotExist): user = None if user is not None and account_activation_token.check_token(user, token): user.is_active = True user.save() login(request, user) return redirect('/') else: return HttpResponse('Activation link is invalid!') And here is the section of my base template which shows the appropriate login/ logout links: <div id="menuWrapper"> <div id="menu"> <a class="menuItem" href="/?order=top" >Community</a> {% if user.is_authenticated %} <a href="{% url 'core:profile' … -
django runserver doesn't show the starting development server message
why in mingw64 the django manage.py runserver comand doens't output the message of starting the server but runs it anyway. Also right after i do ctrl + c and shut the server, the message is then shown. ;/ in the windows cmd it works fine anyway.. i'm just curious if anyone has any clue how to properly run this inside the bash which i'm so much more familiar with. thanks anyway! -
Django Ajax model object value
What am I doing wrong here? When user selects a fruit from drop down, I want to alert the originate of that ModelFruits. I think this line may be causing the trouble data = Fruits.objects.filter(selected_fruit__exact=id). originate models.py class Fruits(models.Model): Fruit_name = models.CharField(max_length=50) available = models.BooleanField(default=False) store = models.CharField(max_length=50) originate = models.CharField(max_length=50) views.py class new_sale(CreateView): model = sale fields = '__all__' def ajax_prices(request): selected_fruit = request.GET.get('selected_fruit', None) data = Fruits.objects.filter(selected_fruit__exact=id). originate return JsonResponse(data) new_sale.html <script> $("#id_selected_fruit").change(function () { console.log($(this).val()); var form = $(this).closest("form"); $.ajax({ url: form.attr("data-validate-username-url"), data: form.serialize(), dataType: 'json', success: function (data) { alert(data); } }); }); </script> -
Django queryset indexing shuffle around and doesn't remember my changes
Background I have model C inherits B In C, it has just normal charField, nullBooleanField and foreign keys. In B, it has bunch of dateField like below class B(models.Model): date_added = models.DateTimeField(auto_now_add=True) date_modified = models.DateTimeField(auto_now=True) date_deactivated = models.DateTimeField(null=True, blank=True) active = models.BooleanField(default=True, db_index=True, help_text='Set to false if the instance is deleted.') class Meta: abstract = True None of those classes has meta order specified. The problem When I was in a shell_plus, I assigned C.objects.all() to a variable called cs, then I can see cs[0], cs[1], cs[2] and cs[3]. There are only 4 records. Now I want to change one nullBooleanField to false/true. I did cs[1].foo = true and cs[1].save() I would expect 4 records are in the same order as when I fetched them and the second record's foo field is updated. The actual result is, for some reasons, the second record is moved to the back of the list, and it doesn't remember my changes. For example, in the beginning, 4 records are R1, R2, R3, R4 and R2.foo is false. After the assigning foo to true for the second record as I describe above, the result is R1, R3, R4, R2 and R2.foo is still false. The … -
Python Django app logger logs in different app directory
I have a django project with 3 different apps (A, B, C). In my settings.py file I am loading the apps in this order: INSTALLED_APPS = [ # Rest framework 'django_filters', 'django_apscheduler', 'rest_framework', 'corsheaders', # Project applications 'application_A.apps.ApplicationAConfig', 'application_B.apps.ApplicationBConfig', 'application_C.apps.ApplicationCConfig', ... ] I have a logging.conf separately file in each of A, B, C: log_config.conf [loggers] keys=root,LogRunner [handlers] keys=consoleHandler, fileHandler [formatters] keys=logfileformatter [logger_root] handlers=fileHandler, consoleHandler level=INFO qualname=root propagate=0 [logger_LogRunner] handlers=fileHandler level=INFO qualname=nas_app_master propagate=0 [handler_consoleHandler] class=StreamHandler formatter=logfileformatter args=(sys.stdout,) level=INFO [handler_fileHandler] class=handlers.RotatingFileHandler level=INFO args=('%(logfilename)s','a',500000,100,'utf8') formatter=logfileformatter [formatter_logfileformatter] format=%(levelname)-10s | %(asctime)s | %(name)-25s | %(filename)-20s:%(lineno)3s | %(funcName)15s() | %(message)s I instantiate my logger in each of my separate apps using a getLogger method I wrote which takes in a class __name__ as so (I have helper methods that get app and config directories properly): config_file = get_config_directory() + 'log_config.conf' _log_url = get_app_root() + '/logs/' + log_file_name + '.log' logging.config.fileConfig(config_file, defaults={'logfilename': _log_url}, disable_existing_loggers=False) logger = logging.getLogger(log_class) # logger for this module return logger Now all three apps have the same logging config and the same getLogger. My issue What is happening is that logs for Application A are sometimes getting stored in \path\to\app_A\appA.log but often times they are getting stored in app_B\appA.log as well. Why … -
Importing a function from a file in a model in python django
I have a model with a filefield for a .py file. In my view, I need to be able to use import the function or find a way to send a list of kwargs to the file and catch the output. I tried with subprocess.Popen, but I can't make it work. Can you help me please? Thank you. -
django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited
(ll_env) brads-MacBook-Pro:learning_log $ python manage.py runserver Performing system checks... Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10d417d08> Traceback (most recent call last): File "/learning_log/ll_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check(display_num_errors=True) File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/management/base.py", line 379, in check include_deployment_checks=include_deployment_checks, File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/management/base.py", line 366, in _run_checks return checks.run_checks(**kwargs) File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/checks/registry.py", line 71, in run_checks new_errors = check(app_configs=app_configs) File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/learning_log/ll_env/lib/python3.6/site-packages/django/core/checks/urls.py", line 23, in check_resolver return check_method() File "/learning_log/ll_env/lib/python3.6/site-packages/django/urls/resolvers.py", line 396, in check for pattern in self.url_patterns: File "/learning_log/ll_env/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/learning_log/ll_env/lib/python3.6/site-packages/django/urls/resolvers.py", line 533, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/learning_log/ll_env/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/learning_log/ll_env/lib/python3.6/site-packages/django/urls/resolvers.py", line 526, in urlconf_module return import_module(self.urlconf_name) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 950, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "/learning_log/learning_log/urls.py", line 23, in <module> url(r'',include('learning_logs.urls',namespace='learning_logs')), File "/learning_log/ll_env/lib/python3.6/site-packages/django/urls/conf.py", line 34, in include urlconf_module = import_module(urlconf_module) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", …