These are chat archives for django/django

24th
Oct 2017
Anish Shrestha
@annshress
Oct 24 2017 07:25
@chrisRubiano mp
@kpagcha Then did you find a solution? I dont think you can make two testcases to share same database with same fixtures. But you can add custom attributes to your test command to preserve database schema on new TestCases.
--keepdb
this can speed things up a bit.
So anyone can help me in django-channels.
???
WebSocket connection to 'wss://website.com/chat/72' failed: Error during WebSocket handshake: Unexpected response code: 200
Does it have to do anything based on my ws_connect consumer?

@channel_session_user_from_http
def ws_connect(message):
    ...
Isaac Parker
@parrotmac
Oct 24 2017 07:32
@annshress it's been a while since I've played with websockets, but I think you're somehow connecting to something serving HTTP instead of a websocket server
Anish Shrestha
@annshress
Oct 24 2017 07:43
Yes that's what is happening.
Anish Shrestha
@annshress
Oct 24 2017 07:54
Thanks @parrotmac
Carlos A. Rocha
@CARocha
Oct 24 2017 15:20
Hi guys, one question i have this slug: documentary-film-%c2%a8the-deep-space%c2%a8 this is other: hotel-transylvania2%e2%80%b3-first-trailer-the-new-movie, my question is how can i clean this slug with a script or any code help me with this problem? i have in my db a lot this slug same :/ any help me with idea for clean this problem!
Bigyan Karki
@bigyankarki
Oct 24 2017 16:10
hi everyone



<!DOCTYPE html>
<html lang="en">
<head>

  <title>Bigyan Karki</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Programmer. AI Enthusiast">
  <meta name="author" content="Bigyan Karki">


  <!-- Bootstrap Core -->
  <link rel="stylesheet" href="/static/personal/css/bootstrap.css">

  <!-- Custom CSS for the page -->
  <link rel="stylesheet" type="text/css" href="/static/personal/css/style.css"">

  <!-- Core fonts to be used -->
  <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

</head>

<body>
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">BIGYAN KARKI</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="/">HOME</a></li>
        <li><a href="/about">ABOUT ME</a></li>
        <li><a href="/portfolio">PORTFOLIO</a></li>
        <li><a href="/contact">CONTACT</a></li>
      </ul>
    </div>
  </div>
</nav>

<!-- Container (About Section) -->
<div class="container-fluid text-center">


  <div id="about" class="row">
      <div id="about-left" class="col-md-6">

      </div>

      <div id="about-right" class="col-md-6">
          <div id="instafeed"></div>
      </div>
  </div>


</div>

<!-- footer Section -->
<footer class="container navbar-fixed-bottom">
  <p>Design and Copyright &copy Bigyan Karki | 2017</p>
</footer>

<!-- Core JS for the page -->
<script src="/static/personal/js/jquery-3.2.1.min.js"></script>
<script src="/static/personal/js/typed.js"></script>
<script src="/static/personal/js/bootstrap.min.js"></script>

<script>
//for typed.js
$(function(){
        $(".typed").typed({
            strings: ["Hello World. ", "Wear those sneakers", "and", "travel with me", "in the journey", "of my life."],
            typeSpeed: 80
        });
    });

</script>
<script src="/static/personal/js/instafeed.js"></script>
<script type="text/javascript">
    var feed = new Instafeed({
        get: 'user',
        sortBy: 'most-liked',
        userId: '1529117750',
        accessToken: '1529117750.1677ed0.ea085d23154842e9a4afd31045d02698',
        clientId: 'cfc71f6ee950443cbdc2d95bb587f39d',
        template: '<a href="" target="_blank" id=""><img src="" /><span></span></a>',
        limit: 9
          });
    feed.run();
</script>

</body>
</html>
can anyone let me know why instafeed is not showing in my about page?
I am using django. and I want instafeed to be shown after user click in about section
Dastan Smailov
@dastan-smailov
Oct 24 2017 16:18
django-admin.exe startproject mysite . It's not work
Help pleae
se
Bigyan Karki
@bigyankarki
Oct 24 2017 16:19
@dastan-smailov you dont have write .exe after djanago-admin
White Rabbit
@Wahtdb_twitter
Oct 24 2017 16:33

When I run this code

        records = []

        for dt in rrule(DAILY, dtstart=a, until=b):
            records.append(
                Predicted_Price(price=predictions_df1.loc[dt.strftime("%Y-%m-%d")], symbol = 'MSFT', date=dt.strftime("%Y-%m-%d")))
        Predicted_Price.objects.bulk_create(records)

I get an error - TypeError: cannot convert the series to <class 'float'>. Does anyone have an idea how can I solve it? I tried .apply(np.float64) , .convert_objects(convert_numeric=True) etc. but nothing works.

Dastan Smailov
@dastan-smailov
Oct 24 2017 16:35
django-admin startproject mysite . Not working
Bigyan Karki
@bigyankarki
Oct 24 2017 16:46
oh i think i ran into same problem a few months back.
i uninstalled python. and re-installed it making sure its in PATH.
and installed django. it worked
William Thorsen
@wrthorsen
Oct 24 2017 19:52
@CARocha Convert the escaped characters back to the original characters: urllib.request.unquote("documentary-film-%c2%a8the-deep-space%c2%a8 "). If you want to slugify after that, you can use django.utils.text.slugify.
Bigyan Karki
@bigyankarki
Oct 24 2017 20:18
Hi @wrthorsen I ran into a problem and I could not figure it out. can you please help me out