Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Connecting css, js, etc files to my Django rendered HTML webpage
I'm trying to render my HTML webpage and I'm having some issues. Here is my views.py file: from django.shortcuts import render def index(request): return render(request, 'index.html') Here is the TEMPLATES portion of my settings.py file: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['portfolio/PersonalSite', 'portfolio/PersonalSite/css/bootstrap.min.css', 'portfolio/PersonalSite/css/styles.css', 'portfolio/PersonalSite/js/scripts.min.js', 'portfolio/PersonalSite/files', 'portfolio/PersonalSite/libs/font-awesome/css/font-awesome.min.css', 'portfolio/PersonalSite/images/Guelph_Hacks_Logo.jpg', 'portfolio/PersonalSite/images/Tilt.jpg', ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] As you can see I tried to fix the problem by adding all the individual missing paths here but no luck unfortunately :( and here outputted error message: Django version 2.0.1, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [10/Jan/2018 16:54:41] "GET / HTTP/1.1" 200 10678 Not Found: /libs/font-awesome/css/font-awesome.min.css [10/Jan/2018 16:54:42] "GET /libs/font-awesome/css/font-awesome.min.css HTTP/1.1" 404 2178 Not Found: /css/styles.css [10/Jan/2018 16:54:42] "GET /css/styles.css HTTP/1.1" 404 2094 Not Found: /css/bootstrap.min.css [10/Jan/2018 16:54:42] "GET /css/bootstrap.min.css HTTP/1.1" 404 2115 Not Found: /images/Guelph_Hacks_Logo.jpg Not Found: /js/scripts.min.js [10/Jan/2018 16:54:42] "GET /images/Guelph_Hacks_Logo.jpg HTTP/1.1" 404 2136 [10/Jan/2018 16:54:42] "GET /js/scripts.min.js HTTP/1.1" 404 2103 Not Found: /images/Tilt.jpg [10/Jan/2018 16:54:42] "GET /images/Tilt.jpg HTTP/1.1" 404 2097 Not Found: /j_icon.jpeg [10/Jan/2018 16:54:42] "GET /j_icon.jpeg HTTP/1.1" 404 2085 If anyone could shed a little light on how I can properly fix this … -
Django error with encoding while I try to delete item from database
When I try to delete an item from the database I got the exception: The string that could not be encoded/decoded was: rm coöperat I attached screenshots with traceback and item: https://prnt.sc/hypxcc https://prnt.sc/hypyd4 -
How can I move data from views.py to a models.py in python/django in this case?
I put these files in the order the data travels. First the user submits a ticker via Charfield on the add file. Then the add function creates an instance of the score class by submitting the ticker value, which works. I also calculate points in add, but I can't figure out a way to send points to the class in models also. All of the examples I've seen on StackOverflow usually have variables in the class being related to some CharField or ForeignKey. So it possible to send points to score()? I also know scoreCalculate works. The error this code generates: File "~/models.py", line 6, in score points; NameError: name 'points' is not defined Of course it isn't defined, I'm just not sure what to define it as. add.html <form action="{% url 'add' %}" method="post"> {% csrf_token %} <label for="ticker">Ticker</label><br /> <input type="text" name="ticker" id="ticker"/> <br><br> <input type="submit" value="submit" /> </form> views.py from django.shortcuts import render, redirect from django.http import HttpResponse from .models import score from Rssfeed import scoreCalculate def add(request): if(request.method == 'POST'): ticker = request.POST['ticker'] pts = scoreCalculate(ticker=ticker) sc = score(ticker = ticker) sc.save() return redirect('/') else: return render(request, 'add.html') models.py from django.db import models from datetime import … -
Regarding Debugging setup in pydev Django Mac
Can any body please shed some light on below error , i am trying to run django in a debug mode and Getting below error in eclipse Neon.3 Release (4.6.3) on MacOS, Python3 in virtual env setup. I have setup server properties in manage.py, i could also see space generated in ip and port http://127.0.0.1: 8082 pydevd.settrace('http://127.0.0.1', port='8082', stdoutToServer=True,stderrToServer=True) Any help would be highly appreciated. Many thanks, raky Error: warning: Debugger speedups using cython not found. Run '"/Users/XXX/Documents/YYYY/VirtualEnvironments/myVirtual1/bin/python3" "/Users/XXX/.p2/pool/plugins/org.python.pydev_6.2.0.201711281614/pysrc/setup_cython.py" build_ext --inplace' to build. pydev debugger: starting (pid: 4670) Could not connect to http://127.0.0.1: 8082 NoneType: None -
How do I paginate in django?
Here is the code of the views.py def view_images(request): return render_to_response('gallery/index.html',{ 'categories': Category.objects.all(), 'images': Image.objects.all(), 'video': Video.objects.all() }) I know its a messy way to code but I want to paginate this code -
Django Join three models
My model has these tables : class Stocks(models.Model): user=models.ForeignKey(User, null=True) name=models.CharField(max_length=128,verbose_name=_('stockname')) number=models.CharField(max_length=64,verbose_name=_('number')) suffix=models.CharField(max_length=12,verbose_name=_('uffix')) brand=models.CharField(max_length=64, ,verbose_name=_('brand')) class UserProfileInfo(models.Model): user=models.OneToOneField(User) tel = models.CharField(max_length=17,blank=True,verbose_name=_('tel')) address=models.CharField(max_length=264,verbose_name=_('address')) and thoe third table is default User model which has relation to UserProfileInfo and Stocks I have a table in Html like this : {% for item in allstocks %} <tr data-original-title="888" data-container="body" data-toggle="tooltip" data-placement="bottom" title="{{ ??? obj.address ??? }}"> <td>{{forloop.counter}}</td> <td>{{ item.user }}</td> <td>{{ item.name }}</td> <td>{{ item.brand }}</td> <td>{{ item.number }}</td> <td>{{ item.suffix }}</td> </tr> I think I should join those three tables to be able to show the address of the user in the mouseover tooltip of the HTML table, if so, How ? -
Ajax request to django view not returning response
I'm making a website where I want to load user submitted comments on elements and I want to be able to dynamically display them and not have the webpage have to load them all at once. so I setup this ajax request function: function loadcomments(){ $.ajax({ url: '/ajax/getcomments/', data: { 'identifier': {{ identifier }} 'begin': 0, 'end': 30 }, dataType: 'json', success: function (data) { alert(data.comments); } }); }; And a view to respond to that request: def obtain_comments(request, *args, **kwargs): begin = kwargs.get('begin'); end = kwargs.get('end'); comments = end - begin all_before = Comment.objects.order_by('-uploaded')[:end] data = { 'comments': all_before.order_by('uploaded')[:comments] } return JsonResponse(data) But I'm not getting a response. I'm not seeing any errors inside the browser console, however in the django runserver terminal I see: Internal Server Error: /ajax/getcomments/ Traceback (most recent call last): File "/home/trie/Desktop/django/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/home/trie/Desktop/django/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/trie/Desktop/django/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/trie/Desktop/django/vidmiotest/player/views.py", line 64, in obtain_comments comments = end - begin TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType' or if I set begin and end to a fixed value instead of kwargs: Internal … -
Why are there no images in my request.FILES (Django, Ajax)?
I try to get my images back after using an ajax call. Normally they should be in my request.FILES.getlist('images'). But they are not. When I print that out it shows 0. When I do alert(images.length); it is showing me that there are images before I do the ajax call. What I am doing wrong ? Thanks for your help. views.py @login_required def ajax_send_message(request): chatid = request.POST.get('chatid') chattext = request.POST.get('chattext') images = request.FILES.getlist('images') chat = Chat.objects.get(id=chatid) user = User.objects.get(id=request.user.id) message = Message(chat=chat, message=chattext, user=user) message.save() print(len(images)) data = {'chattext': chattext} return JsonResponse(data) chats.js $("#btn-send").click(function(){ var chatid = $(this).val(); var chattext = $("#chat-textarea").val(); var images = $('input#images').get(0).files; alert(images.length); var csrftoken = Cookies.get('csrftoken'); var formData = new FormData(); formData.append('chatid', chatid); formData.append('chattext', chattext); formData.append('images', images); formData.append('csrfmiddlewaretoken', csrftoken); $.ajax({ url:'/ajax/send_message/', data: formData, type: 'POST', cache: false, processData: false, contentType: false, dataType: 'json', success: function(){ showCurrentlySendMessage(chattext); } }); }); -
Running collectstatic on server : AttributeError: 'PosixPath' object has no attribute 'startswith'
After deploying on a server on digital ocean using nginx, gunicorn, django, and virtualenv, I try to use collectstatic: python manage.py collectstatic --settings=config.settings.production As you can see I have multiple setting files. One base, one local and one production setting file. Below is the error: Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 173, in handle if self.is_local_storage() and self.storage.location: File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/utils/functional.py", line 239, in inner return func(self._wrapped, *args) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/tony/vp/vpenv/lib/python3.5/site-packages/django/core/files/storage.py", line 283, in location return abspathu(self.base_location) File "/home/tony/vp/vpenv/lib/python3.5/posixpath.py", line 357, in abspath if not isabs(path): File "/home/tony/vp/vpenv/lib/python3.5/posixpath.py", line 64, in isabs return s.startswith(sep) AttributeError: 'PosixPath' object has no attribute 'startswith' my production.py settings file contains the following: MEDIA_ROOT = BASE_DIR / 'media' MEDIA_URL ='media/' STATIC_ROOT = BASE_DIR / 'static' my base dir is as follows (imported from the base setting file): BASE_DIR = Path(file).resolve().parent.parent.parent What could be the cause? Thanks in advance! -
How to make a double Inner Join in django?
I have a django aplication that have to show the country name and the city name of a "need" in the list of candidate. To explain this better I have the next picture: So, here is the process: First, someone posts a "need" with their respective country and city. The city and the country are in diferent model. Then, the candidate can make an offer to resolve that need. I want to see in a list, all the offers I send to the need (just 1 offer to 1 need) but in my html template I want to display the name of the country and the city of the need. Here is my models.py class requiter (models.Model): requiter_name = models.CharField(max_length=200, null=True) class country (models.Model): country_name = models.CharField(max_length=200, null=True) class city (models.Model): city_name = models.CharField(max_length=200, null=True) class candidate (models.Model): full_name=models.CharField(max_length=230, null=True) class need(models.Model): requiter = models.ForeignKey(requiter, on_delete=models.CASCADE, null=True) title= models.CharField(max_length=300, null=True) description=models.TextField(null=True) country=models.ForeignKey(country, on_delete=models.CASCADE, null=True) city=models.ForeignKey(city, on_delete=models.CASCADE, null=True) class offer(models.Model): need = models.ForeignKey(need, on_delete=models.CASCADE, null=True) candidate = models.ForeignKey(candidate, on_delete=models.CASCADE, null=True) and here is my views.py def candidateprofile(request): candata = candidate.objects.get(id=request.session['account_id']) #HERE IS WHERE I WANT TO TAKE ALL THE OFFERS THAT THE CANDIDATE MADE, AND THE NAME OF THE COUNTRY AND … -
Django widget tweaks popover won't move with content
I'm using django widget tweaks to render a form field that is required. It all works fine, if the field is blank, I see a cute little popover that says field is required and all that, but if I scroll the page (the form is a little big), the popover won't move with the form field. It'll stay put and that is not good. Here's my code: {% load widget_tweaks %} {{form.order_number.label}} {% render_field form.order_number required="true" %} Also, this is happening only on Firefox, not on Chrome. I'm on Firefox 57.0. Here's a screenshot to help. In Pic1, you'll see it is supposed to be where I like it without scrolling. In Pic2, it has gone way upwards to the top of the div when I scroll up. Could someone please explain why this is happening and how I can fix it? -
"AnonymousUser" Error When Non-Admin Users Log In - Django
When I try to login users registered through my AbstractBaseUser model I get the error: 'AnonymousUser' object has no attribute '_meta' Which highlights the code: login(request, user) However, if the user is an admin there is no problem, leaving me to believe that the problem isn't with the 'login_view', but a problem with how the user is tagged (so to speak) when they are registered with AbstractBaseUser. Any help would be much appreciated! Here is my code: Models.py from django.db import models from django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager, PermissionsMixin ) class UserManager(BaseUserManager): def create_user(self, first_name, last_name, email, password=None, is_active=True, is_staff=False, is_admin=False): if not first_name: raise ValueError("Users must enter their first name") if not last_name: raise ValueError("Users must enter their last name") if not email: raise ValueError("Users must enter an email") if not password: raise ValueError("Users must enter a password") user_obj = self.model( first_name = first_name, last_name = last_name, email = self.normalize_email(email), ) user_obj.set_password(password) #set and change password? user_obj.admin = is_admin user_obj.staff = is_staff user_obj.active = is_active user_obj.save(using=self._db) return user_obj def create_superuser(self, first_name, last_name, email, password=None): user = self.create_user( first_name, last_name, email, password=password, is_staff=True, is_admin=True ) return user class User(AbstractBaseUser, PermissionsMixin): first_name = models.CharField(max_length=255, blank=True, null=True) last_name = models.CharField(max_length=255, blank=True, null=True) … -
Celery + django - pdf generator
I have some question, how to catch pdf file witch I generate in tasks.py and start download it automaticly after redirect to home page and put the download link to this page? My task.py work because I see the result in terminal. My tasks.py: @shared_task def html_to_pdf(ctx): html_string = render_to_string( 'pdf_template.html', ctx) html = HTML(string=html_string) html.write_pdf('/tmp/report.pdf') fs = FileSystemStorage('/tmp') with fs.open('report.pdf') as pdf: response = HttpResponse(pdf, content_type='application/pdf') response['Content-Disposition'] \ = 'attachment; filename="report.pdf"' return response My views.py: class PdfCreatorView(View): def get(self, request): form = PdfForm return render(request, 'home_page.html', {'form': form}) def post(self, request): form = PdfForm(request.POST) if form.is_valid(): name = form.cleaned_data['name'] date_of_generation = form.cleaned_data['date_of_generation'] pdf_text_content = form.cleaned_data['pdf_text_content'] pdf_numbers_content = form.cleaned_data['pdf_numbers_content'] ctx = {'name': name, 'date_of_generation': date_of_generation, 'pdf_text_content': pdf_text_content, 'pdf_numbers_content': pdf_numbers_content} html_to_pdf.delay(ctx) url = reverse('home_page') return HttpResponseRedirect(url) -
Django: Uploading files using a validator but without using a database/table
I'm trying to use a really simple upload form with a validator to check the file extension. But when I try to upload something I get the error "OperationalError at /upload/ no such table: mysite_document" I don't need a table though, I just need to allow people to upload files. I read that putting "managed = False" into the model class will stop it doing this but I still keep getting this error. Can anyone tell me where I'm going wrong? -
Raise Validation Error Instantly in Django Forms
I am working with a ModelForm that looks like this: class TestForm(forms.ModelForm): class Meta: model = TestModel fields = ('name', 'description', 'date') widgets = { 'execution_date': forms.DateInput(attrs={'type': 'date'}), } What I' m hoping to do is look at the date field and make sure it is today's date or a future date before submitting the form, the same way an EmailFieldraises and error instantly if you enter an address without the @ sign and try to move on. Normally I'd let the user hit submit, then check the date and return the form if things don't look right, however I am working with stripe and the submit button actually triggers a Stripe check out then validates the form which would charge the customer twice if they had en error. Any ideas on how I can solve this? -
TypeError: Direct assignment to the forward side of a many-to-many set is prohibited
I have the models "Software" , "Company". >>> Software._meta.get_fields() (<ManyToManyRel: newapp.company>, <django.db.models.fields.AutoField:id>, <django.db.models.fields.CharField: name>) >>> Company._meta.get_fields() (<django.db.models.fields.AutoField: id>, <django.db.models.fields.CharField: name>, <django.db.models.fields.related.ManyToManyField: product>) I've created the following objects: >>> c3=Company.objects.create(name='Oracle Corporation') >>> s3=Software.objects.create(name='Oracle Database') When I add a Software instance to a Company object, it is ok. >>> c3.product.add(s3) >>> Company.objects.all() <QuerySet [<Company: JetBrains (PyCharm)>, <Company: Apple (iOS)>, <Company: Oracle Corporation (Oracle Database)>]> However, I tried to get the same result in other way. And I got the following error: TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use product.set() instead. How to use product.set() in order to get the same result shown above? -
Django permission to create a folder when being served by Apache2
I am serving a Django site using Apache2 and mod_wgsi on a Debian 8 machine. I have correctly set the permissions to access the database and static file directories and the directory my_site/media. However, the site needs to create a directory in my_site/media (i.e. my_site/media/another_directory) and I can't seem to give apache2 permission to do this. The permission for media are: drwxrwxrwx 2 scamp www-data 4096 Jan 10 03:09 media The Django error I get is Exception Type: PermissionError Exception Value: [Errno 13] Permission denied: 'media/new_folder' This is my django.conf: Alias /robots.txt /home/scamp/trcalc_django/static/robots.txt Alias /favicon.ico /home/scamp/trcalc_django/static/favicon.ico Alias /media/ /home/scamp/trcalc_django/media/ Alias /static /home/scamp/trcalc_django/static <Directory /home/scamp/trcalc_django/static> Require all granted </Directory> <Directory /home/scamp/trcalc_django/media> Require all granted </Directory> WSGIScriptAlias / /home/scamp/trcalc_django/wsgi.py <Directory /home/scamp/trcalc_django> <Files wsgi.py> Require all granted </Files> </Directory> Is there something else I need to put in the apache conf? or some other permissions that need to be set? -
Django ListView inserting blank <li> after each element
I am new to Django and trying to grasp why or how to mitigate the extra <li> and have not found anything yet. Here is an image of what the output is doing.li elements And here is a snippet of my template: template -
Any good examples of an open source news site / project built on Wagtail
Complete django / wagtail beginner here working to build a news platform. Does anyone know of good examples I can use as a reference point for a project like this? All I have ever built is a personal blog so I'm not entirely sure how to go about structuring things like my apps and whatnot. -
How to deal with CMS style HTML fields and malformed HTML
I have a text field on my django site that allows certain users to insert HTML and text, and I want to make sure that the inserted text does not mess with the code outside of the div that contains the text. For instance if I accidentally specify " without and open tag I wouldn't want the textfield to malform/escape out of the parent div. What is the best way to deal with this? I want to continue to allow full HTML on this field at the moment as I only use it personally to create posts. -
Django: When to use model fields and when to use reverse queries.
I have a question regarding best practices with Django models. I have webscraper running that indexes both 'Ads', 'Sellers' and 'Searches'. A (simplified) representation of these models would look like this: class Search(models.Model): date: models.DatetimeField(auto_now=True) class Seller(models.Model): name: models.CharField(max_length=500) profile_url: models.CharField(max_length=500) class Ad(models.Model): title: models.CharField(max_length=500) price: models.FloatField() seller: models.Foreignkey(Seller, related_name='ads') found_in: models.Foreignkey(Search, related_name='ads') I'm currently creating detailview for these different models that each display statistical information. For the 'Seller' model I would like to show 'total ads', 'average price' and 'median price' attributes, and for the search I would like to display these as well. What I am wondering is how I should get that data. I could do it by a reverse query (Seller.ads, etc), or I could create a new field on the Seller model that is set after each scraping operation. It seems somewhat silly to set these fields that can be easily retrieved with a simple query, but this database is probably going to reach tens of thousands of lines, so it might get slower in the long run. I am basically wondering what the best practices are, and if there is a somewhat specific 'cut of point' between retrieving information via a database query vs … -
create httpOnly cookie in Angular and Django
Am building an app using Django as the backend and Angular as the frontend. I understand that saving authentication token in httpOnly cookies is the safest, great. The real question is how do i do that. Been hearing around that i will need something like a middle man server to do that but i have not the slightest idea. Could anyone kindly point me in the right direction? I would be eternally grateful. I've tried setting it on django that was when i realized it cannot be set across domain. So pls help Angular 5 python 3.6 django 1.11 -
Couldn't load "object". Somehow it went missing?
Am using haystack with solr 6.6 for search indexing. Now i want to automatically update indexes when data changes in my models under indexing, so am using celery_haystack for that. Unfortunately, each time index should be updated i get could not load [app.model.pk]. Somehow it went missing error python 3.6.3 django 1.11.6 celery 4.1.0 django-haystack 2.7.dev0 celery-haystack 0.10 Thanks in advance. -
Passing a nested dictionary to requests module
I have a nested dictionary, which I want to pass to a web service (written in PHP) and am struggling, as I can't access the data I need. The dictionary looks something like import requests from nested_dict import nested_dict data = nested_dict() data['name'] = 'test' data['cookies']['PHPSESSID']['name'] = 'PHPSESSID' data['cookies']['PHPSESSID']['essential'] = 'Essential' data['cookies']['CookieNotice']['name'] = 'CookieNotice' data['cookies']['CookieNotice']['essential'] = 'Essential' Then I make my request: r = requests.post('someurl.com', data = data) In the receiving url someurl.com (written in PHP), I can access the first level no problem eg header('Content-Type: application/json'); $data = $_REQUEST; $response['content'] = $data['name'] $response = $response['content'] echo json_encode($response); The problem is trying to access the data in the nested dict. I don't know what form this is arriving in when it hits someurl.com, and as a result I can't use to produce a loop. What I want to do is this: header('Content-Type: application/json'); $data = $_REQUEST; $response['content'] = $data['name'] foreach ($data['cookies'] as $k => $v): $response['content'] .= $k." ".$v; endforeach; $response = $response['content'] echo json_encode($response); When the response is printed out in the template, there is content present for the nested section ... Any help much appreciated! -
Error uploading Django project to Digital Ocean
I've a Bad gateway error whenever I try and upload my Django project to Digital ocean. I was following this guide https://pythonprogramming.net/django-web-server-publish-tutorial/ but I didn't update Django, I'm using version 1.8.7. Do I need to change the secret key on the server to the secret key on my project? This is the Nginx error message 2018/01/10 17:07:58 [error] 2210#2210: *5 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 86.167.15.195, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/", host: "159.65.16.251" 2018/01/10 17:08:45 [error] 2210#2210: *7 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 86.167.15.195, server: _, request: "GET / HTTP/1.1", upstream: I've changed allowed hosts in the settings file to = [159.65.16.251] Do I also need to change this our just leave it out? ALLOWED_HOSTS = ip_addresses() Url.py from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^', include('personal.urls')), url(r'^blog/', include('blog.urls')), url(r'^writing/', include('writing.urls')), ]